A vision-language annotation framework for prompt-driven object detection, segmentation, and human-in-the-loop labeling across images and video.
Overview · Architecture · Key Features · Quick Start · Usage · Documentation
AutoVision-Annotator combines traditional computer vision models with state-of-the-art Vision-Language Models (VLMs) to provide a flexible solution for object detection, segmentation, and annotation tasks. Objects are detected dynamically from natural language prompts, results are exported to Label Studio-compatible formats, and validated annotations feed back into model training, forming a complete annotation loop.
flowchart LR
subgraph IF["User Interfaces"]
FE["React Frontend<br/>(Vite)"]
GA["Gradio App<br/>tools/gradio_vlm.py"]
end
subgraph BE["FastAPI Backend"]
EP["REST Endpoints<br/>/api/vlm"]
PM["Pipeline Manager<br/>(singleton)"]
end
subgraph CORE["AutoVisionAnnotatorModels"]
direction TB
DP["Qwen Object Detection Pipeline<br/>VLM-only / Hybrid Parallel / Hybrid Sequential"]
VB["VLM Backends<br/>HuggingFace / vLLM / Ollama<br/>Qwen2.5-VL, BLIP-2, LLaVA, SmolVLM, GLM-4.5V"]
TD["Traditional Detectors<br/>YOLO / DETR / RT-DETR"]
SM["SAM Segmentation"]
FUS["Fusion and Matching<br/>WBF / NMS / IoU Overlap"]
VP["Video Pipeline"]
end
subgraph LOOP["Annotation Loop"]
EXP["Label Studio JSON Export"]
GCS[("Google Cloud Storage")]
HU["Human Review<br/>(Label Studio)"]
TRN["Model Fine-Tuning<br/>(HF Trainer)"]
end
FE -- "HTTP" --> EP
EP --> PM --> DP
GA --> DP
DP --> VB
DP --> TD
DP --> SAM
VB --> FUS
TD --> FUS
FUS --> DP
VP --> DP
DP --> EXP --> GCS --> HU
HU -- "validated data" --> TRN --> TD
| Component | Location | Description |
|---|---|---|
| React Frontend | frontend/ | Three-panel workspace: model controls, interactive image view, structured output |
| FastAPI Backend | backend/ | Production REST API wrapping VLM operations, with singleton pipeline management |
| VLM Backends | AutoVisionAnnotatorModels/VLM/ | Unified interface over HuggingFace Transformers, vLLM, Ollama, and OpenAI APIs |
| Detection Pipelines | AutoVisionAnnotatorModels/VLM/qwen_object_detection_pipeline3.py | VLM-only, hybrid parallel, and hybrid sequential detection modes |
| Traditional Detectors | AutoVisionAnnotatorModels/detectors/ | DETR, YOLO (HF), RT-DETR with unified inference, ensembling, evaluation, and video processing |
| Annotation Export | AutoVisionAnnotatorModels/export_to_label_studio.py | Label Studio-compatible JSON export and GCS integration |
| Tools | tools/ | Interactive Gradio application, vLLM test scripts, edge deployment utilities |
git clone https://github.com/rithwik-01/Automate-Annotation.git
cd Automate-Annotation
# Create an environment
conda create --name py312 python=3.12
conda activate py312
# CUDA-enabled PyTorch (adjust to your CUDA version)
conda install cuda -c nvidia/label/cuda-12.6
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
# Install the package (development mode)
pip install -e .
# Terminal 1 - backend (http://localhost:8000, docs at /docs)
cd backend && uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2 - frontend (http://localhost:5173)
cd frontend && npm install && npm run dev
Or launch the standalone Gradio interface:
python tools/gradio_vlm.py \
--checkpoint-path Qwen/Qwen2.5-VL-7B-Instruct \
--backend huggingface \
--server-port 7860
from AutoVisionAnnotatorModels.VLM.vlm_classifierv4 import HuggingFaceVLM
from PIL import Image
vlm = HuggingFaceVLM(
model_name="Qwen/Qwen2.5-VL-7B-Instruct",
device="cuda",
)
image = Image.open("path/to/image.jpg")
descriptions = vlm.generate(
images=[image],
prompts=["Describe this image in detail"],
)
print(descriptions[0])
Supported architectures include BLIP-2, LLaVA, Qwen2.5-VL (with Flash Attention 2), SmolVLM, and GLM-4.5V/4.1V, each runnable on HuggingFace, OpenAI-compatible APIs, Ollama, or vLLM backends.
The Qwen object detection pipeline supports three modes:
| Mode | Behavior |
|---|---|
| VLM-only | Structured prompts produce bounding boxes directly from the VLM |
| Hybrid (parallel) | VLM and traditional detectors run concurrently; results are fused with NMS or Weighted Boxes Fusion |
| Hybrid (sequential) | Traditional detectors propose boxes; the VLM validates and describes cropped regions |
from AutoVisionAnnotatorModels.VLM.qwen_object_detection_pipeline3 import QwenObjectDetectionPipeline
pipeline = QwenObjectDetectionPipeline(
model_name="Qwen/Qwen2.5-VL-7B-Instruct",
device="cuda",
enable_sam=True,
enable_traditional_detectors=True,
traditional_detectors=["yolo", "detr"],
vlm_backend="huggingface",
)
results = pipeline.detect_objects_hybrid(
image_path="path/to/image.jpg",
use_sam_segmentation=True,
sequential_mode=False,
save_results=True,
)
for obj in results["objects"]:
print(f"{obj['label']}: {obj['bbox']} - {obj['description']}")
print(results["visualization_path"])
print(results["json_path"])
import requests
BASE = "http://localhost:8000"
filename = requests.post(f"{BASE}/api/upload", files={"file": open("image.jpg", "rb")}).json()["filename"]
description = requests.post(
f"{BASE}/api/vlm/describe-image/{filename}",
json={"custom_prompt": "What is in this image?"},
).json()["description"]
results = requests.post(
f"{BASE}/api/vlm/detect-objects/{filename}",
json={"detection_method": "Hybrid Mode", "use_sam_segmentation": True},
).json()
Full endpoint reference: backend/VLM_API_REFERENCE.md.
from AutoVisionAnnotatorModels.detectors.videopipeline import VideoPipeline
video_pipeline = VideoPipeline(detector_name="yolov8x")
detections = video_pipeline.process_video(
video_path="path/to/video.mp4",
output_path="path/to/output.mp4",
)
from AutoVisionAnnotatorModels.export_to_label_studio import export_detections_to_label_studio
export_detections_to_label_studio(
detections=results,
image_path="path/to/image.jpg",
output_path="label_studio_annotations.json",
)
Validated annotations can be stored in Google Cloud Storage (utils/labelstudiogcp.py) and used to fine-tune detectors (multimodels_train.py), closing the annotation loop:
evaluation.py) and KITTI benchmarks (test_rtdetrv2_kitti.py)AutoVision-Annotator powers a real-time urban monitoring system that detects city issues from camera streams:
Automate-Annotation/
├── backend/ # FastAPI REST API
│ ├── src/api/ # Endpoint routers (VLM, uploads, health, ...)
│ ├── src/pipeline.py # Singleton pipeline management
│ └── Dockerfile
├── frontend/ # React (Vite) user interface
│ └── src/components/ # Workspace, canvas, model controls, output panel
├── AutoVisionAnnotatorModels/
│ ├── VLM/ # VLM backends and detection pipelines
│ ├── detectors/ # YOLO/DETR/RT-DETR, video pipeline, evaluation
│ ├── configs/ # Class lists and two-step pipeline configs
│ └── utils/ # GCS, Label Studio, geometry helpers
├── tools/ # Gradio app, vLLM tests, edge deployment tooling
├── docs/ # MkDocs documentation and figures
└── static/ # Uploaded media storage
| Document | Description |
|---|---|
| Getting Started | Environment and installation guide |
| API Reference | Backend endpoint documentation |
| VLM API Reference | Detailed VLM endpoint reference |
| vLLM Qwen2.5-VL Tutorial | Serving Qwen2.5-VL with vLLM |
| Edge AI Tool | On-device deployment utility |
vLLM provides high-throughput inference for VLMs.
Prerequisites: CUDA 11.8+/12.1+, compatible GPU (RTX 3090 or better recommended), Python 3.8-3.11.
pip install vllm
GPU memory guidelines:
| Model size | VRAM |
|---|---|
| 7B | 16 GB+ |
| 13B | 24 GB+ |
| 70B | 80 GB+ (multi-GPU) |
Troubleshooting: reduce max_model_len on out-of-memory errors, match CUDA toolkit to the PyTorch build on import errors, and enable GPU P2P for multi-GPU setups.
curl -fsSL https://ollama.com/install.sh | sh
ollama pull gpt-oss:20b
ollama run gpt-oss:20b
Ollama exposes a Chat Completions-compatible API, so it works through the OpenAI SDK and is available to all pipelines via the OllamaVLM backend.
gcloud init
gcloud auth login
gcloud config set project <project_id>
gcloud auth application-default login
gsutil ls gs://roadsafetytarget/
Media and exported annotations are managed through GCS buckets (utils/download_videos_from_gcs.py, utils/labelstudiogcp.py). For deployment, containerize the backend with backend/Dockerfile and host the frontend on Vercel or Netlify.
| Warning | Resolution |
|---|---|
| TensorFlow/CUDA informational messages | Harmless; suppress with export TF_CPP_MIN_LOG_LEVEL=2 |
WARNING: Ollama utilities could not be imported | Install Ollama if you need local LLM backends |
WARNING: vLLM package is not available | Install vLLM (see Advanced Setup) for faster inference |
This project is released under the MIT License.
47 commits
Python
94.2%
Shell
2.5%
JavaScript
2.3%
A vision-language annotation framework for prompt-driven object detection, segmentation, and human-in-the-loop labeling across images and video.
Overview · Architecture · Key Features · Quick Start · Usage · Documentation
AutoVision-Annotator combines traditional computer vision models with state-of-the-art Vision-Language Models (VLMs) to provide a flexible solution for object detection, segmentation, and annotation tasks. Objects are detected dynamically from natural language prompts, results are exported to Label Studio-compatible formats, and validated annotations feed back into model training, forming a complete annotation loop.
flowchart LR
subgraph IF["User Interfaces"]
FE["React Frontend<br/>(Vite)"]
GA["Gradio App<br/>tools/gradio_vlm.py"]
end
subgraph BE["FastAPI Backend"]
EP["REST Endpoints<br/>/api/vlm"]
PM["Pipeline Manager<br/>(singleton)"]
end
subgraph CORE["AutoVisionAnnotatorModels"]
direction TB
DP["Qwen Object Detection Pipeline<br/>VLM-only / Hybrid Parallel / Hybrid Sequential"]
VB["VLM Backends<br/>HuggingFace / vLLM / Ollama<br/>Qwen2.5-VL, BLIP-2, LLaVA, SmolVLM, GLM-4.5V"]
TD["Traditional Detectors<br/>YOLO / DETR / RT-DETR"]
SM["SAM Segmentation"]
FUS["Fusion and Matching<br/>WBF / NMS / IoU Overlap"]
VP["Video Pipeline"]
end
subgraph LOOP["Annotation Loop"]
EXP["Label Studio JSON Export"]
GCS[("Google Cloud Storage")]
HU["Human Review<br/>(Label Studio)"]
TRN["Model Fine-Tuning<br/>(HF Trainer)"]
end
FE -- "HTTP" --> EP
EP --> PM --> DP
GA --> DP
DP --> VB
DP --> TD
DP --> SAM
VB --> FUS
TD --> FUS
FUS --> DP
VP --> DP
DP --> EXP --> GCS --> HU
HU -- "validated data" --> TRN --> TD
| Component | Location | Description |
|---|---|---|
| React Frontend | frontend/ | Three-panel workspace: model controls, interactive image view, structured output |
| FastAPI Backend | backend/ | Production REST API wrapping VLM operations, with singleton pipeline management |
| VLM Backends | AutoVisionAnnotatorModels/VLM/ | Unified interface over HuggingFace Transformers, vLLM, Ollama, and OpenAI APIs |
| Detection Pipelines | AutoVisionAnnotatorModels/VLM/qwen_object_detection_pipeline3.py | VLM-only, hybrid parallel, and hybrid sequential detection modes |
| Traditional Detectors | AutoVisionAnnotatorModels/detectors/ | DETR, YOLO (HF), RT-DETR with unified inference, ensembling, evaluation, and video processing |
| Annotation Export | AutoVisionAnnotatorModels/export_to_label_studio.py | Label Studio-compatible JSON export and GCS integration |
| Tools | tools/ | Interactive Gradio application, vLLM test scripts, edge deployment utilities |
git clone https://github.com/rithwik-01/Automate-Annotation.git
cd Automate-Annotation
# Create an environment
conda create --name py312 python=3.12
conda activate py312
# CUDA-enabled PyTorch (adjust to your CUDA version)
conda install cuda -c nvidia/label/cuda-12.6
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
# Install the package (development mode)
pip install -e .
# Terminal 1 - backend (http://localhost:8000, docs at /docs)
cd backend && uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2 - frontend (http://localhost:5173)
cd frontend && npm install && npm run dev
Or launch the standalone Gradio interface:
python tools/gradio_vlm.py \
--checkpoint-path Qwen/Qwen2.5-VL-7B-Instruct \
--backend huggingface \
--server-port 7860
from AutoVisionAnnotatorModels.VLM.vlm_classifierv4 import HuggingFaceVLM
from PIL import Image
vlm = HuggingFaceVLM(
model_name="Qwen/Qwen2.5-VL-7B-Instruct",
device="cuda",
)
image = Image.open("path/to/image.jpg")
descriptions = vlm.generate(
images=[image],
prompts=["Describe this image in detail"],
)
print(descriptions[0])
Supported architectures include BLIP-2, LLaVA, Qwen2.5-VL (with Flash Attention 2), SmolVLM, and GLM-4.5V/4.1V, each runnable on HuggingFace, OpenAI-compatible APIs, Ollama, or vLLM backends.
The Qwen object detection pipeline supports three modes:
| Mode | Behavior |
|---|---|
| VLM-only | Structured prompts produce bounding boxes directly from the VLM |
| Hybrid (parallel) | VLM and traditional detectors run concurrently; results are fused with NMS or Weighted Boxes Fusion |
| Hybrid (sequential) | Traditional detectors propose boxes; the VLM validates and describes cropped regions |
from AutoVisionAnnotatorModels.VLM.qwen_object_detection_pipeline3 import QwenObjectDetectionPipeline
pipeline = QwenObjectDetectionPipeline(
model_name="Qwen/Qwen2.5-VL-7B-Instruct",
device="cuda",
enable_sam=True,
enable_traditional_detectors=True,
traditional_detectors=["yolo", "detr"],
vlm_backend="huggingface",
)
results = pipeline.detect_objects_hybrid(
image_path="path/to/image.jpg",
use_sam_segmentation=True,
sequential_mode=False,
save_results=True,
)
for obj in results["objects"]:
print(f"{obj['label']}: {obj['bbox']} - {obj['description']}")
print(results["visualization_path"])
print(results["json_path"])
import requests
BASE = "http://localhost:8000"
filename = requests.post(f"{BASE}/api/upload", files={"file": open("image.jpg", "rb")}).json()["filename"]
description = requests.post(
f"{BASE}/api/vlm/describe-image/{filename}",
json={"custom_prompt": "What is in this image?"},
).json()["description"]
results = requests.post(
f"{BASE}/api/vlm/detect-objects/{filename}",
json={"detection_method": "Hybrid Mode", "use_sam_segmentation": True},
).json()
Full endpoint reference: backend/VLM_API_REFERENCE.md.
from AutoVisionAnnotatorModels.detectors.videopipeline import VideoPipeline
video_pipeline = VideoPipeline(detector_name="yolov8x")
detections = video_pipeline.process_video(
video_path="path/to/video.mp4",
output_path="path/to/output.mp4",
)
from AutoVisionAnnotatorModels.export_to_label_studio import export_detections_to_label_studio
export_detections_to_label_studio(
detections=results,
image_path="path/to/image.jpg",
output_path="label_studio_annotations.json",
)
Validated annotations can be stored in Google Cloud Storage (utils/labelstudiogcp.py) and used to fine-tune detectors (multimodels_train.py), closing the annotation loop:
evaluation.py) and KITTI benchmarks (test_rtdetrv2_kitti.py)AutoVision-Annotator powers a real-time urban monitoring system that detects city issues from camera streams:
Automate-Annotation/
├── backend/ # FastAPI REST API
│ ├── src/api/ # Endpoint routers (VLM, uploads, health, ...)
│ ├── src/pipeline.py # Singleton pipeline management
│ └── Dockerfile
├── frontend/ # React (Vite) user interface
│ └── src/components/ # Workspace, canvas, model controls, output panel
├── AutoVisionAnnotatorModels/
│ ├── VLM/ # VLM backends and detection pipelines
│ ├── detectors/ # YOLO/DETR/RT-DETR, video pipeline, evaluation
│ ├── configs/ # Class lists and two-step pipeline configs
│ └── utils/ # GCS, Label Studio, geometry helpers
├── tools/ # Gradio app, vLLM tests, edge deployment tooling
├── docs/ # MkDocs documentation and figures
└── static/ # Uploaded media storage
| Document | Description |
|---|---|
| Getting Started | Environment and installation guide |
| API Reference | Backend endpoint documentation |
| VLM API Reference | Detailed VLM endpoint reference |
| vLLM Qwen2.5-VL Tutorial | Serving Qwen2.5-VL with vLLM |
| Edge AI Tool | On-device deployment utility |
vLLM provides high-throughput inference for VLMs.
Prerequisites: CUDA 11.8+/12.1+, compatible GPU (RTX 3090 or better recommended), Python 3.8-3.11.
pip install vllm
GPU memory guidelines:
| Model size | VRAM |
|---|---|
| 7B | 16 GB+ |
| 13B | 24 GB+ |
| 70B | 80 GB+ (multi-GPU) |
Troubleshooting: reduce max_model_len on out-of-memory errors, match CUDA toolkit to the PyTorch build on import errors, and enable GPU P2P for multi-GPU setups.
curl -fsSL https://ollama.com/install.sh | sh
ollama pull gpt-oss:20b
ollama run gpt-oss:20b
Ollama exposes a Chat Completions-compatible API, so it works through the OpenAI SDK and is available to all pipelines via the OllamaVLM backend.
gcloud init
gcloud auth login
gcloud config set project <project_id>
gcloud auth application-default login
gsutil ls gs://roadsafetytarget/
Media and exported annotations are managed through GCS buckets (utils/download_videos_from_gcs.py, utils/labelstudiogcp.py). For deployment, containerize the backend with backend/Dockerfile and host the frontend on Vercel or Netlify.
| Warning | Resolution |
|---|---|
| TensorFlow/CUDA informational messages | Harmless; suppress with export TF_CPP_MIN_LOG_LEVEL=2 |
WARNING: Ollama utilities could not be imported | Install Ollama if you need local LLM backends |
WARNING: vLLM package is not available | Install vLLM (see Advanced Setup) for faster inference |
This project is released under the MIT License.
47 commits
Python
94.2%
Shell
2.5%
JavaScript
2.3%