aparsoft/yolo-streamlit-detection-tracking

YOLO Vision Studio: a free, open-source Streamlit app for detection, segmentation, pose, text prompts (YOLO World, YOLOE) and tracking with honest counts. Built on Ultralytics YOLO26.

🔬 YOLO Vision Studio – Streamlit UI for Ultralytics YOLO

What it is – A free, open‑source web app (built with Streamlit) that lets you run state‑of‑the‑art YOLO models on images or video streams and see the results live. It supports detection, instance segmentation, pose estimation, text‑based object queries (YOLO World), and multi‑object tracking with several modern trackers.

Why it matters – Counting different objects across a video is hard because people (or cars) disappear and re‑appear. The app shows two numbers on each frame:

  • In‑frame – what the detector sees right now.
  • Walked‑past / tracked – unique IDs that have been confirmed for at least 5 frames, giving an honest total. It also displays a churn metric that tells you how often tracks break.

Key features

Feature Details
Models Ultralytics YOLO‑v8‑26 (nano → xlarge), YOLO‑E, YOLO World v2, RT‑DETR. Automatic weight download.
Tasks Object detection, instance segmentation, pose key‑points, text‑prompted “find‑what‑you‑type”.
Tracking Four built‑in trackers – ByteTrack, BoT‑SORT, Deep OC‑SORT, TrackTrack – with optional appearance ReID.
Sources Local video files, webcam (browser), RTSP streams, YouTube URLs.
Live UI Sidebar to pick mode, model, confidence, class filters, frame‑skip factor, and tracker settings.
Counts & metrics Per‑class counts, ID issuance vs confirmed tracks, churn, and a summary table after a video finishes.
Multi‑video Show several videos side‑by‑side, each with its own tracker.
Deployable Works locally or on Streamlit Cloud (CPU‑only).

Quick start (requires Python 3.10+)

# Clone and enter the repo
git clone https://github.com/aparsoft/yolo-streamlit-detection-tracking.git
cd yolo-streamlit-detection-tracking

# Recommended: use uv (fast, lock‑file aware)
uv sync                     # creates .venv with exact deps
uv run python scripts/get_sample_videos.py   # optional sample clips
uv run streamlit run app.py   # opens http://localhost:8501

Or with pip:

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt   # or requirements-lock.txt for exact versions
python scripts/get_sample_videos.py   # optional
streamlit run app.py

The first run downloads the required YOLO weights into weights/.

How to use

  1. Choose Image or Video mode in the sidebar.
  2. Pick a source (file, webcam, RTSP, YouTube).
  3. Select a model (nano for speed, xlarge for accuracy) and set a confidence threshold.
  4. (Video) Choose a tracker and optionally enable ReID.
  5. Press Detect – the app streams frames with bounding boxes, masks, skeletons, or highlighted prompts, plus live counts.
  6. Stop early with the ⏹ Stop button; a tracking summary appears when the video ends.

Configuration – All defaults live in config.py (confidence, minimum track hits, display size, etc.). Adding a custom .pt model is as simple as dropping it into weights/ and registering it in config.py.

Project layout

app.py                # Streamlit entry point, UI routing
config.py             # Model catalog, defaults
model_loader.py       # Caches models per session
image_service.py      # Handles image uploads & inference
video_service.py      # Video source handling, tracking, overlay
scripts/get_sample_videos.py
docs/ (playground notebook, notes)
assets/ (README images)
weights/ (downloaded model files)

License – Apache‑2.0 for the app code; model weights are under Ultralytics’ AGPL‑3.0 (commercial use requires their Enterprise licence).

Who might like this – Researchers or hobbyists who want a ready‑made UI to experiment with YOLO detection, segmentation, pose, and tracking without writing code; developers needing a quick demo for surveillance, retail foot‑traffic analysis, or any video‑based counting task.

Related

  • Project
  • Project
  • Project
  • Project
  • Project