Skip to main content

A web-based annotation tool for creating YOLO-format object detection datasets

Project description

MultiLabel YOLO

A modern, web-based annotation tool for creating YOLO-format object detection datasets. Built with FastAPI and a sleek vanilla JavaScript frontend.

License Python PyPI


โœจ Features

  • ๐ŸŽฏ YOLO Format Support โ€“ Export labels in standard 5-value and 6-value (with confidence) YOLO format
  • ๐Ÿ“ Flexible Dataset Structure โ€“ Supports both flat folders and nested session-based layouts
  • ๐ŸŽจ Smart Class Management โ€“ Dynamic class creation, editing, and classes.txt auto-save
  • ๐Ÿ” Zoom & Pan โ€“ Smooth zoom (Ctrl+Scroll), pan (Space+Drag or middle-mouse), and fit-to-view
  • โŒจ๏ธ Keyboard Shortcuts โ€“ Optimized workflow with extensive keyboard shortcuts
  • ๐Ÿ’พ Auto-Save Ready โ€“ Labels saved as .txt files paired with images
  • ๐ŸŒ Local Browser โ€“ Built-in file browser to navigate and load any dataset folder
  • ๐Ÿ“Š Progress Tracking โ€“ Visual progress bars and labeled image counts

๐Ÿ“ฆ Installation

From PyPI (Recommended)

pip install multilabel-yolo

From Source

git clone https://github.com/sdburde/multiclass_yolo_labeling.git
cd multiclass_yolo_labeling
pip install -e .

Development Installation

pip install -e ".[dev]"

๐Ÿš€ Quick Start

Run the Application

multilabel-yolo

The application will start on http://127.0.0.1:7182

Custom Host/Port

multilabel-yolo --host 0.0.0.0 --port 8080

Disable Auto-Reload

multilabel-yolo --no-reload

View Help

multilabel-yolo --help

Using as a Python Library

from multilabel_yolo import run_server

# Run the server programmatically
run_server(host="127.0.0.1", port=7182, reload=True)

Or access the FastAPI app directly:

from multilabel_yolo import app

# Use with your own uvicorn configuration
import uvicorn
uvicorn.run(app, host="127.0.0.1", port=7182)

๐Ÿ“– Usage Guide

Loading a Dataset

  1. Click the ๐Ÿ“‚ Click to open dataset folderโ€ฆ button in the top bar
  2. Browse to your dataset folder containing images
  3. Click Open Dataset โ–ถ to load

The tool auto-detects:

  • Flat layout: All images in one folder
  • Nested layout: Multiple sub-folders (sessions) with images

Creating Annotations

  1. Select a class from the dropdown or use number keys 0-9
  2. Draw a bounding box: Click and drag on the image
  3. Adjust boxes:
    • Drag from inside to move
    • Drag handles to resize
  4. Save: Press S or click ๐Ÿ’พ Save

Managing Classes

  1. Open the Classes panel on the right
  2. Click + Add to create new classes
  3. Click on class names to rename them
  4. Click ๐Ÿ’พ to save classes.txt

Navigation

Action Shortcut
Previous image A or โ—€ Prev button
Next image D or Next โ–ถ button
Save labels S
Undo last box Ctrl+Z or โ†ฉ Undo
Delete selected box Delete / Backspace
Select class 0-9 Number keys 0 through 9
Pan mode toggle Click โœ‹ Pan button
Temporary pan Hold Space or middle-mouse button
Zoom in/out Ctrl + Scroll or + / โˆ’ buttons
Fit to view F or โŠก Fit button
Reset zoom (100%) 1:1 button

๐Ÿ“ Dataset Format

Folder Structure

Flat Layout:

my_dataset/
โ”œโ”€โ”€ classes.txt
โ”œโ”€โ”€ image1.jpg
โ”œโ”€โ”€ image1.txt
โ”œโ”€โ”€ image2.png
โ”œโ”€โ”€ image2.txt
โ””โ”€โ”€ ...

Nested Layout (Sessions):

my_dataset/
โ”œโ”€โ”€ session_1/
โ”‚   โ”œโ”€โ”€ classes.txt
โ”‚   โ”œโ”€โ”€ img1.jpg
โ”‚   โ””โ”€โ”€ img1.txt
โ”œโ”€โ”€ session_2/
โ”‚   โ”œโ”€โ”€ classes.txt
โ”‚   โ”œโ”€โ”€ img2.jpg
โ”‚   โ””โ”€โ”€ img2.txt
โ””โ”€โ”€ ...

