Yolo
Overview
This converter allows to import images with annotations in YOLO format for segmentation, detection and pose estimation tasks.
Each image should have a corresponding .txt
file with the same name, which contains information about objects in the image.
Segmentation labels will be converted to polygons. Labels format:
<class-index> <x1> <y1> <x2> <y2> ... <xn> <yn>
Detection labels will be converted to rectangles. Labels format:
<class-index> <x_center> <y_center> <width> <height>
Pose estimation labels will be converted to keypoints. Labels format:
<class-index> <x> <y> <width> <height> <px1> <py1> <px2> <py2> ... <pxn> <pyn>
for Dim=2 and<class-index> <x> <y> <width> <height> <px1> <py1> <p1-visibility> <px2> <py2> <p2-visibility> <pxn> <pyn> <p2-visibility>
for Dim=3.
YOLO format data should have a specific configuration file that contains information about classes and datasets, usually named data_config.yaml
.
⚠️ Note: If the input data does not contain data_config.yaml
file, it will use default COCO class names.

Enterprise users have access to "Import as links" option, which supports import of this format with annotations. This option might be beneficial in many cases, as it allows data import to Supervisely platform without re-uploading, maintaining a single source and speeding up import process.
To step up import speed even further you can compress all annotation files (.txt
's) into an archive and import it together with the images. (Note: This method is format-dependent and may not apply to all formats.)
Format description
Supported image formats: .jpg
, .jpeg
, .mpo
, .bmp
, .png
, .webp
, .tiff
, .tif
, .jfif
, .avif
, .heic
, and .heif
With annotations: Yes
Supported annotation file extension: .txt
.
Grouped by: Any structure (will be uploaded as a single dataset)\
Input files structure
Example data: download ⬇️\
Recommended directory structure:
📂project name
┣ 📂images
┃ ┣ 📂train
┃ ┃ ┣ 🖼️IMG_0748.jpeg
┃ ┃ ┣ 🖼️IMG_1836.jpeg
┃ ┃ ┣ 🖼️IMG_2084.jpeg
┃ ┃ ┗ 🖼️IMG_3861.jpeg
┃ ┗ 📂val
┃ ┣ 🖼️IMG_4451.jpeg
┃ ┗ 🖼️IMG_8144.jpeg
┣ 📂labels
┃ ┣ 📂train
┃ ┃ ┣ 📜IMG_0748.txt
┃ ┃ ┣ 📜IMG_1836.txt
┃ ┃ ┣ 📜IMG_2084.txt
┃ ┃ ┗ 📜IMG_3861.txt
┃ ┗ 📂val
┃ ┣ 📜IMG_4451.txt
┃ ┗ 📜IMG_8144.txt
┗ 📜data_config.yaml
Format Config File
File data_config.yaml
should contain the following keys:
names
- a list of class namescolors
- a list of class colors in RGB formatnc
- the number of classestrain
- the path to the train imagesval
- the path to the validation images
Single-Image Annotation
Annotation files are in .txt
format and should contain object labels on each line:
Class numbers that correspond to the class names in the
data_config.yaml
file.Label coordinates must be in normalized format (from 0 to 1).
1. Segmentation
Labels should be formatted with one row per object in:
<class-index> <x1> <y1> <x2> <y2> ... <xn> <yn>
2. Detection:
Labels should be formatted with one row per object in:
<class-index> <x_center> <y_center> <width> <height>
If your boxes are in pixels, you should divide x_center and width by image width, and y_center and height by image height.
3. Pose Estimation:
Labels should be formatted with one row per object.
For Dim=2:
<class-index> <x> <y> <width> <height> <px1> <py1> <px2> <py2> ... <pxn> <pyn>
For Dim=3:
<class-index> <x> <y> <width> <height> <px1> <py1> <p1-visibility> <px2> <py2> <p2-visibility> ... <pxn> <pyn> <pn-visibility>
Yolo coordinates explanation:
The label file corresponding to the below image contains 2 persons (class 0) and a tie (class 27) from original COCO classes.
📜zidan.txt:
0 0.481719 0.634028 0.690625 0.713278
0 0.741094 0.524306 0.314750 0.933389
27 0.364844 0.795833 0.078125 0.400000

Useful links
Last updated
Was this helpful?