🌐 Part of the Annotation Garden Initiative
A VLM-based image annotation system adapted for the Annotation Garden ecosystem. This tool provides collaborative annotation capabilities for static image datasets, starting with the Natural Scene Dataset (NSD).
The Annotation Garden Initiative (AGI) establishes an open infrastructure for collaborative, multi-layered annotation of stimuli used in neuroscience research. This tool serves as the primary interface for annotating static image datasets in the AGI ecosystem.
- Multi-model support: OLLAMA, OpenAI GPT-4V, Anthropic Claude
- Batch processing: Handle 25k+ annotations with real-time progress
- Web dashboard: Interactive visualization with AGI branding
- HED integration: Hierarchical Event Descriptors for semantic annotations
- BIDS-compliant: Output follows stimuli-BIDS specifications
- Annotation tools: Reorder, filter, export, and manipulate annotations
- Research-ready: Structured JSON output with comprehensive metrics
- Python 3.11+
- Node.js 18+
- OLLAMA (for local models)
- API keys for OpenAI/Anthropic (optional)
# Clone from Annotation Garden
git clone https://github.com/Annotation-Garden/image-annotation.git
cd image-annotation
# Python environment
conda activate torch-312 # or create: conda create -n torch-312 python=3.12
pip install -e .
# Frontend
cd frontend && npm install# Start OLLAMA (for local models)
ollama serve
# Test VLM service
python -m image_annotation.services.vlm_service
# Run frontend dashboard (with AGI branding)
cd frontend && npm run dev
# Visit http://localhost:3000
# Configuration
cp config/config.example.json config/config.json
# Edit config.json with API keys and image paths- AGI logo positioned top-left in all interfaces
- AGI color theme throughout dashboard
- Consistent with annotation.garden website design
This tool includes enhanced support for Hierarchical Event Descriptors (HED):
- HED tag suggestions during annotation
- HED validation for annotations
- Export annotations with HED tags
Annotations follow stimuli-BIDS specifications:
- Standardized events.tsv format
- JSON sidecars with annotation schema
- Compatible with neuroimaging datasets
- Backend: FastAPI with OLLAMA/OpenAI/Anthropic integration
- Frontend: Next.js dashboard with AGI branding
- Storage: JSON files with database support for large datasets
- Processing: Stateless VLM calls with comprehensive metrics
All performance metrics in this repository were generated using an NVIDIA GeForce RTX 4090 GPU with OLLAMA for local model inference. See Quality Control for details.
Powerful CLI tools for post-processing annotations:
from image_annotation.utils import reorder_annotations, remove_model, export_to_csv
# Reorder model annotations
reorder_annotations("annotations/", ["best_model", "second_best"])
# Remove underperforming models
remove_model("annotations/", "poor_model")
# Export for analysis
export_to_csv("annotations/", "results.csv", include_metrics=True)from image_annotation.services.vlm_service import VLMService, VLMPrompt
# Initialize and process
service = VLMService(model="gemma3:4b")
results = service.process_batch(
image_paths=["path/to/image.jpg"],
prompts=[VLMPrompt(id="describe", text="Describe this image")],
models=["gemma3:4b", "llava:latest"]
)
# Results include comprehensive metrics
for result in results:
print(f"Tokens: {result.token_metrics.total_tokens}")
print(f"Speed: {result.performance_metrics.tokens_per_second}/sec")# Test with real data (no mocks)
pytest tests/ --cov
# Format code
ruff check --fix . && ruff format .- Download NSD images to
/path/to/NSD_stimuli/shared1000/ - Configure models in
config/config.json - Process in batches using
VLMService.process_batch() - Post-process with annotation tools
- Export results to CSV for analysis
See CONTRIBUTING.md for detailed research workflows.
See CONTRIBUTING.md in the management repository for AGI contribution guidelines.
- Management: Organizational documentation
- Assets: AGI branding and design guidelines
- Website: Main AGI website
This project is licensed under CC-BY-NC-SA 4.0 - see the LICENSE file for details.
- Natural Scene Dataset (NSD) team
- Annotation Garden Initiative community
- LangChain and OLLAMA communities
- Original tool by neuromechanist