From 8cbe3956a3d63efa6d022413c9704fb339c5e139 Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Fri, 4 Sep 2020 11:03:35 +0300 Subject: [PATCH] Fix cvat format (#2071) --- cvat/apps/dataset_manager/formats/cvat.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cvat/apps/dataset_manager/formats/cvat.py b/cvat/apps/dataset_manager/formats/cvat.py index 962138c7..ac5823b6 100644 --- a/cvat/apps/dataset_manager/formats/cvat.py +++ b/cvat/apps/dataset_manager/formats/cvat.py @@ -398,8 +398,9 @@ def dump_as_cvat_interpolation(file_object, annotations): z_order=shape.z_order, frame=shape.frame, attributes=shape.attributes, - ), - annotations.TrackedShape( + )] + + ( # add a finishing frame if it does not hop over the last frame + [annotations.TrackedShape( type=shape.type, points=shape.points, occluded=shape.occluded, @@ -408,8 +409,10 @@ def dump_as_cvat_interpolation(file_object, annotations): z_order=shape.z_order, frame=shape.frame + annotations.frame_step, attributes=shape.attributes, + )] if shape.frame + annotations.frame_step < \ + int(annotations.meta['task']['stop_frame']) \ + else [] ), - ], )) counter += 1