Multi-person pose detection and tracking for wall dancers in low-light outdoor settings.
chmod +x install.sh run.sh
./install.sh # installs dependencies via uv
./run.sh # launches GUI + camera processingRequirements: Python 3.10+, uv installed (pip install uv if missing), a webcam or capture card, and optional CUDA GPU for best performance. Model weights live in models/ (already included in the repo).
- Top bar: pick project, pick saved config version, save current settings, GPU/VRAM readout.
- Video panel: live preview with INPUT / PREVIEW / ENHANCE / MODEL tables, plus FPS/dancer counts and timing breakdowns.
- Control panel: detection caps, visualization toggles, tracker tuning, OSC target, quit button.
Keyboard shortcuts: Q quit, E enhance, S skeleton, K keypoints, B bbox, T trails, I IDs, R reset tracker, +/- adjust preview scale.
- Configs are stored under
configs/<project>/<project>_YYYYMMDD_HHMMSS.json. - The GUI top bar lets you create/select projects, pick a saved version, and save the current settings; the latest project is remembered in
configs/last_project.txt. - Settings cover camera source, preview scale, enhancement, YOLO model/imgsz/conf, tracker params, OSC target, and visualization flags.
- Camera capture (via OpenCV, see
camera_manager.py). - Optional enhancement (CLAHE + gamma) in
enhancer.py. - Pose detection with Ultralytics YOLO in
pipeline.FrameProcessor. - Duplicate filtering + Kalman/Hungarian tracking in
tracker.py. - Rendering/overlay in
visualization.pyand OSC output inosc_output.py. - DearPyGui front-end in
gui.py+ layout helpers ingui_builder.py.
main.py— thin entrypoint delegating toapp.main.app.py— orchestrator wiring camera, pipeline, GUI, OSC, and configs.pipeline.py— frame processing (enhance → YOLO → dedupe → track → OSC).camera_manager.py— camera discovery/open/close with state.config_store.py— save/load configs per project and remember last project.gui.py— GUI logic/callbacks;gui_builder.py/gui_icons.pyhold layout/theme.enhancer.py,tracker.py,osc_output.py,visualization.py,config.py— processing utilities and defaults.
Support files: install.sh (uv sync), run.sh (launch), configs/ (saved presets), models/ (YOLO weights).
- Enable TensorRT via the TRT checkbox for ~2× inference speedup (first build takes 2-5 minutes).
- Switch to
yolo11n-poseoryolo11s-posefor speed;yolo11mis a balanced default. - Enable FP16 when running on CUDA for ~20-30% speedup (applies to PyTorch mode).
- Increase Frame Skip (1–2) if the scene is stable; tracker interpolates between detections.
- Lower preview scale if the UI lags; it only affects display, not detection.
TensorRT provides significant inference speedup (~2×) by optimizing the model for your specific GPU.
- In the MODEL section, check the TRT checkbox
- If no engine exists for the current model + imgsz, you'll be prompted to build one
- Building takes 2-5 minutes (GPU stats update during build)
- Once built, the engine is saved and reused automatically
- Engines are named
{model}_{imgsz}.engine(e.g.,yolo11m-pose_960.engine) - Different imgsz settings require different engines
- Engines are GPU-specific and must be rebuilt on different hardware
- Engine preference is saved with your config
- If TensorRT is unavailable, the checkbox will be disabled
- If an engine fails to load, the app falls back to PyTorch
- On startup, if saved config had TRT but engine is missing, PyTorch is used
All coordinates are normalized (0–1) to the input frame.
| Address | Arguments | Description |
|---|---|---|
/walldance/count |
[n] |
Number of tracked dancers |
/walldance/dancer/<id>/centroid |
[x, y] |
Dancer center |
/walldance/dancer/<id>/bbox |
[x, y, w, h] |
Bounding box |
/walldance/dancer/<id>/velocity |
[vx, vy] |
Velocity |
/walldance/dancer/<id>/keypoints |
[x0,y0,c0, ...] |
17 keypoints (51 floats) |
/walldance/clear |
[1] |
Tracker reset event |
- No detections: verify camera with
ffplay /dev/video0, lower confidence, or upscale more. - Flicker/ID swaps: raise tracker distance/age, lower confidence slightly, ensure lighting is stable.
- Slow FPS: use faster model, enable TensorRT, enable FP16, increase frame skip, or reduce preview scale.
- TRT build fails: ensure CUDA drivers are up to date, check GPU memory, try smaller model first.
- TRT checkbox disabled: TensorRT not installed; install with
pip install tensorrt. - OSC not received: check IP/port, ensure firewall allows UDP, verify the
Enable OSCtoggle.