|
|
|
|
@ -14,6 +14,7 @@ from cvat.apps.engine.frame_provider import FrameProvider
|
|
|
|
|
from cvat.apps.engine.models import AttributeType, ShapeType
|
|
|
|
|
from datumaro.util import cast
|
|
|
|
|
from datumaro.util.image import ByteImage, Image
|
|
|
|
|
from datumaro.components.extractor import DatasetItem
|
|
|
|
|
|
|
|
|
|
from .annotation import AnnotationManager, TrackManager
|
|
|
|
|
|
|
|
|
|
@ -611,7 +612,7 @@ def match_dm_item(item, task_data, root_hint=None):
|
|
|
|
|
if frame_number is None and item.has_image:
|
|
|
|
|
frame_number = task_data.match_frame(item.id + item.image.ext, root_hint)
|
|
|
|
|
if frame_number is None:
|
|
|
|
|
frame_number = task_data.match_frame(item.id + '.', root_hint)
|
|
|
|
|
frame_number = task_data.match_frame(item.id, root_hint)
|
|
|
|
|
if frame_number is None:
|
|
|
|
|
frame_number = cast(item.attributes.get('frame', item.id), int)
|
|
|
|
|
if frame_number is None and is_video:
|
|
|
|
|
@ -651,7 +652,7 @@ def import_dm_annotations(dm_dataset, task_data):
|
|
|
|
|
|
|
|
|
|
for item in dm_dataset:
|
|
|
|
|
frame_number = task_data.abs_frame_id(
|
|
|
|
|
match_dm_item(item, task_data, root_hint=root_hint))
|
|
|
|
|
match_dm_item(DatasetItem(id=item.id + '.'), task_data, root_hint=root_hint))
|
|
|
|
|
|
|
|
|
|
# do not store one-item groups
|
|
|
|
|
group_map = {0: 0}
|
|
|
|
|
|