Skip to content

Commit

Permalink
Allow single boxes in MOT format
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max committed Jun 19, 2020
1 parent fcadefa commit e232ac2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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 e232ac2

Please sign in to comment.