AI Auto Annotation & YOLO Training Pipeline, End-to-end object detection auto-labeling and YOLO training platform. VLM-powered annotation with NVIDIA LocateAnything-3B, manual refinement, one-click YOLO training, video keyframe extraction, and model validation. Supports image and video.
225
stars
331
commits
Python
primary language
Aug 11, 2026
updated
简体中文 | English
🖼️ image/video → 🔍 VLM / SAM3 detection → 🎯 SAM2/SAM3 mask → ✏️ refine → 📦 export → 🚀 YOLO → ✅ model
Images or videos in → YOLO model out, with VLM auto-labeling (LocateAnything-3B), SAM2.1 / SAM3 mask refinement, and human-in-the-loop correction. Multi-format export, one-click YOLO training (detect & segment), video keyframe extraction, and model validation — all GPU-accelerated on macOS MPS and Windows/Linux CUDA.

See Architecture & Workflow Documentation for detailed Mermaid diagrams.
📚 User Guide (English) | 📚 用户指南 (中文)
Comprehensive guides: quick start, annotation best practices, training parameter tuning, model deployment.
| VLM Pre-annotation & Refinement | YOLO Training |
|---|---|
![]() | ![]() |
| Video Keyframe Entry | Model Validation |
|---|---|
![]() | ![]() |
| Layer | Technology |
|---|---|
| Visual Grounding | NVIDIA LocateAnything-3B (Qwen2.5-3B + MoonViT) |
| Segmentation | SAM 2.1 / SAM3 — Segment Anything Model 2 / 3 |
| Object Detection | YOLOv8 / v11 / v26 — Detect & Segment (Ultralytics) |
| Backend | Python FastAPI + PostgreSQL + SSE |
| Frontend | React + TypeScript + Vite + Tailwind CSS + antd |
| GPU Memory | Strategy Pattern (gpu_memory.py) — CUDA expandable segments / MPS synchronize + empty_cache |
| State | Zustand + TanStack Query + ahooks |
| i18n | i18next (English / 简体中文 / 日本語) |
| Video | ffmpeg (scene / motion / interval extraction) |
| Tooling | pnpm, ESLint, Prettier, Husky, commitlint, Playwright |
git clone https://github.com/Somnusochi/VLM-AutoYOLO.git
cd VLM-AutoYOLO
python3 cli.py all
The CLI handles everything: dependency checks, Python venv, pip install, pnpm install, database migrations, and launches both services. Open http://localhost:5173.
On Windows, the CLI recognizes the pnpm.cmd and npm.cmd shims installed by Node.js and invokes them through the command interpreter, so python cli.py all works from PowerShell or CMD.
Commands:
python3 cli.py all # Setup + download models + start
python3 cli.py all --no-models # Skip model download
python3 cli.py all --models=vlm # Only download VLM model
python3 cli.py all --models=vlm,sam2 # Download VLM + SAM2
python3 cli.py setup # Install deps + init DB
python3 cli.py start # Launch services
python3 cli.py stop # Stop services
python3 cli.py status # Check if running
python3 cli.py download --models=vlm # Re-download specific model
Requirements: Linux or Windows (WSL2) with NVIDIA GPU + NVIDIA Container Toolkit. macOS is not supported — Docker on Mac has no GPU passthrough. Use Manual Setup instead.
Quick start with pre-built images:
curl -O https://raw.githubusercontent.com/Somnusochi/VLM-AutoYOLO/master/docker-compose.yml
docker compose up -d
open http://localhost # Frontend
open http://localhost:8000/docs # API docs
Build from source:
git clone https://github.com/Somnusochi/VLM-AutoYOLO.git
cd VLM-AutoYOLO
docker compose up -d --build
Services:
| Service | Port | Description |
|---|---|---|
| Frontend | 80 | React web UI (Nginx) |
| Backend | 8000 | FastAPI server |
| SAM3 | 8002 | SAM3 standalone inference service |
| Database | 5432 | PostgreSQL |
GPU Support — docker-compose.yml now has built-in GPU passthrough configured. No manual editing required.
Persistent Storage (Docker volumes):
pgdata — Database · model-cache — VLM model · sam3-cache — Hugging Face cache for SAM2/SAM3 · uploads — User images/videos · training-data — YOLO training outputsBackup / Restore:
docker compose exec db pg_dump -U postgres autolabeling > backup.sql
cat backup.sql | docker compose exec -T db psql -U postgres autolabeling
Requirements:
| Resource | Minimum | Recommended |
|---|---|---|
| Python | 3.12+ | 3.12+ |
| Node.js | 22+ | 22+ |
| PostgreSQL | 16+ | 16+ |
| ffmpeg | Any | — |
| macOS | Apple Silicon 16GB | 24GB+ |
| NVIDIA GPU | 12GB VRAM | 16GB+ |
Setup:
git clone https://github.com/Somnusochi/VLM-AutoYOLO.git
cd VLM-AutoYOLO
# Backend
cd backend
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cd ..
# Frontend
cd frontend
pnpm install
cd ..
# Database (PostgreSQL recommended, but SQLite is supported out of the box)
# If using PostgreSQL:
# psql -d postgres -c "CREATE DATABASE autolabeling;"
# cp backend/.env.example backend/.env
# If you prefer a zero-setup SQLite database, just skip the two steps above. The system will auto-generate autolabeling.db
# Migrations
cd backend
PYTHONPATH=. alembic upgrade head
Pre-download models (optional):
huggingface-cli download nvidia/LocateAnything-3B --local-dir backend/model
python -c "from sam2.build_sam import build_sam2_hf; build_sam2_hf('facebook/sam2.1-hiera-base-plus', device='cpu')"
Launch:
./start.sh # macOS / Linux
start.bat # Windows
| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| Backend | http://localhost:8000 |
| API Docs | http://localhost:8000/docs |
Full directory tree: docs/STRUCTURE.md
Upload images or video keyframes with open-vocabulary descriptions (e.g. fire, smoke, red car). LocateAnything-3B automatically detects and draws bounding boxes.
Enable SAM2 (Segment Anything Model 2) to refine VLM bounding boxes into pixel-precise masks.
Switch to SAM3 mode for text-driven detection and segmentation in a single pass — no VLM required.
cat, red car) — SAM3 detects and segments all matching instancesbackend/sam3-venv/)HF_TOKEN — set this env var before starting the backend. Two steps:
~/.cache/huggingface/hub/ after first downloadstarting → loading → loaded)model_type (VLM / VLM+SAM2 / SAM3) for traceabilityUpload a video, extract keyframes, select and batch-annotate.
Canvas-based annotation with View / Draw modes.
.pt files.txt filesMODEL_IDLE_TIMEOUT_SECONDS of inactivityGET /api/v1/model/events streams VLM, SAM2, SAM3 status in one connectiongpu_memory.py) — CUDA expandable_segments / MPS synchronize+empty_cache+gcLoading to GPUIf the VLM model stays at Loading to GPU, the model files were already found and the failure is likely happening while PyTorch moves LocateAnything-3B onto CUDA/MPS. The UI now surfaces the backend error directly, so check the toast message or backend logs for the real cause, such as CUDA OOM, missing NVIDIA runtime, driver mismatch, or a dependency import error.
Useful Docker checks:
docker compose logs backend --tail=200
docker compose exec backend python - <<'PY'
import torch
print("cuda:", torch.cuda.is_available())
print("device:", torch.cuda.get_device_name(0) if torch.cuda.is_available() else None)
print("mem:", torch.cuda.mem_get_info() if torch.cuda.is_available() else None)
PY
nvidia-smi
Full API documentation with request/response examples: docs/API.md
| Platform | Inference | Training |
|---|---|---|
| macOS (Apple Silicon) | MPS | MPS |
| Linux / Windows (NVIDIA) | CUDA | CUDA |
Auto-detection: CUDA → MPS. Override via DEVICE env. CPU not supported.
Tested locally on an Apple MacBook Pro (M4 Pro, 24GB Unified Memory) using Apple MPS hardware acceleration.
| Image Resolution (Max Side) | Inference Latency | Actual Memory Footprint |
|---|---|---|
| Thumbnail (256px) | ~0.68s | Stable around ~11.8GB |
| High-Res (1024px) | ~4.35s | Stable around ~11.8GB |
Full detailed benchmarks across different hardware configurations: docs/BENCHMARKS.md
gpu_memory.py centralizes CUDA / MPS cleanup; expandable_segments:True# Frontend
cd frontend && pnpm install && pnpm run lint && pnpm run build
# Backend
cd backend && source .venv/bin/activate
PYTHONPATH=. alembic upgrade head
python -m compileall app alembic
Code: AGPL-3.0.
Third-party dependencies:
If this project helps you, please ⭐ star it on GitHub. I'm open to new opportunities — reach out: somnusochi@gmail.com
330 commits
1 commits
Python
52.2%
TypeScript
45.4%
CSS
1.1%
AI Auto Annotation & YOLO Training Pipeline, End-to-end object detection auto-labeling and YOLO training platform. VLM-powered annotation with NVIDIA LocateAnything-3B, manual refinement, one-click YOLO training, video keyframe extraction, and model validation. Supports image and video.
225
stars
331
commits
Python
primary language
Aug 11, 2026
updated
简体中文 | English
🖼️ image/video → 🔍 VLM / SAM3 detection → 🎯 SAM2/SAM3 mask → ✏️ refine → 📦 export → 🚀 YOLO → ✅ model
Images or videos in → YOLO model out, with VLM auto-labeling (LocateAnything-3B), SAM2.1 / SAM3 mask refinement, and human-in-the-loop correction. Multi-format export, one-click YOLO training (detect & segment), video keyframe extraction, and model validation — all GPU-accelerated on macOS MPS and Windows/Linux CUDA.

