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.
โจ 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.txtauto-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
.txtfiles 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
- Click the ๐ Click to open dataset folderโฆ button in the top bar
- Browse to your dataset folder containing images
- 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
- Select a class from the dropdown or use number keys
0-9 - Draw a bounding box: Click and drag on the image
- Adjust boxes:
- Drag from inside to move
- Drag handles to resize
- Save: Press
Sor click ๐พ Save
Managing Classes
- Open the Classes panel on the right
- Click + Add to create new classes
- Click on class names to rename them
- 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 :7182thenkill <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:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting:
pytest && black . && ruff check . - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
733f168d9feb7a63cc7aac891bfadf3ff16794945066a3c7ebbf8f349dc253e6
|
|
| MD5 |
05d90f6cd32a4d6ddc52ea7acb531ff8
|
|
| BLAKE2b-256 |
5c45f728dfff1fc2469ad39d6c0addaad415cdd3d660377a977265b9deee38a8
|
Provenance
The following attestation bundles were made for multilabel_yolo-0.1.0.tar.gz:
Publisher:
publish.yml on sdburde/multiclass_yolo_labeling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multilabel_yolo-0.1.0.tar.gz -
Subject digest:
733f168d9feb7a63cc7aac891bfadf3ff16794945066a3c7ebbf8f349dc253e6 - Sigstore transparency entry: 1133612234
- Sigstore integration time:
-
Permalink:
sdburde/multiclass_yolo_labeling@64539000c84f2b984d9f8c482213c58b42b5f5aa -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sdburde
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64539000c84f2b984d9f8c482213c58b42b5f5aa -
Trigger Event:
push
-
Statement type:
File details
Details for the file multilabel_yolo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: multilabel_yolo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76128cbf4c72637d7451f7a2f5c9a000dc93dbff739ba15b083f72df2840f9d2
|
|
| MD5 |
2e2d2912f4110e626648a3117f6a68c3
|
|
| BLAKE2b-256 |
7c57b064c92b3393ea283a77dfffcafa4eb7683cdfe5d1f0419d0b8b7c1fc280
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multilabel_yolo-0.1.0-py3-none-any.whl -
Subject digest:
76128cbf4c72637d7451f7a2f5c9a000dc93dbff739ba15b083f72df2840f9d2 - Sigstore transparency entry: 1133613012
- Sigstore integration time:
-
Permalink:
sdburde/multiclass_yolo_labeling@64539000c84f2b984d9f8c482213c58b42b5f5aa -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sdburde
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64539000c84f2b984d9f8c482213c58b42b5f5aa -
Trigger Event:
push
-
Statement type: