A multi-class bounding box labeling tool
- Conversion script to convert bounding box labels to YOLO format
- Bounding boxes are now labeled
- Dropdown menu for loading directories
- Image resizing script
- No need to click "Confirm Class" to switch classes
Requirements
- Python 3
- Python3 Tkinter
Recommended: setup virtualenv
Install requirements
$ sudo apt-get install python3 python3-tk
$ pip3 install -r requirements.txt
Create folders in Images/
and place your images in them, e.g. Images/Dogs/
, Images/Cats/
, etc. There is no strict requirement about what images need to be in which folders; this is just an organizational feature.
$ python3 main.py
- To change image directory, use the dropdown menu next to
Image dir:
- To change object class, use the dropdown menu under
Class:
- To draw a bounding box, use your mouse to align the crosshairs and click at two corner points
- To cancel drawing a bounding box, press
esc
- To delete a bounding box, select the box in the list and click the
Delete
button - To change images, either use the left/right arrows on your keyboard,
a
ord
, or click the buttons - Annotations are saved in the following format:
<x1>, <y1>, <x2>, <y2>, <w>, <h>, <class>
, wherex1
y1
x2
andy2
are the top left and bottom right coordinates of the bounding box,w
andh
are the width and height of the images, andclass
is the category of the bounding box.
Figuring out the rest is left as an exercise to the reader.
Run resize_images.py
to resize all images to a specified max height. Default is 800px.
$ python3 convert.py
Labels will be converted to YOLO format. Formatted labels will be saved in the specified folder, default is YOLO_Formatted/
. Only images in the Images
folder will have their labels converted.