Simple app to annotate data for YOLOv4. Made in pygame.
Inspired and more compact version of https://github.com/Vxtzq/annot_data
You can now give the path to the darknet directory in settings.py, and the result files will be directly stored in it.
This repository works with "darknet" YOLOv4, here is the link :
https://github.com/AlexeyAB/darknet
Clone it and compile it following instructions.
Useful links :
https://github.com/AlexeyAB/darknet#how-to-compile-on-linuxmacos-using-cmake
https://github.com/AlexeyAB/darknet#how-to-compile-on-windows-using-cmake
Then, in command prompt, enter :
git clone https://github.com/proplayer2020/annot-tool-GUI
cd annot-tool-GUI
pip install -r requirements.txt
python download.py
to download yolo models and weights, necessary for training, or simply use the .AppImage for linux.
In command prompt :
annotdataGUI.bat
In file manager :
Simply click on "annotdataGUI.bat"
In command prompt :
chmod +x annotdataGUI.sh
./annotdataGUI.sh
In file manager :
Go into the repository and go into the properties of "annotdataGUI.Appimage" file and tick "Allow Executing File As Program"
Then, simply click the .Appimage file, the app should open.
In command prompt :
chmod +x annotdataGUI.sh
sh annotdataGUI.sh
See how to prepare your images here : https://github.com/proplayer2020/annot-tool-GUI/tree/main#dataset-types
Useful things :
Once annotation/marking is finished, click on "prepare data for training", and move the files (train.txt and test.txt) generated in the folder named "result" to build/darknet/data
File where all the path of useful files for training are stored.
Move it to build/darknet/data/
File where all the classes names are stored
keep it in result folder
Files where all the images path are listed for training and test phase.
Keep those in result folder
Config file of yolo
Move it to build/darknet/data/
Yolo models.
Move those to build/darknet/data/
Weights of the models that will be used for training
Keep those in the result folder
Those commands should work with the steps above
Execute this command in the terminal, in the build/darknet/ folder :
Yolo : darknet.exe detector train data/obj.data data/yolo-obj.cfg data/yolo.conv.137
Tiny yolo : darknet.exe detector train data/obj.data data/yolo-tiny-obj.cfg data/yolo-tiny.conv.29
Execute this command in the terminal, in the build/darknet/ folder :
Yolo : ./darknet detector train data/obj.data data/yolo-obj.cfg data/yolov4.conv.137
Tiny yolo : ./darknet detector train data/obj.data data/yolo-tiny-obj.cfg data/yolov4-tiny.conv.29
Two dataset types are supported :
-
Dataset with classes as folders (e.g. images/dataset/class1/img.png)
-
Dataset with just images (e.g. images/img1.png
To deal with the second option, tick the corresponding option in the start settings and enter the classes names, one by one, into the last textbox.
The python file "replaceformat.py" is used to replac image files like .jpg to .txt (bounding box data)
The current images format supported are : .jpg, .png, .jpeg, .JPG, .webp, .bmp and .heif.
It is easy to add images format by modifying "replaceformat.py"
A preview of all the classes should be appearing under it.
If the dataset used is somewhere else than in annot-data-GUI/images/*, it is possible to change its location in the start settings, by entering the path of the dataset (e.g. /home/user/dataset/) or clicking on "Browse".
If an Error pops up when the app is oppened, it is possible to report it by clicking the text underneath.
Feel free to create an issue for problems/questions.