datumaro.plugins.data_formats.datumaro_binary.mapper.common#

Classes

DictMapper()

FloatListMapper()

IntListMapper()

ListMapper()

Mapper()

StringMapper()

class datumaro.plugins.data_formats.datumaro_binary.mapper.common.Mapper[source]#

Bases: ABC

abstract static forward(obj: Any) bytes[source]#

Convert an object to bytes.

abstract static backward(_bytes: bytes, offset: int = 0) Tuple[Any, int][source]#

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.common.StringMapper[source]#

Bases: Mapper

static forward(obj: str) bytes[source]#

Convert an object to bytes.

static backward(_bytes: bytes, offset: int = 0) Tuple[str, int][source]#

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.common.ListMapper[source]#

Bases: Mapper

classmethod forward(obj: List[Any]) bytes[source]#

Convert an object to bytes.

classmethod backward(_bytes: bytes, offset: int = 0) Tuple[List[Any], int][source]#

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.common.IntListMapper[source]#

Bases: ListMapper

class datumaro.plugins.data_formats.datumaro_binary.mapper.common.FloatListMapper[source]#

Bases: ListMapper

class datumaro.plugins.data_formats.datumaro_binary.mapper.common.DictMapper[source]#

Bases: Mapper

static forward(obj: Dict[str, Any]) bytes[source]#

Convert an object to bytes.

static backward(_bytes: bytes, offset: int = 0) Tuple[Dict[str, Any], int][source]#

Build an object from bytes.