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 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

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#