未验证 提交 0b7fb04a 编写于 作者: ftmagician's avatar ftmagician 提交者: GitHub

fix pascal_voc import bug (#4647)

* fix  pascal_voc import bug

* Add tests

* Fix black

* Small fixes

* Fix test

* Fix black

* Update Changelog

* Fix Changelog

* Fixes

* Remove unnecessary changes

* Remove unnecessary changes

* Join tests

* Small fix

* Fixes

* Fix pylint

* Remove unused import

* Small fix
Co-authored-by: Nyasakova-anastasia <yasakova_anastasiya@mail.ru>
上级 ba74709c
......@@ -64,6 +64,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
- Extra rerenders of different pages with each click (<https://github.com/opencv/cvat/pull/5178>)
- Skeleton points exported out of order in the COCO Keypoints format
(<https://github.com/opencv/cvat/issues/5048>)
- PASCAL VOC 1.1 can't import dataset (<https://github.com/opencv/cvat/pull/4647>)
- Changing an object causes current z layer to be set to the maximum (<https://github.com/opencv/cvat/pull/5145>)
- Job assignee can not resolve an issue (<https://github.com/opencv/cvat/pull/5167>)
- Create manifest with cvat/server docker container command (<https://github.com/opencv/cvat/pull/5172>)
......
......@@ -1895,6 +1895,9 @@ def load_dataset_data(project_annotation, dataset: dm.Dataset, project_data):
else:
for label in dataset.categories()[dm.AnnotationType.label].items:
if not project_annotation.db_project.label_set.filter(name=label.name).exists():
if label.name == "background":
dataset.transform("remap_labels", mapping={"background": ""}, default="keep")
continue
raise CvatImportError(f'Target project does not have label with name "{label.name}"')
for subset_id, subset in enumerate(dataset.subsets().values()):
job = rq.get_current_job()
......
......@@ -458,10 +458,11 @@ class TestImportExportDatasetProject:
)
assert response.status == HTTPStatus.ACCEPTED
@pytest.mark.parametrize("format_name", ("ImageNet 1.0", "Datumaro 1.0"))
@pytest.mark.parametrize("format_name", ("Datumaro 1.0", "ImageNet 1.0", "PASCAL VOC 1.1"))
def test_can_import_export_dataset_with_some_format(self, format_name):
# https://github.com/opencv/cvat/issues/4410
# https://github.com/opencv/cvat/issues/4850
# https://github.com/opencv/cvat/issues/4621
username = "admin1"
project_id = 4
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册