[Datumaro] Fix occluded and z_order attributes export (#1271)

* Fix occluded and z_order attributes export

* Add line to changelog

Co-authored-by: Nikita Manovich <40690625+nmanovic@users.noreply.github.com>
main
zhiltsov-max 6 years ago committed by GitHub
parent 9545132097
commit 08688b0c3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-
### Fixed
- `occluded` and `z_order` annotation attributes are now correctly passed to Datumaro ([#1271](https://github.com/opencv/cvat/pull/1271))
- Annotation-less tasks now can be exported as empty datasets in COCO ([#1277](https://github.com/opencv/cvat/issues/1277))
- Frame name matching for video annotations import -
allowed `frame_XXXXXX[.ext]` format ([#1274](https://github.com/opencv/cvat/pull/1274))

@ -91,7 +91,9 @@ class CvatAnnotationsExtractor(datumaro.Extractor):
@staticmethod
def _load_categories(cvat_anno):
categories = {}
label_categories = datumaro.LabelCategories()
label_categories = datumaro.LabelCategories(
attributes=['occluded', 'z_order'])
for _, label in cvat_anno.meta['task']['labels']:
label_categories.add(label['name'])
@ -144,6 +146,8 @@ class CvatAnnotationsExtractor(datumaro.Extractor):
anno_group = shape_obj.group
anno_label = map_label(shape_obj.label)
anno_attr = convert_attrs(shape_obj.label, shape_obj.attributes)
anno_attr['occluded'] = shape_obj.occluded
anno_attr['z_order'] = shape_obj.z_order
anno_points = shape_obj.points
if shape_obj.type == ShapeType.POINTS:
@ -238,7 +242,7 @@ def import_dm_annotations(dm_dataset, cvat_task_anno):
frame=frame_number,
label=label_cat.items[ann.label].name,
points=ann.points,
occluded=False,
occluded=ann.attributes.get('occluded') == True,
group=group_map.get(ann.group, 0),
attributes=[cvat_task_anno.Attribute(name=n, value=str(v))
for n, v in ann.attributes.items()],

Loading…
Cancel
Save