A utility which converts your supervise.ly training dataset to Darknet training dataset
I use Supervise.ly web platform to annotate and train my datasets using their hosted YOLOv3 model and to play around with object detection.
Then I discovered Darknet YOLOv3 particularly the repository fork of AlexeyAB which began my curiosity to dive deeper to understand the framework.
This got me interested until the annotation part as the author recommended to use Yolo_mark. Using the said utility is not easy to navigate and the image always distorted.
Supervise.ly has the best annotation tool so far. So why not generate your dataset by using Supervisely's annotation tool and train the generated dataset using your local copy of Darknet?
That would be great, but the problem with that is both of them has a different dataset layout. Bounding boxes coordinates generated from supervise.ly is on actual (x,y) pixel position format whereas in Darknet, it uses the relative position based on percentage of the actual width, height. bounding boxes are calculated by the x/y center.
This utility would automate the conversion of Supervise.ly dataset to Darknet dataset.
- This utility only recognizes rectangular annotation shape. Supervise.ly has a variety of shapes to annotate your classes.
- Copy the repo and install dependencies.
$ npm install
- Login to your supervise.ly account and select your project (dataset).
- Download your dataset, uncompress the file and put the contents in the input folder under your repo directory. Ensure that the meta.json file is present, which contains the classes to be trained in Darknet.
- Run the utility.
$ node index
- Once done, the generated output will be saved to the output folder under your repo directory.
- data/obj/*.jpg - training images (i.e., bag0001.jpg)
- data/obj/*.txt - annotations (i.e., bag0001.txt)
- data/train.txt - lists of images for training
- data/obj.names - lists of class names for training
- data/obj.data - contains the number of classes and directory info.
Generated dataset layout for Darknet is based on AlexeyAB guide