Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CVAT format import for frame stepped tasks #2151

Merged
merged 2 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<https://github.com/opencv/cvat/pull/2100>)
- Fixed CVAT format import for frame stepped tasks (<https://github.com/openvinotoolkit/cvat/pull/2151>)

### Security
-
Expand Down
4 changes: 3 additions & 1 deletion cvat/apps/dataset_manager/formats/cvat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
13 changes: 10 additions & 3 deletions cvat/apps/engine/tests/_test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down