Skip to main content

annobel

Automatic + manual YOLO-format bounding box annotation tool with a Tkinter GUI (editor) and console fallback.

Version: 0.0.3 (Alpha)

Overview

annobel streamlines creating and refining object detection datasets. It wraps Ultralytics YOLOv8 models for optional automatic bounding box proposal, then lets you refine or create labels manually. The tool stores annotations in standard YOLO text format (class x_center y_center width height, normalized values).

Main Features

  • Automatic annotation (detection) using Ultralytics YOLOv8 model variants or local weights.
  • Manual drawing, moving, resizing, deleting bounding boxes.
  • Class list management (add / rename) saved to a classes.txt file.
  • Autosave after every modification.
  • Console fallback when tkinter is not present.
  • Per-image navigation and keyboard shortcuts.
  • Optional subset filtering of detection classes.
  • Non-destructive: detection stage creates / overwrites only label files.

Installation

pip install annobel

Dependencies

  • Python >= 3.8
  • ultralytics (YOLO) – installed automatically.
  • pillow for image handling.

Quick Start (CLI)

After installation:

annobel

You will be prompted (GUI or console fallback) to choose:

  1. Mode: Automatic Annotation (YOLO) or Manual Annotation / Editing.
  2. Image & label directories.
  3. (Auto mode) model selection (download variant or local path) and optional class subset.

Labels are saved as <image_stem>.txt in the labels directory. A classes.txt is created/updated as needed.

Programmatic Usage

from annobel import run  

run(
    images_dir="/path/to/images",
    mode="auto",                 # or "manual"
    model_path="yolov8n.pt",      # only needed for auto mode
    conf=0.25,
    write_empty_detection_files=True,  # 0.0.3 default now ensures 1:1 images:labels
    classes_filter_ids=[0, 2],    # optional subset
)

For full interactive loop (menu reappears after exiting editor):

from annobel import main
main()

Directory Structure (Generated)

images/
  img001.jpg
  img002.jpg
labels/
  img001.txt
  img002.txt
  classes.txt

YOLO Label Format Recap

Each line: class_id x_center y_center width height with all coordinates normalized to [0,1] relative to image width/height.

Keyboard & Mouse Shortcuts (Editor)

  • A: Add mode
  • E: Edit mode
  • C: Change class of selected box
  • M: Manage classes dialog
  • Delete: Remove selected box
  • ← / →: Previous / next image
  • Q: Return to main menu
  • I: Print info about current boxes
  • Mouse (Add mode): Click-drag to draw box
  • Mouse (Edit mode): Drag box interior to move; handles to resize; right-click to delete
  1. Place raw images into an images directory.
  2. Run auto mode with a YOLO model (e.g., yolov8n.pt) to bootstrap labels.
  3. Inspect & refine with manual editor (resize, delete, add boxes, change classes).
  4. Iterate until dataset is satisfactory.

Ultralytics Notice & Licensing

This package depends on the external ultralytics project for YOLO model loading and inference. Key points:

  • Ultralytics repository: https://github.com/ultralytics/ultralytics
  • Their code / weights are subject to the AGPL-3.0 license by default and/or alternative commercial terms offered by Ultralytics. See their LICENSE and documentation for the authoritative terms.
  • This package does NOT bundle or redistribute model weights; it only invokes the YOLO API when you request detection.
  • If you deploy or integrate this in a network service or commercial product, ensure you meet the obligations of the Ultralytics license (e.g., providing source, offering access, or acquiring a commercial license if required).

You (the end user) are solely responsible for verifying that your intended use of the models and resulting annotations complies with applicable licenses and data privacy regulations.

Contributing

  1. Fork repository
  2. Create a feature branch: git checkout -b feature/awesome
  3. Install dev extras: pip install -e .[dev]
  4. Run linters / tests: flake8, black --check ., pytest
  5. Submit PR

Versioning / Changelog

  • 0.0.3: Create empty label .txt for images with zero detections (default on). Added write_empty_detection_files=True default. Run progress line now shows whether empty label writing is ON. This ensures a strict 1:1 image:label mapping and prevents silent negatives being skipped. To restore previous behavior pass write_empty_detection_files=False to run().
  • 0.0.2: Initial packaged release (renamed to annobel)

Upgrading Notes (0.0.2 -> 0.0.3)

If you previously generated datasets with missing label files for negative images, you can retroactively create empty files:

python - <<'PY'
from pathlib import Path
images=Path('path/to/images')
labels=Path('path/to/labels')
labels.mkdir(exist_ok=True, parents=True)
img_exts={'.jpg','.jpeg','.png','.bmp','.tif','.tiff','.webp'}
existing={p.stem for p in labels.glob('*.txt') if p.name!='classes.txt'}
created=0
for img in images.iterdir():
    if img.is_file() and img.suffix.lower() in img_exts and img.stem not in existing:
        (labels/f"{img.stem}.txt").write_text('')
        created+=1
print('Created empty label files:', created)
PY

Git Version Management

Recommended workflow to preserve 0.0.2 and introduce 0.0.3:

  1. Commit current 0.0.2 state (if not already):
    git add . && git commit -m "chore: finalize 0.0.2 release"
    git tag -a v0.0.2 -m "annobel 0.0.2"
    
  2. Apply the 0.0.3 changes (already done in this repo), then:
    git add . && git commit -m "feat: 0.0.3 default empty label file support"
    git tag -a v0.0.3 -m "annobel 0.0.3"
    git push origin main --tags
    
  3. To create a maintenance branch for 0.0.2 (optional):
    git branch release/0.0.2 v0.0.2
    git push origin release/0.0.2
    
  4. If you need a hotfix for 0.0.2 later: branch from release/0.0.2, bump version (e.g. 0.0.2.post1), tag, and publish.

To install a specific version for reproducibility:

pip install annobel==0.0.2   # old behavior (no auto empty files)
pip install annobel==0.0.3   # new behavior

Security / Privacy

Images are processed locally. No images or labels are uploaded by this package. Be cautious with sensitive imagery and model weight redistribution restrictions.

Disclaimer

Provided "AS IS" under AGPL-3.0-or-later. No warranty of fitness for a particular purpose. Always validate annotations before using for training.

License

  • This package: AGPL-3.0-or-later (see LICENSE)
  • Ultralytics YOLO: AGPL-3.0 (or commercial) – external dependency

© 2025 Sayali Dongre

Metadata

Release files for annobel 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for annobel 0.0.4
File Size Uploaded Provenance Actions
annobel-0.0.4.tar.gz 56.0 kB Without provenance Details for annobel-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for annobel 0.0.4
File Interpreter ABI Platform Actions
annobel-0.0.4-py3-none-any.whl Python 3 none any Details for annobel-0.0.4-py3-none-any.whl

Total release size: 97.2 kB

Release files / annobel-0.0.4.tar.gz

Download URL annobel-0.0.4.tar.gz
Size 56.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fd2e4cf248447f1af72027e74568cc134c8a03d6e825ae6ae5bf1cad4595aab4
BLAKE2b-256 checksum
How to use checksums
aee5e81dfee2d16057a3acef4114e4b66b794fbebb74a0ae700be45d0e4f87d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / annobel-0.0.4-py3-none-any.whl

Download URL annobel-0.0.4-py3-none-any.whl
Size 41.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d847d27e4a376022bcfeed88535d9b3a8454c6e049adb64cf540b350fd1889b
BLAKE2b-256 checksum
How to use checksums
95a14885edf900cf7d926fca42f5440e46ec1c02240328249bbd9531b8608fa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for annobel 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page