Match image by name (instead of id) on CVAT upload (#1807)

* Match image by name (instead of id) on CVAT upload

* Use match_dm_item
main
Mathis Chenuet 6 years ago committed by GitHub
parent 5b9a1dc443
commit 4aa14e74dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,8 +9,10 @@ from collections import OrderedDict
from glob import glob
from tempfile import TemporaryDirectory
from cvat.apps.dataset_manager.bindings import match_dm_item
from cvat.apps.dataset_manager.util import make_zip_archive
from cvat.apps.engine.frame_provider import FrameProvider
from datumaro.components.extractor import DatasetItem
from datumaro.util.image import save_image
from .registry import exporter, importer
@ -432,7 +434,7 @@ def load(file_object, annotations):
)
elif el.tag == 'image':
image_is_opened = True
frame_id = int(el.attrib['id'])
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 = {
@ -555,4 +557,4 @@ def _import(src_file, task_data):
for p in anno_paths:
load(p, task_data)
else:
load(src_file, task_data)
load(src_file, task_data)

Loading…
Cancel
Save