Label File Format (YOLO)

Each .txt file contains one bounding box per line:

5-value format (standard):

<class_id> <cx> <cy> <bw> <bh>

6-value format (with confidence):

<class_id> <cx> <cy> <bw> <bh> <confidence>

Where:

  • class_id: Integer (0-indexed)
  • cx, cy: Normalized center coordinates (0-1)
  • bw, bh: Normalized box width and height (0-1)

Classes File Format

classes.txt contains one class name per line:

person
car
dog
cat

๐Ÿ› ๏ธ API Endpoints

When running, the application exposes these endpoints at http://localhost:7182:

Endpoint Method Description
/ GET Serve the main application
/api/browse POST Browse directories
/api/load_dataset POST Load a dataset folder
/api/image GET Get image as base64
/api/labels GET Get labels for an image
/api/labels POST Save labels for an image
/api/save_classes POST Save classes.txt

Interactive API docs available at: http://localhost:7182/docs


๐ŸŽจ Architecture

multilabel_yolo/
โ”œโ”€โ”€ __init__.py       # Package initialization
โ”œโ”€โ”€ server.py         # FastAPI backend
โ”œโ”€โ”€ cli.py            # Command-line interface
โ””โ”€โ”€ static/
    โ”œโ”€โ”€ index.html    # Main HTML structure
    โ”œโ”€โ”€ styles.css    # All styles
    โ””โ”€โ”€ app.js        # Frontend application logic

๐Ÿ”ง Configuration

Change Port

multilabel-yolo --port 8080

Change Host

multilabel-yolo --host 0.0.0.0

Disable Reload

multilabel-yolo --no-reload

๐Ÿ› Troubleshooting

Labels Not Saving

Issue: Labels not being saved to .txt files

Solution: Check browser console for errors. Ensure the server is running and you have write permissions in the dataset folder.

Images Not Loading

Issue: Images show as broken or don't appear

Solution:

  • Verify image formats are supported (.jpg, .jpeg, .png, .bmp, .webp)
  • Check file permissions
  • Ensure the path doesn't contain special characters

Port Already in Use

Issue: Error: [Errno 98] Address already in use

Solution:

  • Use a different port: multilabel-yolo --port 8080
  • Or kill the process using the port: lsof -i :7182 then kill <PID>

Module Not Found After Install

Issue: ModuleNotFoundError: No module named 'multilabel_yolo'

Solution:

  • Ensure you're using the correct Python environment
  • Reinstall: pip install --upgrade multilabel-yolo

๐Ÿค Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting: pytest && black . && ruff check .
  5. Submit a pull request

Development Setup

git clone https://github.com/sdburde/multiclass_yolo_labeling.git
cd multiclass_yolo_labeling
pip install -e ".[dev]"

๐Ÿ“ License

MIT License โ€“ feel free to use and modify for your projects.


๐Ÿ“ง Support

For issues, questions, or feature requests, please open an issue on the GitHub repository.


Happy Annotating! ๐ŸŽ‰

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

multilabel_yolo-0.1.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

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

multilabel_yolo-0.1.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file multilabel_yolo-0.1.0.tar.gz.

File metadata

  • Download URL: multilabel_yolo-0.1.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for multilabel_yolo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 733f168d9feb7a63cc7aac891bfadf3ff16794945066a3c7ebbf8f349dc253e6
MD5 05d90f6cd32a4d6ddc52ea7acb531ff8
BLAKE2b-256 5c45f728dfff1fc2469ad39d6c0addaad415cdd3d660377a977265b9deee38a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for multilabel_yolo-0.1.0.tar.gz:

Publisher: publish.yml on sdburde/multiclass_yolo_labeling

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

File details

Details for the file multilabel_yolo-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for multilabel_yolo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76128cbf4c72637d7451f7a2f5c9a000dc93dbff739ba15b083f72df2840f9d2
MD5 2e2d2912f4110e626648a3117f6a68c3
BLAKE2b-256 7c57b064c92b3393ea283a77dfffcafa4eb7683cdfe5d1f0419d0b8b7c1fc280

See more details on using hashes here.

Provenance

The following attestation bundles were made for multilabel_yolo-0.1.0-py3-none-any.whl:

Publisher: publish.yml on sdburde/multiclass_yolo_labeling

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