Skip to content

Installation and Setup

github-actions[bot] edited this page Nov 30, 2026 · 2 revisions

Installation and Setup

Tested on Windows 11 and Ubuntu 22.04 / 24.04.

Prerequisites

Requirement Recommended Specification
Python 3.10 – 3.12
GPU NVIDIA GPU with CUDA 12.x (CPU-only inference works, but is far too slow for real video)
RAM 16 GB+
Disk Space ~20 GB (model checkpoints + extracted working frames)
Git LFS git-lfs.com — only needed if pulling or contributing bundled .mp4 videos

Option 1 — Full Repository Setup (Recommended)

Use the full repository checkout if you want the bundled cat / road demos, the YOLO Dataset Manager, the offline Synthetic Engine, or plan to modify code.

1. Clone with submodules

Cloning with --recursive pulls the vendored co-tracker git submodule (SAM2 is tracked directly in external/segment_anything_2/):

git clone --recursive https://github.com/thippeswammy/AutoSegmentor.git
cd AutoSegmentor

If you cloned without --recursive, initialize the submodule afterward:

git submodule update --init --recursive

2. Create and activate a virtual environment

Windows (PowerShell):

python -m venv .venv
.\.venv\Scripts\Activate.ps1

Ubuntu / Linux:

python3 -m venv .venv
source .venv/bin/activate

3. Run the one-shot installer

python install.py

install.py performs the complete cross-platform setup:

  1. Checks your Python version.
  2. Initializes git submodules (external/co-tracker).
  3. Installs dependencies from requirements-core.txt.
  4. Downloads the SAM2 (sam2_hiera_large.pt) and CoTracker3 (scaled_offline.pth) checkpoints.
  5. Runs a GPU / CUDA diagnostic so you know immediately whether GPU inference is active.

Optional step-specific flags:

python install.py --cuda                        # also install optional flash-attn speedup
python install.py --checkpoints-only            # download missing model checkpoints only
python install.py --checkpoints-only --check    # verify checkpoints without downloading
python install.py --gpu-check-only              # run GPU / CUDA system check only

4. Verify your installation

python run_main.py --version     # AutoSegmentor 3.0.1
python run_main.py --demo list   # cat, road

Option 2 — Quick Install from PyPI

If you only need the core annotation engine (SAM2 mask generation + CoTracker3 pose tracking) without cloning the repo:

pip install autosegmentor

Both sam2 and cotracker are bundled inside the PyPI package. Model checkpoints are downloaded into a platform-appropriate user cache directory (via platformdirs) when running:

python install.py --checkpoints-only
autosegmentor

Running on Your Own Video (Not a Demo)

  1. Drop your video(s) into workspace/VideoInputs/ (e.g. Video1.mp4).
  2. Launch without --demo:
python run_main.py
  1. The Setup Launchpad (SetupDialog) opens so you can configure video template/range, SAM2 & CoTracker3 settings, batch size, FPS, and custom pose keypoints.
  2. Click ▶ Launch Pipeline to open the Annotation Studio.

Tip: Setup Launchpad reads and writes workspace/inputs/config/default_config.yaml and workspace/inputs/config/session_state.json, which you can also edit directly for repeatable scripting.


Manual Setup (Without install.py)

python -m pip install --upgrade pip
pip install -r requirements-core.txt

Download the checkpoints manually:

Model File Upstream Repo
SAM2 sam2_hiera_large.pt facebookresearch/segment-anything-2
CoTracker3 scaled_offline.pth facebookresearch/co-tracker

Place them at:

external/segment_anything_2/checkpoints/sam2_hiera_large.pt
external/co-tracker/checkpoints/scaled_offline.pth

Optionally install in editable mode to register the autosegmentor and autosegmentor-demo CLI commands:

pip install -e .

Hit an error during setup? See Troubleshooting & FAQ.