From 4f0652fc119b4a7b3878903f52ff03f5fa726779 Mon Sep 17 00:00:00 2001 From: Anastasia Yasakova Date: Fri, 14 May 2021 13:32:20 +0300 Subject: [PATCH] Fix duplicate points in polygons at upload CVAT for video (#3187) * changed copy to deepcopy, modified the test * fixed number of points in polygon --- cvat/apps/dataset_manager/annotation.py | 2 +- cvat/apps/dataset_manager/tests/test_formats.py | 2 +- cvat/apps/engine/tests/test_rest_api.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cvat/apps/dataset_manager/annotation.py b/cvat/apps/dataset_manager/annotation.py index 391b26bf..f8e7522a 100644 --- a/cvat/apps/dataset_manager/annotation.py +++ b/cvat/apps/dataset_manager/annotation.py @@ -754,7 +754,7 @@ class TrackManager(ObjectManager): break if not prev_shape["outside"]: - shape = copy(prev_shape) + shape = deepcopy(prev_shape) shape["frame"] = end_frame shapes.extend(interpolate(prev_shape, shape)) diff --git a/cvat/apps/dataset_manager/tests/test_formats.py b/cvat/apps/dataset_manager/tests/test_formats.py index 2a7c40cd..ddae97cf 100644 --- a/cvat/apps/dataset_manager/tests/test_formats.py +++ b/cvat/apps/dataset_manager/tests/test_formats.py @@ -824,7 +824,7 @@ class TaskAnnotationsImportTest(_DbTestBase): { "frame": 0, "attributes": [], - "points": [1.0, 2.1, 100, 300.222], + "points": [1.0, 2.1, 10.6, 53.22, 100, 300.222], "type": "polygon", "occluded": False, "outside": False diff --git a/cvat/apps/engine/tests/test_rest_api.py b/cvat/apps/engine/tests/test_rest_api.py index 01b85641..c55e70d3 100644 --- a/cvat/apps/engine/tests/test_rest_api.py +++ b/cvat/apps/engine/tests/test_rest_api.py @@ -4044,7 +4044,7 @@ class TaskAnnotationAPITestCase(JobAnnotationAPITestCase): "points": [1.0, 2.1, 51, 36.6, 8.0, 11.0], "type": "polygon", "occluded": False, - "outside": False + "outside": True }, { "frame": 2, @@ -4052,7 +4052,7 @@ class TaskAnnotationAPITestCase(JobAnnotationAPITestCase): "points": [1.0, 2.1, 51, 36.6, 14.0, 15.0], "type": "polygon", "occluded": False, - "outside": True, + "outside": False, } ] }]