SAM2 + CoTracker3 • PyQt5 Midnight Slate Studio

Turn raw video into YOLO-ready datasets in a handful of clicks

AutoSegmentor pairs Meta AI's Segment Anything Model 2 (SAM2) with CoTracker3 inside a fast desktop studio โ€” propagate pixel-accurate masks and pose skeletons across long footage, fix drift interactively, and export detection, instance segmentation, and pose datasets in one keystroke.

$ python run_main.py --demo cat
SAM2 + CoTracker3
Mask propagation & learned keypoint tracking
3-in-1 Export
BBox, Segmentation & Pose in one keystroke
Batch VRAM Safe
Long videos on consumer GPUs (6โ€“24 GB)
Win 11 & Ubuntu
One-shot cross-platform installer & PyPI

Real Unedited Demo Sessions

Watch full-resolution 1080p runs directly in your browser. Click any chapter pill to jump straight to that step.

python run_main.py --demo cat
1080p • 51s • Full Pipeline

Full v3 workflow: 5 foreground + 2 background clicks on frame 1 propagate both a SAM2 segmentation mask and a 5-point CoTracker3 pose skeleton across batches, ending with simultaneous YOLO detection, segmentation, and pose export.

Want to test on your own footage? Drop any video in workspace/VideoInputs/ and run python run_main.py, or register a custom named demo.
Custom Demo Guide โ†—

From Raw Footage to Training Set in 4 Steps

01

Prompt Frame 0

Place foreground (Ctrl+LClick) and background (Ctrl+RClick) clicks. Route each point to SAM2, CoTracker3, or both.

02

Propagate Batches

Press Enter to run SAM2 masks and CoTracker3 keypoints off the UI thread with live per-stage checklists and rolling ETA.

03

Scrub & Correct Drift

Hold A/D to scrub smoothly. Drag any drifted keypoint (Shift+LClick) and toggle occlusion visibility.

04

Export 3-in-1 YOLO

Press Ctrl+E to build train/valid/test + data.yaml for detection, segmentation, and pose simultaneously.

๐ŸŽฏ

Scalable Model Routing

Control per click whether annotations feed SAM2, CoTracker3, or both โ€” plus one-off mask-only clicks (Ctrl+Shift+Click) and Auto-Shift Instance mode.

โšก

Async GPU Engine

500ms debounced PreviewThread and multi-stage BatchProcessorThread keep the PyQt5 canvas silky smooth during heavy GPU inference.

๐Ÿฆด

Occlusion-Aware Pose

CoTracker3 outputs per-keypoint visibility flags natively; occluded joints remain draggable on canvas with manual visibility overrides in the sidebar.

๐Ÿงฉ

Dockable Studio Layout

Float, snap, or collapse the Annotation, Processing, and Log docks across monitors โ€” layout persists automatically between runs.

๐Ÿ“ฆ

YOLO 3-in-1 Dataset Manager

Auto-balancing train/val/test splits, Albumentations augmentations, and multithreaded polygon + bbox + keypoint export ready for Ultralytics.

๐Ÿงช

Offline Synthetic Engine

Multiply small verified datasets via copy-paste compositing, histogram lighting matching, synchronized transforms, and visibility-aware synthetic occlusions.

Redesigned Midnight Slate PyQt5 Interface

Every control is engineered for high-speed human-in-the-loop labeling: complementary high-contrast point colors on top of masks, live opacity slider, and an integrated corner magnifier.

Full UI Guide โ†—
AutoSegmentor PyQt5 Annotation Studio showing Processing dock, SAM2 mask with CoTracker3 pose skeleton, corner zoom magnifier, Annotation dock, and Log panel
Left Dock

Live Processing Plan & ETA

Shows exact stages running for the current batch (Copy, SAM2, CoTracker3, Save) with per-frame progress and rolling ETA.

Center Canvas

Precision Zoom & Magnifier

Hardware-smooth pan/zoom, live corner magnifier (Z), crosshair (C), grid (G), and auto-contrasted keypoint colors.

Right Dock

Annotations, Routing & Live Config

Track keypoint completion, override occlusion visibility, route models, adjust Mask α opacity (0โ€“100%) and point size live.

Launchpad

3-Page Setup Dialog

Sidebar navigation across Videos, Models, and Settings with persistent YAML defaults and instant session resume.

Studio Keyboard & Mouse Shortcuts

Press H inside AutoSegmentor anytime for the built-in cheatsheet.

Quickstart

Tested on Windows 11 and Ubuntu 22.04 / 24.04 with NVIDIA CUDA GPUs.

Includes bundled Cat & Road demos, Dataset Manager, and Synthetic Engine
git clone --recursive https://github.com/thippeswammy/AutoSegmentor.git
cd AutoSegmentor
python -m venv .venv && source .venv/bin/activate   # Windows: .\.venv\Scripts\Activate.ps1
python install.py
python run_main.py --demo cat