Open frederik-ai opened 1 year ago
This breaks YOLO format since classes are added where no labels (bounding boxes) are ever provided. However, networks reading the export try to predict way too much classes (8 instead of 2 in the case of @frederikcpp).
I see the problem here. There should be done some filtering by RectagleLabels.
The fix will be something like this:
for name, info in self._schema.items():
labels |= set(info['labels'])
=>
for name, info in self._schema.items():
if info['type'].lower() != 'rectanglelabels':
continue
labels |= set(info['labels'])
If you could contribute and test this, it would be great!
I see, thank you for the suggestion. I will test if this fix works and contribute it if it does.
Any updates on this @frederikcpp? Would be great to integrate this fix into the next release.
Sorry for the late response. The above PR should fix the issue. I also allowed PolygonLabels to be added, because otherwise this breaks COCO exports that use segmentation.
The YOLO export has still an invalid format if you use the Choices
tag. I think the linked PR should fix the issue but it is not merged yet. Any updates on this?
Is your feature request related to a problem? Please describe. I am currently labeling data for object detection. The data will be used to train a YOLOv5 net.
I would not only like to label each region with a class (e.g. plane or car), but to also add metadata to each region and to the whole image. The metadata should state additional information about the currently selected region (whether the plane/car is moving) and about the whole image (image quality).
However, I currently do not see a way of implementing this in a way so that YOLO classes.txt is not affected. I would like to add metadata so that Label Studio does not interpret its content as class labels.
Describe alternatives you've considered To add my metadata, I followed the approach in issue #2256. I implemented the metadata with Choices tags in the labeling configuration:
When I export my annotations as JSON, everything is as intended. However, when I export to YOLO, the metadata classes (yes, no, unknown,...) are added to the classes.txt:
However, it would make more sense for my use-case if the classes.txt contained only the two classes I actually want to detect:
I would only like the metadata to be shown when I export my tasks to JSON. The metadata is not relevant for my YOLO net.
Describe the solution you'd like If I am not missing a solution and there is actually no way of implementing this, I would like a way to add metadata without it being interpeted as class labels. Maybe by adding a specific XML attribute or tag.