From d6428ffd858fdbef067edfeccb0f2d5ae98df406 Mon Sep 17 00:00:00 2001 From: Zhiltsov Max Date: Tue, 8 Sep 2020 16:10:32 +0300 Subject: [PATCH 1/2] Fix cvat format import with frame step --- cvat/apps/dataset_manager/formats/cvat.py | 4 +++- cvat/apps/engine/tests/_test_rest_api.py | 13 ++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cvat/apps/dataset_manager/formats/cvat.py b/cvat/apps/dataset_manager/formats/cvat.py index ac5823b6f60..3c349947b76 100644 --- a/cvat/apps/dataset_manager/formats/cvat.py +++ b/cvat/apps/dataset_manager/formats/cvat.py @@ -442,7 +442,9 @@ def load(file_object, annotations): ) elif el.tag == 'image': image_is_opened = True - frame_id = match_dm_item(DatasetItem(id=el.attrib['id'], image=el.attrib['name']), annotations) + frame_id = annotations.abs_frame_id(match_dm_item( + DatasetItem(id=el.attrib['id'], image=el.attrib['name']), + annotations)) elif el.tag in supported_shapes and (track is not None or image_is_opened): attributes = [] shape = { diff --git a/cvat/apps/engine/tests/_test_rest_api.py b/cvat/apps/engine/tests/_test_rest_api.py index 1e773b2f3f0..374a4cd2e21 100644 --- a/cvat/apps/engine/tests/_test_rest_api.py +++ b/cvat/apps/engine/tests/_test_rest_api.py @@ -2082,7 +2082,14 @@ def _create_task(self, owner, assignee): "client_files[0]": generate_image_file("test_1.jpg")[1], "client_files[1]": generate_image_file("test_2.jpg")[1], "client_files[2]": generate_image_file("test_3.jpg")[1], + "client_files[4]": generate_image_file("test_4.jpg")[1], + "client_files[5]": generate_image_file("test_5.jpg")[1], + "client_files[6]": generate_image_file("test_6.jpg")[1], + "client_files[7]": generate_image_file("test_7.jpg")[1], + "client_files[8]": generate_image_file("test_8.jpg")[1], + "client_files[9]": generate_image_file("test_9.jpg")[1], "image_quality": 75, + "frame_filter": "step=3", } response = self.client.post("/api/v1/tasks/{}/data".format(tid), data=images) assert response.status_code == status.HTTP_202_ACCEPTED @@ -2202,7 +2209,7 @@ def _run_api_v1_jobs_id_annotations(self, owner, assignee, annotator): "occluded": False }, { - "frame": 1, + "frame": 2, "label_id": task["labels"][1]["id"], "group": None, "source": "manual", @@ -2239,7 +2246,7 @@ def _run_api_v1_jobs_id_annotations(self, owner, assignee, annotator): ] }, { - "frame": 1, + "frame": 2, "attributes": [], "points": [2.0, 2.1, 100, 300.222], "type": "rectangle", @@ -2256,7 +2263,7 @@ def _run_api_v1_jobs_id_annotations(self, owner, assignee, annotator): "attributes": [], "shapes": [ { - "frame": 1, + "frame": 2, "attributes": [], "points": [1.0, 2.1, 100, 300.222], "type": "rectangle", From 09c5da39f93037d723d8d481a110f21063cd8baa Mon Sep 17 00:00:00 2001 From: Zhiltsov Max Date: Tue, 8 Sep 2020 16:19:36 +0300 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 844cc02fe6f..c7f5e7a2548 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed multiple errors which arises when polygon is of length 5 or less () +- Fixed CVAT format import for frame stepped tasks () ### Security -