This Python program converts task datasets exported as Segmentation mask 1.1 from CVAT to YOLOv8 Instance Segmentation format.
- Handles multiple classes in a single image.
- Saves labels in a
labels
folder.
- Run the
SegmentationMaskToYolov8.py
script. - When prompted, enter the path of the
labelmap.txt
file,SegmentationClass
folder, andSegmentationObject
folder. - Labels will be saved as text files and stored in a
labels
folder.
# label:color_rgb:parts:actions
background:0,0,0::
dog:250,50,83::
horse:255,204,51::
human:42,125,209::
Photo by Pixabay from Pexels.
Resulting Images:
SegmentationClass | SegmentationObject |
---|---|
Output:
Label Output |
---|
pexels-pixabay-162520.txt |
Photo by Yaroslav Shuraev from Pexels.
Resulting Images:
SegmentationClass | SegmentationObject |
---|---|
Output:
Label Output |
---|
pexels-yaroslav-shuraev-8499242.txt |
- IDE: Microsoft Visual Studio Community 2022
- Language: Python 3.9