Convert Supervisely Annotations in Two Minutes
In this post, we walk through how to download data from Supervise.ly and convert Supervise.ly annotations to YOLO Darknet format specifically, and more generally convert Supervisely JSON to any other object detection annotation format for use in any of your custom computer vision models.
This guide is imperative if you want to use data from Supervise.ly in any application outside of the Supervisely platform.
Annotating Your Images
If you have unlabeled images, you can used Supervisely's annotation tool to label them. You may also want to consider open source labeling tools such as CVAT, LabelImg, VoTT, or LabelMe. We have some great guides on these labeling platforms including:
Downloading Data from Supervisely
After you have annotated your images, you will have an annotated dataset on the Datasets tab of Supervisely. You can export that dataset for use on custom computer vision tasks outside of Supervise.ly. Click the three dots in the lower portion of the image --> Download as
--> .json + images
:
This will download a .tar
file to your computer that contains a folder with all of the images in your dataset as well as an annotation file in Supervisely's custom JSON format. There will be one annotation file for each image. At the top of the annotation file there is some meta data about the image and then there is a list of annotated objects:
Each object has an ID and a class and some points defining the objects bounds.
How do we use this annotation format in an open source computer vision model?
The YOLO Darknet Format
The YOLO Darknet format is the annotation format used to train YOLOv3, train YOLOv4, or train YOLOv4 tiny. See here for a thorough discussion of the YOLOv4 model.
The YOLO TXT format is a simple annotation format. You have one .txt
annotation file for each image, and a .labels
file for class labels.
In the _darknet.labels
file there will be a class map, mapping integer class outputs to the class name, by the position that they occur in the list.
The individual .txt
annotations specify the bounding box coordinates for each image.
The first digit corresponds to the class name mapped in the .labels
file. So in this .txt
file we have a picture full of Surgeonfishes.
The YOLO Darknet format is a barebones flexible annotation format for training object detectors in the Darknet framework.
Converting from Supervise.ly to YOLO Darknet
We could imagine how we would convert Supervisely annotation to YOLO Darknet TXT by writing a script to parse through the the Supervisely annotations and normalize each box and print it on an annotation line. We would also have to create a class map and store that as a .labels
file.
But this is Convert Supervise.ly in two minutes!
We can quickly convert our annotations using Roboflow.
First, load your dataset into Roboflow by creating a free Roboflow account. Then create a new dataset.
And upload your Supervise.ly folder after unzipping it.
Then on the dataset page, choose the preprocessing and data augmentation steps you would like and hit Generate
. After generating, you can click Export
to output your dataset. Choose YOLO Darknet
format.
You can receive your export back in a .zip
file or with a curl
link to import your data into a training setting.
🎉 Congratulations! Now you have your Supervisely dataset in the portable annotation format you need to build your application.
Conclusion
In this guide, we have walked through the Supervisely format, the YOLO Darknet format, and we have shown how you can convert Supervisely annotations to YOLO Darknet in a matter of minutes.
This guide should provide the necessary tools to convert Supervisely to other annotations formats such as:
- Convert Supervisely to TFRecord
- Convert Supervisely to Pascal VOC
- Convert Supervisely to COCO JSON
- Convert Supervisely to YOLOv5 YAML
- Convert Supervisely to Amazon Ground Truth Manifest
- Convert Supervisely to Google Cloud AutoML
- Convert Supervisely for use with Azure Custom Vision
- Convert Supervisely to CreateML
As a next step, I suggest training a model with your new capabilities. I especially recommend checking out our tutorial on: