This is very simple graphical tool for creating bounding rectangles and appropriate text files, suitable for training neural networks.
It should work for python 3.4+
(tested on conda python 3.6.1, Ubuntu, macOS, Windows) using built in python GUI module tkinter
and PIL
for images.
Input is folder with set of images (image format must be supported by PIL).
Output is text file with information about all rectangles in current image. There is one text file for every image.
Output can be modular due to class FileWriter
which ensures writing output into file.
Currently only writer for Darknet YOLO
is implemented.
You can implement FileWriter
interface if you need different output format.
From top to bottom:
- Input folder
- Output folder
- Classes and go to button
- Image number
- Canvas with currently displayed image
- Bar with rectangles
- Current bar index
Arrows - left, right
: Previous and next image.Arrows - up, down
orMousewheel
: Change class of currently chosen rectangle.Left mouse button
: When clicked on canvas, it starts creating rectangle. When clicked on bar, it chooses rectangle to modify.Right mouse button
: When clicked on canvas last item is deleted. When clicked on bar, chosen item is deleted.Spacebar
: Save rectangles into file and go to next frame.Mousewheel click
: Save rectangles into file. This is visualised by green color of bar's background.
- Run tool simply by command
python Labeling-tool.py
- Choose input/output folders
- Set number of classes
- Work can start