The YOLO Annotation Tool is a comprehensive solution for creating, editing, and managing object detection datasets in YOLO format. It features an intuitive GUI, automatic detection using YOLO models with SAHI support, and efficient batch processing capabilities.
git clone https://github.com/ildehakale/YOLO-Annotation-Tool.git
cd YOLO-Annotation-Toolpython3 -m venv label_venv --system-site-packages.\label_env\Scripts\activatesource label_env/bin/activate- Before install the requirements.txt, run the command below to install torch with CUDA supported.
pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu124- Install requirements.txt
pip install -r requirements.txt- Install libxcb
sudo apt-get install -y libxcb-xinerama0 libxcb-cursor0 libxkbcommon-x11-0- If you don't use Linux, comment the lines from main.py
# Linux platform settings
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms"
os.environ["QT_QPA_PLATFORM"] = "xcb"- Place your YOLO model files (.pt) in the
models/folder.
python3 main.pyRun the application through VNC using Docker.
# Clone the repository
git clone https://github.com/ildehakale/YOLO-Annotation-Tool.git
cd YOLO-Annotation-Tool
# Build the Docker image
docker-compose build
# Start the container
docker-compose up -dConnect to the VNC interface from your web browser:
http://localhost:6080/vnc.html
VNC Password: yololabel123
- Models: Add your
.ptfiles to the./models/folder - Dataset: Place your images and label files in the
./data/folder
Edit config/settings.py to customize the application:
IMPORTANT: By default, this tool is configured for only 2 classes (person=0, car=2).
To add more classes:
- Open
config/settings.py - Add your class IDs to
ALLOWED_CLASSES - Add corresponding class names to
class_namesdictionary
Example configuration (default):
# Allowed classes for detection (COCO format)
ALLOWED_CLASSES = {0, 2} # 0=person, 2=car
# Class names mapping
class_names = {
0: "person",
2: "car"
}Note: You must update both ALLOWED_CLASSES and class_names in config/settings.py for new classes to work properly. Refer to COCO class IDs for the complete list.
Zoom in for precise labeling:
- Hold
Ctrland scroll up/down to zoom
| Action | Description |
|---|---|
| Left Click + Drag | Draw new bounding box |
| Right Click | Toggle selection of bounding box (multi-select) |
| Middle Click + Drag | Pan the image |
| Ctrl + Scroll | Zoom in/out at cursor position |
| Key | Action |
|---|---|
→ (Right Arrow) |
Next image |
← (Left Arrow) |
Previous image |
Delete |
Delete all selected bounding boxes |
.jpg,.jpeg,.png
Labels are saved as .txt files with the same name as the image:
class_id,center_x,center_y,width height
Example: labels/image001.txt
0 0.716797 0.395833 0.216406 0.147222
2 0.687500 0.379167 0.255469 0.158333
Supported Models:
.pt- PyTorch YOLO models (Ultralytics)
Model Requirements:
- Must be trained for object detection
- Output should match YOLO format
- Compatible with Ultralytics
my_dataset/
├── images/
│ ├── img_0001.jpg
│ ├── img_0002.jpg
│ └── img_0003.png
└── labels/
├── img_0001.txt
├── img_0002.txt
└── img_0003.txt
Depending on the models and SAHI used, incorrect or unnecessary detections may occur during object detection. Follow the steps below:
2. To delete unnecessary bbox labels, right-click on the bbox and then press the "Delete" key to remove that filter.
SAHI Paper:
@article{akyon2022sahi,
title={Slicing Aided Hyper Inference and Fine-tuning for Small Object Detection},
author={Akyon, Fatih Cagatay and Altinuc, Sinan Onur and Temizel, Alptekin},
journal={2022 IEEE International Conference on Image Processing (ICIP)},
doi={10.1109/ICIP46576.2022.9897990},
pages={966-970},
year={2022}
}SAHI Software:
@software{obss2021sahi,
author = {Akyon, Fatih Cagatay and Cengiz, Cemil and Altinuc, Sinan Onur and Cavusoglu, Devrim and Sahin, Kadir and Eryuksel, Ogulcan},
title = {{SAHI: A lightweight vision library for performing large scale object detection and instance segmentation}},
month = nov,
year = 2021,
publisher = {Zenodo},
doi = {10.5281/zenodo.5718950},
url = {https://doi.org/10.5281/zenodo.5718950}
}SAHI Repository: https://github.com/obss/sahi
