TrackSense is a real-time desktop vision app for handheld object understanding. It detects prominent objects in the camera feed, tracks them smoothly, adds short Turkish labels on top of the boxes, and writes subtitle-style scene summaries at the bottom of the screen.
The project is built around a hybrid pipeline:
- Local object detection with ONNX YOLO
- Hand-aware ranking and multi-object tracking
- VLM-based labels and scene subtitles through
llama-server
- Startup onboarding inside the camera app instead of terminal setup prompts
- Automatic scan for valid GGUF +
mmprojmodel pairs - Runtime detection for
llama-server - Managed default model download from Hugging Face
- Local-only fallback mode when VLM is unavailable
- Stable multi-object tracking with low-noise overlays
- Modern glass-style UI with status pills and subtitle bar
- Remembered model/runtime selection across launches
TrackSense is designed for the following interaction:
- A user shows an object to the camera
- The object gets a stable rounded box
- A short label appears above the box
- A subtitle-style Turkish sentence describes the scene
- If two objects are shown, both can be tracked independently
- Background clutter is filtered so the screen does not fill with random boxes
- Python 3.10+
- A working webcam
llama-serverinstalled and accessible throughPATHor selected from the in-app settings- Enough local disk space for the managed model download
Python dependencies are listed in requirements.txt.
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtTrackSense does not auto-install the runtime. It detects whether llama-server exists and guides the user if it is missing.
Typical options:
- macOS: install
llama.cppwith Homebrew or use a manually built binary - Windows: use a prebuilt binary or package manager
- Linux: use a distro package or a manually built binary
You can also set the runtime path later from the in-app settings screen.
python main.pyOn startup the app silently checks:
- Saved active model path
- Managed model cache
- Previously remembered model directories
- LM Studio model directory if present
llama-serverruntime availability
If both a valid model and runtime are found, the app goes straight into live mode.
If not, it opens an in-app onboarding overlay with options to:
- Download the default managed model
- Continue in local-only mode
- Select a discovered model
- Pick a model folder manually
- Pick a
llama-serverexecutable manually
The managed model used by onboarding is:
- Repository:
bartowski/google_gemma-4-E2B-it-GGUF - Text model:
google_gemma-4-E2B-it-Q4_K_S.gguf - Vision projector:
mmproj-google_gemma-4-E2B-it-f16.gguf
The download is stored in a per-user cache directory, not inside the git repo.
q: quitd: toggle debug HUDm: switch active models: open settingsj/k: move through model lists in overlaysEsc: close onboarding/settings overlays or quit from startup screens
Full pipeline is active:
- local detection
- hand-aware selection
- tracking
- VLM labels
- VLM subtitles
Used when the user skips VLM setup or runtime is missing:
- local detection and tracking continue
- object boxes still render
- fallback labels remain visible
- subtitle area stays in local status mode
main.py: top-level app state machine and UI loopbootstrap.py: startup scan, onboarding helpers, settings, model discoveryconfig.py: app constants, environment settings, pathsvision.py: detector, hand analysis, tracking, scene statevlm.py: VLM worker, label/subtitle requests, runtime readinessmodel_server.py:llama-serverlaunch and health checksui.py: modern overlay renderingapp_types.py: shared dataclasses and state typestests/test_smoke.py: smoke tests
TrackSense supports environment variables for tuning runtime behavior:
CAMERA_WIDTHCAMERA_HEIGHTCAMERA_DEVICE_INDEXCAMERA_BUFFER_SIZESERVER_START_TIMEOUT_SECONDSREQUEST_TIMEOUT_SECONDSDETECTION_INTERVAL_SECONDSSUBTITLE_INTERVAL_SECONDSLABEL_INTERVAL_SECONDSTRACK_MAX_MISSESTRACK_MIN_HITSTRACK_ASSOCIATION_DISTANCEMIN_PRIORITY_SCOREDETECTOR_INPUT_SIZEDETECTOR_CONFIDENCEDETECTOR_NMS_IOU
See config.py for current defaults.
TrackSense stores user settings and managed models outside the repo.
- macOS:
~/Library/Application Support/TrackSense/settings.json - Windows:
%APPDATA%/TrackSense/settings.json - Linux:
~/.config/gemma-camera-prototype/settings.json
- macOS:
~/Library/Caches/TrackSense/models - Windows:
%LOCALAPPDATA%/TrackSense/models - Linux:
~/.cache/gemma-camera-prototype/models
The app also reads legacy settings written under the old GemmaCameraPrototype name.
Run the smoke tests with:
./.venv/bin/python -m unittest discover -s tests -vStatic syntax validation:
./.venv/bin/python -m py_compile main.py app_types.py bootstrap.py config.py model_server.py ui.py vlm.py vision.py tests/test_smoke.py- Install
llama-server - Or open settings with
sand select the binary manually
- Check webcam permissions for Terminal or Python
- Verify
CAMERA_DEVICE_INDEX - Make sure another app is not locking the camera
- The selected folder must contain both:
- a text
.ggufmodel - a matching
mmproj*.gguf
- a text
The app falls back to center-and-size prioritization. Tracking continues, but handheld-object emphasis becomes weaker.
Reduce request load by tuning:
LABEL_INTERVAL_SECONDSSUBTITLE_INTERVAL_SECONDSREQUEST_TIMEOUT_SECONDS
High-level technical notes are documented in docs/ARCHITECTURE.md.