Metadata-Version: 2.4
Name: autosegmentor
Version: 3.0.1
Summary: Auto-labeling ecosystem converting raw video into YOLO-ready datasets using SAM2 + CoTracker3.
Author-email: Thippeswamy <thippeswamy636408@gmai.com>
License: MIT
Project-URL: Homepage, https://github.com/thippeswammy/AutoSegmentor
Project-URL: Repository, https://github.com/thippeswammy/AutoSegmentor
Project-URL: Issues, https://github.com/thippeswammy/AutoSegmentor/issues
Keywords: computer-vision,sam2,cotracker,yolo,segmentation,pose,auto-labeling
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24
Requires-Dist: opencv-python>=4.8
Requires-Dist: opencv-python-headless>=4.8
Requires-Dist: PyYAML>=6.0
Requires-Dist: torch>=2.0
Requires-Dist: torchvision>=0.15
Requires-Dist: PyQt5>=5.15
Requires-Dist: ultralytics>=8.0
Requires-Dist: albumentations>=1.3
Requires-Dist: Pillow>=10.0
Requires-Dist: scipy>=1.10
Requires-Dist: matplotlib>=3.7
Requires-Dist: GPUtil>=1.4
Requires-Dist: google-genai>=1.0
Requires-Dist: google-generativeai>=0.8
Requires-Dist: onnx>=1.16
Requires-Dist: onnxruntime-gpu>=1.18
Requires-Dist: hydra-core>=1.1
Requires-Dist: omegaconf>=2.1
Requires-Dist: platformdirs>=4.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-qt>=4.2; extra == "dev"
Requires-Dist: pyinstaller>=6.0; extra == "dev"
Provides-Extra: cuda
Requires-Dist: flash-attn>=2.0; extra == "cuda"
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.0; extra == "docs"

# AutoSegmentor

