datumaro.plugins.data_formats.datumaro_binary.mapper.media#

Classes

ImageMapper()

MediaElementMapper()

MediaMapper()

PointCloudMapper()

VideoFrameMapper()

VideoMapper()

class datumaro.plugins.data_formats.datumaro_binary.mapper.media.MediaMapper[source]#

Bases: Mapper

classmethod forward(obj: MediaElement | None) bytes[source]#

Convert an object to bytes.

classmethod backward(_bytes: bytes, offset: int = 0, media_path_prefix: Dict[MediaType, str] | None = None) Tuple[MediaElement | None, int][source]#

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.media.MediaElementMapper[source]#

Bases: Mapper

MAGIC_PATH = '/NOT/A/REAL/PATH'#
MEDIA_TYPE = 1#
classmethod forward(obj: MediaElement) bytes[source]#

Convert an object to bytes.

classmethod backward_dict(_bytes: bytes, offset: int = 0, media_path_prefix: Dict[MediaType, str] | None = None) Tuple[Dict, int][source]#
classmethod backward(_bytes: bytes, offset: int = 0, media_path_prefix: Dict[MediaType, str] | None = None) Tuple[MediaElement, int][source]#

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.media.ImageMapper[source]#

Bases: MediaElementMapper

MAGIC_SIZE_FOR_NONE = (-1583, -1597)#
MEDIA_TYPE = 2#
classmethod forward(obj: Image) bytes[source]#

Convert an object to bytes.

classmethod backward(_bytes: bytes, offset: int = 0, media_path_prefix: Dict[MediaType, str] | None = None) Tuple[Image, int][source]#

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.media.VideoMapper[source]#

Bases: MediaElementMapper

MAGIC_END_FRAME_FOR_NONE = 4294967295#
MEDIA_TYPE = 5#
classmethod forward(obj: Video) bytes[source]#

Convert an object to bytes.

classmethod backward(_bytes: bytes, offset: int = 0, media_path_prefix: Dict[MediaType, str] | None = None) Tuple[Video, int][source]#

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.media.VideoFrameMapper[source]#

Bases: MediaElementMapper

MEDIA_TYPE = 4#
classmethod forward(obj: VideoFrame) bytes[source]#

Convert an object to bytes.

classmethod backward(_bytes: bytes, offset: int = 0, media_path_prefix: Dict[MediaType, str] | None = None) Tuple[VideoFrame, int][source]#

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.media.PointCloudMapper[source]#

Bases: MediaElementMapper

MEDIA_TYPE = 6#
classmethod forward(obj: PointCloud) bytes[source]#

Convert an object to bytes.

classmethod backward(_bytes: bytes, offset: int = 0, media_path_prefix: Dict[MediaType, str] | None = None) Tuple[PointCloud, int][source]#

Build an object from bytes.