Skip to content

Commit

Permalink
Allow import of single boxes in MOT format (cvat-ai#1764)
Browse files Browse the repository at this point in the history
* Allow single boxes in MOT format

* update changelog

Co-authored-by: Nikita Manovich <[email protected]>
  • Loading branch information
2 people authored and Fernando Martínez González committed Aug 3, 2020
1 parent 7b99c6b commit 8d78bb3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<https://github.com/opencv/cvat/pull/1683>)
- Better validation of labels and attributes in raw viewer (<https://github.com/opencv/cvat/pull/1727>)
- ClamAV antivirus integration (<https://github.com/opencv/cvat/pull/1712>)
- 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 (<https://github.com/opencv/cvat/pull/1571>)
Expand Down
11 changes: 11 additions & 0 deletions cvat/apps/dataset_manager/formats/mot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions cvat/apps/engine/tests/_test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 8d78bb3

Please sign in to comment.