[![GitHub](https://img.shields.io/github/stars/thippeswammy/AutoSegmentor?style=social)](https://github.com/thippeswammy/AutoSegmentor)
[![PyPI](https://img.shields.io/pypi/v/autosegmentor)](https://pypi.org/project/autosegmentor/)
[![Docs](https://img.shields.io/badge/docs-site-blue)](https://thippeswammy.github.io/AutoSegmentor/)
[![Demo Video](https://img.shields.io/badge/Demo-Video-blue)](https://drive.google.com/file/d/1Y19lwf_IIuzwVe-3j9vX0uicV_iWbrHZ/view?usp=sharing)

<video controls preload="metadata" width="720" poster="https://raw.githubusercontent.com/thippeswammy/AutoSegmentor/master/assets/cat_poster.jpg">
  <source src="https://media.githubusercontent.com/media/thippeswammy/AutoSegmentor/master/assets/AutoSegmenterCat.mp4" type="video/mp4">
</video>

_AutoSegmentor is a state-of-the-art auto-labeling ecosystem that bridges the gap between raw video footage and structured AI datasets. By integrating Meta AI's **Segment Anything Model 2 (SAM2)** with high-precision tracking like **CoTracker3**, it enables users to generate pixel-perfect masks and pose estimation data for long, complex videos with minimal manual interaction._

**📖 [Full documentation, demos, and architecture guide →](https://thippeswammy.github.io/AutoSegmentor/)**

---

## ✨ Features

- **Professional Desktop UI**: A fully-featured PyQt5 application with multi-window support, integrated property panels, and real-time visualization.
- **Interactive Annotation**: Point and box-based multi-class annotation with a high-fidelity zoom system for precision.
- **Advanced Tracking (CoTracker3)**: Robust keypoint tracking across frames — an alternative to Optical Flow for complex scenes.
- **Real-time Mask Propagation**: Propagate annotations across batches of frames using SAM2's temporal memory.
- **Async Processing Engine**: Background execution of GPU tasks keeps the UI responsive during heavy inference.
- **YOLO Dataset Creation**: One export covers **object detection (bbox)**, **instance segmentation**, and **pose estimation** simultaneously, with integrated augmentation.

## 🚀 Quickstart

Tested on **Windows 11** and **Ubuntu 22.04/24.04**. Full walkthrough (prerequisites,
manual install path, troubleshooting):
**[Installation guide →](https://thippeswammy.github.io/AutoSegmentor/installation/)**

```bash
git clone --recursive https://github.com/thippeswammy/AutoSegmentor.git
cd AutoSegmentor
python -m venv .venv && source .venv/bin/activate   # or .venv\Scripts\Activate.ps1 on Windows
python install.py
python run_main.py --demo cat
```

`install.py` is a single cross-platform script that installs dependencies, initializes
submodules, downloads the SAM2 + CoTracker3 checkpoints, and runs a GPU diagnostic — see
`python install.py --help` for flags to skip or isolate individual steps.

Just want the annotation engine — SAM2 masks **and** CoTracker3 pose tracking — without
cloning the repo? `pip install autosegmentor` pulls both straight from PyPI. Demos and the
Dataset Manager / Synthetic Engine tooling are still git-clone-only for now — planned for a
future release.

## 🎬 Demos

```bash
python run_main.py --demo list           # cat, road
python run_main.py --demo cat
python run_main.py --demo road
```

See **[Demos →](https://thippeswammy.github.io/AutoSegmentor/demos/)** for what each bundled
demo shows. The `road` demo (SAM2 segmentation only, no pose tracking):

<video controls preload="metadata" width="720" poster="https://raw.githubusercontent.com/thippeswammy/AutoSegmentor/master/assets/road_poster.jpg">
  <source src="https://media.githubusercontent.com/media/thippeswammy/AutoSegmentor/master/assets/AutoSegmenterRoad.mp4" type="video/mp4">
</video>

**Using your own video?** Drop it in `workspace/VideoInputs/` and just run
`python run_main.py` (no `--demo`) — a Setup Dialog opens where you pick the video and
configure SAM2/CoTracker3, run mode, and pose classes, then the same annotation workflow
as the demos takes over. See the
**[Installation guide →](https://thippeswammy.github.io/AutoSegmentor/installation/#running-on-your-own-video-not-a-demo)**
for details.

## ⌨️ Annotation Controls

| Action | Control |
| :--- | :--- |
| **Foreground Point** | Left Click |
| **Background Point** | Right Click |
| **Undo / Redo** | `Ctrl + Z` / `Ctrl + Y` |
| **Navigate Frames** | `A` / `D` or `Left` / `Right` |
| **Turbo Scroll** | `Shift + A` / `Shift + D` |
| **Batch Navigation** | `[` / `]` |
| **Change Class (1-10)** | Keys `1` to `0` |
| **Instance Management** | `Tab` (Next) / `Shift + Tab` (Prev) |
| **Toggle Mask Overlay** | `M` |
| **Process Batch** | `Enter` / `Return` |
| **Save Progress** | `Ctrl + S` |
| **Export Dataset** | `Ctrl + E` |

## 🏗️ Architecture

A PyQt5 annotation UI drives a background engine wrapping SAM2 (mask propagation) and
CoTracker3 (keypoint tracking), with a separate downstream toolchain (`DatasetManager/`)
turning verified annotations into YOLO-format training data. For the full call flow,
diagram, and package breakdown, see the
**[Architecture guide →](https://thippeswammy.github.io/AutoSegmentor/architecture/)**.

```text
AutoSegmentor/
├── run_main.py                # Main entry point
├── install.py                 # One-shot setup (deps, submodules, checkpoints, GPU check)
├── autosegmentor/              # Core application package (core, ui, models, file_management, tools)
├── DatasetManager/              # Dataset export & synthesis — see the Dataset Manager guide
├── workspace/                  # Project workspace (videos in, datasets/logs out)
├── external/                   # Vendored SAM2 + CoTracker3
├── demo/                        # Bundled demo footage + session configs
└── docs/                        # Source for the documentation site
```

## Acknowledgements

- [Meta AI's SAM2](https://github.com/facebookresearch/segment-anything-2)
- [CoTracker Team](https://github.com/facebookresearch/co-tracker)
- All open-source contributors to the PyTorch and PyQt ecosystems.

---

**Built with ❤️ for the Computer Vision community.**
