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.
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:
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
Individual Image Annotations
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:
2. Detection:
Labels should be formatted with one row per object in:
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:
For Dim=3:
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:
Useful links
Last updated