From e232ac2489c0f20803fface85dfc4a4a82ba50d4 Mon Sep 17 00:00:00 2001 From: Zhiltsov Max Date: Fri, 19 Jun 2020 12:24:39 +0300 Subject: [PATCH 1/2] Allow single boxes in MOT format --- cvat/apps/dataset_manager/formats/mot.py | 11 +++++++++++ cvat/apps/engine/tests/_test_rest_api.py | 1 + 2 files changed, 12 insertions(+) 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": From 0a72a99b0273bf1211df376ef4ea53a7ecc13978 Mon Sep 17 00:00:00 2001 From: Zhiltsov Max Date: Fri, 19 Jun 2020 12:28:01 +0300 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index edc74e025018..783128f3181b 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) ### Changed - Removed information about e-mail from the basic user information ()