Replies: 1 comment
-
I have release version .44 with support for converting Coco segmentation annotations to Yolo segmentation format. You can see a demonstration in this notebook https://github.com/pylabel-project/samples/blob/main/coco2yolosegmentation.ipynb |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
name: Segmentation Support
title: Provide support for converting segmentation annotations
labels: proposal
assignees: @alexheat
What are you proposing?
Yolo now provides support for instance segmentation in addition to bounding boxes and multiple people have requested the ability to convert their existing datasets that have segmentation labels to Yolo format. You can learn more about the segmentation support in Yolo here: https://github.com/ultralytics/yolov5/tree/master/segment.
This spec describes the proposal for how PyLabel will handle conversions of segmentation annotations. The most important and first scenario that will be implemented will be to convert Coco annotations with segmentation into Yolo.
What users have asked for this feature?
Several users have request this, see issues: #65, #73.
What problems are you trying to solve?
People want to train Yolo segmentation models but first they need to convert their existing annotation into the Yolo format.
See below for an example of how Coco stores segmented annotations.
There is a "segmentation" node in the JSON that stores a comma separated list of numbers, which represent the coordinates for the segmentation mask. The numbers are stored in this order
x1, y1, x2, y2, x3, y3, ... xn, yn
so every 2 items in the list represent the x and y coordinates for one point.Yolo segmentation annotations are stored like
class x1, y1, x2, y2, x3, y3, ... xn, yn
for example:Note that Yolo stores annotation in a normalized format where each number represents the position in a scale from 0-1. For example, the first point in the example above would be 78% away from the left edge (x) and 98% percent away from the top edge (y).
To convert the annotations, PyLabel will:
What is the developer experience going to be?
There should be no change to the import experience. If there are segmentations in the dataset they will be imported. (Note that a single Coco file can have bounding boxes and segmentations. If both are present then PyLabel will import both.
When exporting to Coco, a new parameter will be added to specify if you want to export the segmentation annotation, as opposed to bounding boxes. The new definition of the function will be:
To export the file with segmentation annotations, use `ExportToYoloV5(segmentation=True)'.
Are there any breaking changes to the API
The goal is to not break anything.
What will it take to execute?
It will require updates to the importer, the data model, and the exporter.
Any remaining open issues?
Beta Was this translation helpful? Give feedback.
All reactions