diff --git a/CHANGELOG.md b/CHANGELOG.md index 91ed8dd5c3c9..11e82a54f957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Built-in search for labels when create an object or change a label () - Better validation of labels and attributes in raw viewer () - ClamAV antivirus integration () +- Supported import and export or single boxes in MOT format (https://github.com/opencv/cvat/pull/1764) - [Datumaro] Added `stats` command, which shows some dataset statistics like image mean and std (https://github.com/opencv/cvat/pull/1734) - Add option to upload annotations upon task creation on CLI - Polygon and polylines interpolation () diff --git a/cvat/apps/dataset_manager/formats/mot.py b/cvat/apps/dataset_manager/formats/mot.py index f9e7a02c4cf8..1efb9b578c6c 100644 --- a/cvat/apps/dataset_manager/formats/mot.py +++ b/cvat/apps/dataset_manager/formats/mot.py @@ -45,6 +45,17 @@ def _import(src_file, task_data): track_id = ann.attributes.get('track_id') if track_id is None: + # Extension. Import regular boxes: + task_data.add_shape(task_data.LabeledShape( + type='rectangle', + label=label_cat.items[ann.label].name, + points=ann.points, + occluded=ann.attributes.get('occluded') == True, + z_order=ann.z_order, + group=0, + frame=frame_number, + attributes=[], + )) continue shape = task_data.TrackedShape( diff --git a/cvat/apps/engine/tests/_test_rest_api.py b/cvat/apps/engine/tests/_test_rest_api.py index fcd3d59a1d7f..aa9e0e77341d 100644 --- a/cvat/apps/engine/tests/_test_rest_api.py +++ b/cvat/apps/engine/tests/_test_rest_api.py @@ -3119,6 +3119,7 @@ def _get_initial_annotation(annotation_format): annotations["tracks"] = rectangle_tracks_wo_attrs elif annotation_format == "MOT 1.1": + annotations["shapes"] = rectangle_shapes_wo_attrs annotations["tracks"] = rectangle_tracks_wo_attrs elif annotation_format == "LabelMe 3.0":