datumaro.plugins.data_formats.datumaro.page_mapper#

Classes

DatumPageMapper(path)

Construct page maps for items and annotations from the JSON file, which are used for the stream importer.

class datumaro.plugins.data_formats.datumaro.page_mapper.DatumPageMapper(path: str)[source]#

Bases: object

Construct page maps for items and annotations from the JSON file, which are used for the stream importer.

It also provides __iter__() to produce item and annotation dictionaries in stream manner after constructing the page map.

get_item_dict(item_key: str) Dict | None[source]#
iter_item_ids() Iterator[str][source]#
property dm_format_version: str | None#

Parse “dm_format_version” section from the given JSON file using the stream json parser

property media_type: MediaType | None#

Parse “media_type” section from the given JSON file using the stream json parser

property ann_types: Set[AnnotationType] | None#

Parse “media_type” section from the given JSON file using the stream json parser

property infos: Dict[str, Any]#

Parse “infos” section from the given JSON file using the stream json parser

property categories: Dict[str, Any]#

Parse “categories” section from the given JSON file using the stream json parser

class datumaro.plugins.data_formats.datumaro.page_mapper.AnnotationType(value)[source]#

Bases: IntEnum

An enumeration.

unknown = 0#
label = 1#
mask = 2#
points = 3#
polygon = 4#
polyline = 5#
bbox = 6#
caption = 7#
cuboid_3d = 8#
super_resolution_annotation = 9#
depth_annotation = 10#
ellipse = 11#
hash_key = 12#
feature_vector = 13#
tabular = 14#
rotated_bbox = 15#
datumaro.plugins.data_formats.datumaro.page_mapper.DatumPageMapperImpl#

alias of DatumPageMapper

class datumaro.plugins.data_formats.datumaro.page_mapper.MediaType(value)[source]#

Bases: IntEnum

An enumeration.

NONE = 0#
MEDIA_ELEMENT = 1#
IMAGE = 2#
BYTE_IMAGE = 3#
VIDEO_FRAME = 4#
VIDEO = 5#
POINT_CLOUD = 6#
MULTIFRAME_IMAGE = 7#
ROI_IMAGE = 8#
MOSAIC_IMAGE = 9#
TABLE_ROW = 10#
property media: Type[MediaElement] | None#