Skip to main content

Semi-automatic image annotation tool with AI-assisted object detection

Project description

Anno-Mage: A Semi Automatic Image Annotation Tool

PyPI version PyPI - Python Version Publish to PyPI License

Demo

Semi-automatic image annotation toolbox powered by PyTorch object detection models. Available as both a desktop app (Tkinter) and a web app (FastAPI + React).

Interfaces

Desktop App

A Tkinter GUI that runs locally. Annotate images from a directory with keyboard navigation and a precision zoom panel.

Web App

A browser-based interface with a modern dark/light UI, REST API, and dataset directory browsing. See web/README.md for full documentation.


Desktop App

Dependencies

  • Python 3.12
  • PyTorch + Torchvision (for RetinaNet inference)
  • Pillow, pascal-voc-writer

Custom snapshots from legacy Keras (.h5) or TensorFlow (frozen_inference_graph.pb) models can be placed in snapshots/keras/ and snapshots/tensorflow/ respectively and will be listed in the model menu.

Installation

  1. Clone this repository.

  2. Create and activate a virtual environment:

    python -m venv my_venv
    source my_venv/bin/activate  # On Windows: my_venv\Scripts\activate
    
  3. Install dependencies:

    pip install torch torchvision pillow pascal-voc-writer
    
  4. Run the app:

    python main.py
    

The default model (RetinaNet ResNet50 FPN V2) downloads its weights automatically from the PyTorch model hub on first run.

Usage

  1. Click Open Dir to select a folder of images, or Open for a single image.
  2. Use Add All Classes to load all 80 COCO labels, or pick individual ones from the dropdown.
  3. Select Auto suggestion mode and click Detect to run object detection.
  4. To annotate manually, select a class from the list, then drag a bounding box on the canvas.
  5. Use ← → arrow keys to move between images. Annotations save automatically on navigation.
  6. Final annotations are written to:
    • annotations/annotations.csv
    • annotations/annotations_voc/<image>.xml (Pascal VOC)

To annotate a custom (non-COCO) dataset, update the label map in config.py before running.

Tested on

  • Windows 10
  • Ubuntu 16.04
  • macOS High Sierra

Web App

See web/README.md for installation, usage, and API reference.

Quick start:

# Backend (port 8000)
cd web/backend && python main.py

# Frontend (port 3000)
cd web/frontend && npm install && npm run dev

Or use the convenience script:

cd web && bash start.sh

PyPI Distribution

Install from PyPI

pip install anno-mage
anno-mage

The app opens in your browser automatically. Annotations are saved to ~/.anno-mage/annotations/.

Publish a Release

Releases publish automatically to PyPI when a version tag is pushed. GitHub Actions builds the frontend, packages everything, and publishes via PyPI Trusted Publishers (no tokens required).

One-time PyPI setup:

  1. Go to your PyPI project → ManagePublishingAdd a new publisher
  2. Set: GitHub repo virajmavani/semi-auto-image-annotation-tool, workflow release.yml, environment pypi

To release:

git tag v2.0.1
git push origin v2.0.1

That's it — the workflow in .github/workflows/release.yml handles the rest.

Build Locally

To build the package without publishing:

Prerequisites:

pip install build
npm install  # inside web/frontend if not already done
bash build_release.sh

This compiles the React frontend, copies the build into anno_mage/static/, and produces wheel and sdist artifacts in dist/.


Output Formats

Both interfaces produce identical output:

Format Location Description
CSV annotations/annotations.csv image_path,x1,y1,x2,y2,label per row
Pascal VOC XML annotations/annotations_voc/ One XML file per image

Acknowledgments

Join the developers channel

Slack: https://join.slack.com/t/annomage/shared_invite/zt-dh4ca9du-4VOcwUMCSNA6lmyG~tNUPg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anno_mage-2.0.2.tar.gz (183.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anno_mage-2.0.2-py3-none-any.whl (182.1 kB view details)

Uploaded Python 3

File details

Details for the file anno_mage-2.0.2.tar.gz.

File metadata

  • Download URL: anno_mage-2.0.2.tar.gz
  • Upload date:
  • Size: 183.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anno_mage-2.0.2.tar.gz
Algorithm Hash digest
SHA256 4562af0137e101b26d399cfedef383b41ac0c0043c6faf0150b73d879411e225
MD5 52eeb7931f08487b3a795543e689e67e
BLAKE2b-256 c541d40cdbcb69cf07d47e4fbd5fa93b505ba342861263cc5c2aa93372a0feb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for anno_mage-2.0.2.tar.gz:

Publisher: release.yml on virajmavani/semi-auto-image-annotation-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anno_mage-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: anno_mage-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 182.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anno_mage-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7fa6605755d8dad0f10c5d7b6f40ea2ece5ec5e97ed45f1fdda455cc03c163c3
MD5 05ba1c721d28e97fc5c632ddfc50f2d8
BLAKE2b-256 652b1aef47db4f21056d10aa9b5e5f2ebccde0bea61ecc91d44b57d9aadc04eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for anno_mage-2.0.2-py3-none-any.whl:

Publisher: release.yml on virajmavani/semi-auto-image-annotation-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page