How ckckh2023/trashgo_airecognition works
TrashGo is a Qt/QML desktop assistant centered on image-based garbage sorting. The primary workflow is selecting an image, classifying it with a configured local model or Baidu API, presenting the category and disposal advice, and recording the result for later history and bookmarks. The graph also includes settings and release/tip capabilities documented by the README. QML page wiring and unsampled implementation details are represented conservatively; the README documents SQLite history and dark mode.
Main entry points: Main.qml Application shell · GarbageClassifier.cpp Garbage classifier · main.cpp Application startup · HistoryRecord.cpp History records
Components 19
QML interface
- Application startup
main.cpp - Application shell
Main.qml - Home page
components/pages/HomePage.qml - Classification page
components/pages/GarbagePage.qml - History page
components/pages/HistoryPage.qml - Bookmarks page
components/pages/StarPage.qml - Settings page
components/pages/SettingPage.qml - About dialog
components/pages/AboutDialog.qml
Recognition
- Garbage classifier
src/GarbageClassifier.cpp - Category guidance
src/GarbageData.cpp - Local ONNX models
model - Result image provider
src/ReturnImage.cpp
History and settings
- History records
src/HistoryRecord.cpp - SQLite history
- Configuration handler
src/IniFileHandler.cpp
Online features
- Release and daily tips
src/GitHubOnline.cpp
Other components
- User
- Baidu AI API
- GitHub releases
Connections 27
- User → Application shell: uses
- Application startup → Application shell: loads
- Application startup → Garbage classifier: exposes
- Application startup → History records: exposes
- Application startup → Configuration handler: exposes
- Application startup → Release and daily tips: exposes
- Application startup → Result image provider: registers
- Application shell → Home page: shows
- Application shell → Classification page: shows
- Application shell → History page: shows
- Application shell → Bookmarks page: shows
- Application shell → Settings page: shows
- Application shell → About dialog: shows
- Classification page → Garbage classifier: requests classification
- Garbage classifier → Configuration handler: reads provider
- Garbage classifier → Local ONNX models: loads model
- Garbage classifier → Baidu AI API: sends image
- Garbage classifier → Category guidance: looks up guidance
- Garbage classifier → History records: saves result
- Classification page → Result image provider: requests image
- History page → History records: queries records
- Bookmarks page → History records: queries bookmarks
- History records → SQLite history: reads and writes
- Settings page → Configuration handler: updates preferences
- About dialog → Release and daily tips: requests release info
- Home page → Release and daily tips: requests daily tip
- Release and daily tips → GitHub releases: checks releases