|
|
|
@ -268,6 +268,8 @@ class TaskData:
|
|
|
|
for shape in sorted(anno_manager.to_shapes(self._db_task.data.size),
|
|
|
|
for shape in sorted(anno_manager.to_shapes(self._db_task.data.size),
|
|
|
|
key=lambda shape: shape.get("z_order", 0)):
|
|
|
|
key=lambda shape: shape.get("z_order", 0)):
|
|
|
|
if 'track_id' in shape:
|
|
|
|
if 'track_id' in shape:
|
|
|
|
|
|
|
|
if shape['outside']:
|
|
|
|
|
|
|
|
continue
|
|
|
|
exported_shape = self._export_tracked_shape(shape)
|
|
|
|
exported_shape = self._export_tracked_shape(shape)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
exported_shape = self._export_labeled_shape(shape)
|
|
|
|
exported_shape = self._export_labeled_shape(shape)
|
|
|
|
@ -449,10 +451,9 @@ class TaskData:
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
class CvatTaskDataExtractor(datumaro.SourceExtractor):
|
|
|
|
class CvatTaskDataExtractor(datumaro.SourceExtractor):
|
|
|
|
def __init__(self, task_data, include_images=False, include_outside=False):
|
|
|
|
def __init__(self, task_data, include_images=False):
|
|
|
|
super().__init__()
|
|
|
|
super().__init__()
|
|
|
|
self._categories = self._load_categories(task_data)
|
|
|
|
self._categories = self._load_categories(task_data)
|
|
|
|
self._include_outside = include_outside
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dm_items = []
|
|
|
|
dm_items = []
|
|
|
|
|
|
|
|
|
|
|
|
@ -568,9 +569,6 @@ class CvatTaskDataExtractor(datumaro.SourceExtractor):
|
|
|
|
anno_attr['track_id'] = shape_obj.track_id
|
|
|
|
anno_attr['track_id'] = shape_obj.track_id
|
|
|
|
anno_attr['keyframe'] = shape_obj.keyframe
|
|
|
|
anno_attr['keyframe'] = shape_obj.keyframe
|
|
|
|
|
|
|
|
|
|
|
|
if not self._include_outside and shape_obj.outside:
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
anno_points = shape_obj.points
|
|
|
|
anno_points = shape_obj.points
|
|
|
|
if shape_obj.type == ShapeType.POINTS:
|
|
|
|
if shape_obj.type == ShapeType.POINTS:
|
|
|
|
anno = datumaro.Points(anno_points,
|
|
|
|
anno = datumaro.Points(anno_points,
|
|
|
|
|