How dinosaurerer/spd works
1. This repository is split into two main subsystems: a desktop GUI application under GUI/ and a separate training/inference workspace under YOLO/. The GUI is the user-facing product; the YOLO tree contains experiment artifacts, training scripts, configs, and a second copy of the Ultralytics codebase used for model development.
2. The primary runtime entrypoints are GUI/main.py, GUI/gui.py, and the platform launchers GUI/run.sh / GUI/run.bat. In the YOLO workspace, YOLO/train.py, YOLO/predict.py, and YOLO/show_labels.py support offline model training and inspection.
3. The GUI layer is built with Qt/PyQt-style generated UI files in GUI/ui/ plus custom widgets in GUI/ui/utils/. These include window framing, tables, camera dialogs, drawing helpers, and splash-screen behavior, so the UI is not just a thin shell; it manages most user interaction and visualization.
4. Model execution is orchestrated through GUI/yoloshow/ and GUI/yolocode/. These modules contain window logic, thread-pool management, and version-specific inference threads for YOLOv8 and YOLOv11 variants. The architecture is asynchronous: frames are captured in the UI, handed to worker threads, processed, and returned to the UI for rendering.
5. The inference backend is a local Ultralytics-style stack, duplicated in both GUI/ultralytics/ and YOLO/ultralytics/. This fork includes core engine code (predictor, trainer, validator, exporter), model definitions, dataset configs, trackers, and utility functions. The repository’s custom model work appears centered on a YOLOv11 variant with MSCA attention (yolo11-MSCAAttention1.yaml, YOLO/yolo11-MSCAAttention1-n.yaml).
6. Pretrained weights are bundled locally in GUI/ptfiles/ and YOLO/yolo11n.pt, including detection, segmentation, pose, and custom posture-specific models. This makes the app file-system driven: the GUI selects a local .pt checkpoint and runs inference without depending on an external model service.
7. The data flow for live posture detection is: camera/video/file input → optional skeleton/keypoint preprocessing described in the README via Mediapipe → YOLO-based posture classification → annotated output frames and status feedback in the GUI. The app is designed to support multiple sources, including webcam, RTSP/network camera, video files, images, and folders.
8. Results and user-facing analytics are handled inside the GUI rather than in a separate server. The project includes config files like GUI/config/result.json, save.json, setting.json, and model.json, which suggest persistent settings, selected model state, output paths, and result summaries. The UI utilities also include table views and custom drawing components for displaying detections and statistics.
9. Offline training and evaluation live in the YOLO/ subtree. YOLO/runs/ stores experiment outputs such as args.yaml, TensorBoard event files, results.csv, and weights/best.pt / last.pt. This is the training/output boundary: configs and datasets go in, training happens through the Ultralytics engine, and checkpoints/metrics come out into runs/.
10. The repository includes a substantial dataset/model configuration catalog under GUI/ultralytics/cfg/ and YOLO/ultralytics/cfg/, covering detection, segmentation, pose, oriented boxes, RT-DETR, and multiple YOLO generations. That tells you the architecture is generalized around task-specific model heads, not a single fixed classifier.
11. process_data/ contains one-off dataset preparation scripts such as renaming images/labels and capturing photos. This is the ingestion/preprocessing boundary for building or cleaning the posture datasets before training.
12. Supporting assets are bundled in pngs/, demo_video/, GUI/images/, and GUI/fonts/. These are presentation assets for the desktop app, including the splash video and screenshots used in the UI and README.
13. Architecturally, this is a single-machine, desktop-first system with no obvious backend service tier. The important boundaries are: UI and interaction, threaded inference orchestration, local model/runtime code, and offline training/data-prep workflows. If you draw the system, the central path should be GUI input → worker threads → local Ultralytics/YOLO model → annotated results back to GUI, with a separate training lane feeding the .pt weights used by the GUI.
Main entry points: YOLOSHOW.py Show runtime · trainer.py Ultralytics core · gui.py GUI shell · model.py Model stack
Components 22
Desktop GUI
User-facing Qt application, local inference orchestration, and presentation assets.
- App entry · Desktop startup and OS launch scripts.
GUI/main.py - GUI shell · Main application shell and top-level window wiring.
GUI/gui.py - Show runtime · Window logic, state, and user interaction flow for the desktop app.
GUI/yoloshow/YOLOSHOW.py - Thread pool · Worker scheduling and asynchronous frame processing coordination.
GUI/yoloshow/YOLOThreadPool.py - Inference threads · Version-specific YOLOv8 and YOLOv11 worker threads for inference tasks.
GUI/yolocode/yolov11/YOLOv11Thread.py - Generated UI · Generated Qt UI definitions and resource bindings.
GUI/ui/YOLOSHOWUI.ui - UI widgets · Custom dialogs, tables, drawing helpers, camera widgets, and frame utilities.
GUI/ui/utils/drawFigure.py - App state · Saved settings, selected model, file/folder choices, and results state.
GUI/config/setting.json - Model stack · Local Ultralytics-style runtime used by the GUI for loading and running checkpoints.
GUI/ultralytics/engine/model.py - Autobackend · Backend wrapper for loading and executing local models.
GUI/ultralytics/nn/autobackend.py - MSCA attention · Custom attention module used by the repository's YOLOv11 variant.
GUI/ultralytics/nn/attention/MSCA.py - Bundled weights · Pretrained and custom local .pt checkpoints selected by the GUI.
GUI/ptfiles/yolo11n.pt - Run scripts · Shell and batch entrypoints for starting the desktop application.
GUI/run.sh - Media assets · Splash video, demo clips, screenshots, and fonts used by the GUI and documentation.
GUI/images/splash.mp4
YOLO Workspace
Offline training, prediction, experiment outputs, and the embedded Ultralytics stack.
- Train entry · Offline training and prediction entrypoints for the YOLO workspace.
YOLO/train.py - Predict CLI · Standalone prediction script for running models outside the GUI.
YOLO/predict.py - Label viewer · Dataset label inspection and visualization utility.
YOLO/show_labels.py - Run outputs · Training logs, metrics, TensorBoard files, and saved checkpoints.
YOLO/runs/train/exp2/weights/best.pt - Ultralytics core · Embedded Ultralytics engine, models, data pipelines, trackers, and utilities for experimentation.
YOLO/ultralytics/engine/trainer.py - Configs · Dataset, model, tracker, and solution configuration catalogs.
YOLO/ultralytics/cfg/default.yaml - MSCA model · Custom YOLOv11 MSCA attention configuration used for the project's model work.
YOLO/yolo11-MSCAAttention1-n.yaml
Data Prep
One-off dataset cleanup and capture scripts.
- Prep scripts · Dataset cleanup, renaming, and capture scripts used before training.
process_data/rename.py
Connections 21
- Run scripts → App entry: start · Platform scripts launch the desktop app.
- App entry → GUI shell: boot · Main entry initializes the application shell.
- GUI shell → Generated UI: loads · The shell binds generated Qt forms and resources.
- GUI shell → UI widgets: uses · Custom widgets provide interaction and visualization.
- GUI shell → Show runtime: opens · Shell transitions into the main show window.
- Show runtime → Thread pool: dispatches · Frame work is handed off to the thread pool.
- Thread pool → Inference threads: runs · Pool schedules YOLOv8/YOLOv11 worker threads.
- Inference threads → Model stack: call into · Workers invoke the embedded model runtime.
- Model stack → Autobackend: executes via · Runtime loads checkpoints through the backend adapter.
- Model stack → MSCA attention: includes · Custom model layers extend the embedded network stack.
- Show runtime → App state: persists · UI state, selected model, and results are stored locally.
- Show runtime → Bundled weights: selects · The UI chooses a local checkpoint for inference.
- Show runtime → Media assets: renders · Splash, icons, and demo media support the desktop experience.
- Train entry → Ultralytics core: uses · Training entrypoint invokes the local Ultralytics engine.
- Predict CLI → Ultralytics core: uses · Standalone prediction runs through the same engine.
- Label viewer → Configs: reads · Inspection tools rely on dataset/config metadata.
- Ultralytics core → Configs: loads · Core engine consumes model and dataset configs.
- Ultralytics core → Run outputs: writes · Training produces metrics, events, and weights in runs/
- MSCA model → Ultralytics core: specializes · Custom architecture config feeds the training runtime.
- Prep scripts → Configs: prepares · Prep scripts help shape datasets used by the model configs.
- Bundled weights → Run outputs: originates from · GUI checkpoints are typically trained artifacts from the YOLO workspace.