See Architecture & Workflow Documentation for detailed Mermaid diagrams.
📚 User Guide (English) | 📚 用户指南 (中文)
Comprehensive guides: quick start, annotation best practices, training parameter tuning, model deployment.
| VLM Pre-annotation & Refinement | YOLO Training |
|---|---|
![]() | ![]() |
| Video Keyframe Entry | Model Validation |
|---|---|
![]() | ![]() |
| Layer | Technology |
|---|---|
| Visual Grounding | NVIDIA LocateAnything-3B (Qwen2.5-3B + MoonViT) |
| Segmentation | SAM 2.1 / SAM3 — Segment Anything Model 2 / 3 |
| Object Detection | YOLOv8 / v11 / v26 — Detect & Segment (Ultralytics) |
| Backend | Python FastAPI + PostgreSQL + SSE |
| Frontend | React + TypeScript + Vite + Tailwind CSS + antd |
| GPU Memory | Strategy Pattern (gpu_memory.py) — CUDA expandable segments / MPS synchronize + empty_cache |
| State | Zustand + TanStack Query + ahooks |
| i18n | i18next (English / 简体中文 / 日本語) |
| Video | ffmpeg (scene / motion / interval extraction) |
| Tooling | pnpm, ESLint, Prettier, Husky, commitlint, Playwright |
git clone https://github.com/Somnusochi/VLM-AutoYOLO.git
cd VLM-AutoYOLO
python3 cli.py all
The CLI handles everything: dependency checks, Python venv, pip install, pnpm install, database migrations, and launches both services. Open http://localhost:5173.
On Windows, the CLI recognizes the pnpm.cmd and npm.cmd shims installed by Node.js and invokes them through the command interpreter, so python cli.py all works from PowerShell or CMD.
Commands:
python3 cli.py all # Setup + download models + start
python3 cli.py all --no-models # Skip model download
python3 cli.py all --models=vlm # Only download VLM model
python3 cli.py all --models=vlm,sam2 # Download VLM + SAM2
python3 cli.py setup # Install deps + init DB
python3 cli.py start # Launch services
python3 cli.py stop # Stop services
python3 cli.py status # Check if running
python3 cli.py download --models=vlm # Re-download specific model
Requirements: Linux or Windows (WSL2) with NVIDIA GPU + NVIDIA Container Toolkit. macOS is not supported — Docker on Mac has no GPU passthrough. Use Manual Setup instead.
Quick start with pre-built images:
curl -O https://raw.githubusercontent.com/Somnusochi/VLM-AutoYOLO/master/docker-compose.yml
docker compose up -d
open http://localhost # Frontend
open http://localhost:8000/docs # API docs
Build from source:
git clone https://github.com/Somnusochi/VLM-AutoYOLO.git
cd VLM-AutoYOLO
docker compose up -d --build
Services:
| Service | Port | Description |
|---|---|---|
| Frontend | 80 | React web UI (Nginx) |
| Backend | 8000 | FastAPI server |
| SAM3 | 8002 | SAM3 standalone inference service |
| Database | 5432 | PostgreSQL |
GPU Support — docker-compose.yml now has built-in GPU passthrough configured. No manual editing required.
Persistent Storage (Docker volumes):
pgdata — Database · model-cache — VLM model · sam3-cache — Hugging Face cache for SAM2/SAM3 · uploads — User images/videos · training-data — YOLO training outputsBackup / Restore:
docker compose exec db pg_dump -U postgres autolabeling > backup.sql
cat backup.sql | docker compose exec -T db psql -U postgres autolabeling
Requirements:
| Resource | Minimum | Recommended |
|---|---|---|
| Python | 3.12+ | 3.12+ |
| Node.js | 22+ | 22+ |
| PostgreSQL | 16+ | 16+ |
| ffmpeg | Any | — |
| macOS | Apple Silicon 16GB | 24GB+ |
| NVIDIA GPU | 12GB VRAM | 16GB+ |
Setup:
git clone https://github.com/Somnusochi/VLM-AutoYOLO.git
cd VLM-AutoYOLO
# Backend
cd backend
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cd ..
# Frontend
cd frontend
pnpm install
cd ..
# Database (PostgreSQL recommended, but SQLite is supported out of the box)
# If using PostgreSQL:
# psql -d postgres -c "CREATE DATABASE autolabeling;"
# cp backend/.env.example backend/.env
# If you prefer a zero-setup SQLite database, just skip the two steps above. The system will auto-generate autolabeling.db
# Migrations
cd backend
PYTHONPATH=. alembic upgrade head
Pre-download models (optional):
huggingface-cli download nvidia/LocateAnything-3B --local-dir backend/model
python -c "from sam2.build_sam import build_sam2_hf; build_sam2_hf('facebook/sam2.1-hiera-base-plus', device='cpu')"
Launch:
./start.sh # macOS / Linux
start.bat # Windows
| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| Backend | http://localhost:8000 |
| API Docs | http://localhost:8000/docs |
Full directory tree: docs/STRUCTURE.md
Upload images or video keyframes with open-vocabulary descriptions (e.g. fire, smoke, red car). LocateAnything-3B automatically detects and draws bounding boxes.
Enable SAM2 (Segment Anything Model 2) to refine VLM bounding boxes into pixel-precise masks.
Switch to SAM3 mode for text-driven detection and segmentation in a single pass — no VLM required.
cat, red car) — SAM3 detects and segments all matching instancesbackend/sam3-venv/)HF_TOKEN — set this env var before starting the backend. Two steps:
~/.cache/huggingface/hub/ after first downloadstarting → loading → loaded)model_type (VLM / VLM+SAM2 / SAM3) for traceabilityUpload a video, extract keyframes, select and batch-annotate.
Canvas-based annotation with View / Draw modes.
.pt files.txt filesMODEL_IDLE_TIMEOUT_SECONDS of inactivityGET /api/v1/model/events streams VLM, SAM2, SAM3 status in one connectiongpu_memory.py) — CUDA expandable_segments / MPS synchronize+empty_cache+gcLoading to GPUIf the VLM model stays at Loading to GPU, the model files were already found and the failure is likely happening while PyTorch moves LocateAnything-3B onto CUDA/MPS. The UI now surfaces the backend error directly, so check the toast message or backend logs for the real cause, such as CUDA OOM, missing NVIDIA runtime, driver mismatch, or a dependency import error.
Useful Docker checks:
docker compose logs backend --tail=200
docker compose exec backend python - <<'PY'
import torch
print("cuda:", torch.cuda.is_available())
print("device:", torch.cuda.get_device_name(0) if torch.cuda.is_available() else None)
print("mem:", torch.cuda.mem_get_info() if torch.cuda.is_available() else None)
PY
nvidia-smi
Full API documentation with request/response examples: docs/API.md
| Platform | Inference | Training |
|---|---|---|
| macOS (Apple Silicon) | MPS | MPS |
| Linux / Windows (NVIDIA) | CUDA | CUDA |
Auto-detection: CUDA → MPS. Override via DEVICE env. CPU not supported.
Tested locally on an Apple MacBook Pro (M4 Pro, 24GB Unified Memory) using Apple MPS hardware acceleration.
| Image Resolution (Max Side) | Inference Latency | Actual Memory Footprint |
|---|---|---|
| Thumbnail (256px) | ~0.68s | Stable around ~11.8GB |
| High-Res (1024px) | ~4.35s | Stable around ~11.8GB |
Full detailed benchmarks across different hardware configurations: docs/BENCHMARKS.md
gpu_memory.py centralizes CUDA / MPS cleanup; expandable_segments:True# Frontend
cd frontend && pnpm install && pnpm run lint && pnpm run build
# Backend
cd backend && source .venv/bin/activate
PYTHONPATH=. alembic upgrade head
python -m compileall app alembic
Code: AGPL-3.0.
Third-party dependencies:
If this project helps you, please ⭐ star it on GitHub. I'm open to new opportunities — reach out: somnusochi@gmail.com
330 commits
1 commits
Python
52.2%
TypeScript
45.4%
CSS
1.1%