datumaro.plugins.data_formats.datumaro_binary.mapper.annotation#

Classes

AnnotationListMapper()

AnnotationMapper()

BboxMapper()

CaptionMapper()

Cuboid2DMapper()

Cuboid3dMapper()

EllipseMapper()

LabelMapper()

MaskMapper()

PointsMapper()

PolyLineMapper()

PolygonMapper()

RleMaskMapper()

Just clone MaskMapper.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.AnnotationMapper[source]#

Bases: Mapper

ann_type = 0#
classmethod forward(ann: Annotation) bytes[source]#

Convert an object to bytes.

classmethod backward_dict(_bytes: bytes, offset: int = 0) Tuple[Dict, int][source]#
classmethod backward(_bytes: bytes, offset: int = 0) Tuple[Annotation, int][source]#

Build an object from bytes.

static forward_optional_label(label: int | None) int[source]#
static backward_optional_label(label: int) int | None[source]#
static parse_ann_type(_bytes: bytes, offset: int = 0) AnnotationType[source]#
class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.LabelMapper[source]#

Bases: AnnotationMapper

ann_type = 1#
classmethod forward(ann: Label) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.MaskMapper[source]#

Bases: AnnotationMapper

ann_type = 2#
classmethod forward(ann: Mask) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.RleMaskMapper[source]#

Bases: MaskMapper

Just clone MaskMapper.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.PointsMapper[source]#

Bases: _ShapeMapper

ann_type = 3#
classmethod forward(ann: Points) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.PolyLineMapper[source]#

Bases: _ShapeMapper

ann_type = 5#
classmethod forward(ann: PolyLine) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.PolygonMapper[source]#

Bases: _ShapeMapper

ann_type = 4#
classmethod forward(ann: Polygon) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.BboxMapper[source]#

Bases: _ShapeMapper

ann_type = 6#
classmethod forward(ann: Bbox) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.CaptionMapper[source]#

Bases: AnnotationMapper

ann_type = 7#
classmethod forward(ann: Caption) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.Cuboid3dMapper[source]#

Bases: AnnotationMapper

ann_type = 8#
classmethod forward(ann: Cuboid3d) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.EllipseMapper[source]#

Bases: _ShapeMapper

ann_type = 11#
classmethod forward(ann: Ellipse) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.Cuboid2DMapper[source]#

Bases: AnnotationMapper

ann_type = 16#
classmethod forward(ann: Shape) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.

class datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.AnnotationListMapper[source]#

Bases: Mapper

backward_map = {AnnotationType.label: <bound method LabelMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.LabelMapper'>>, AnnotationType.mask: <bound method MaskMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.MaskMapper'>>, AnnotationType.points: <bound method PointsMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.PointsMapper'>>, AnnotationType.polygon: <bound method PolygonMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.PolygonMapper'>>, AnnotationType.polyline: <bound method PolyLineMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.PolyLineMapper'>>, AnnotationType.bbox: <bound method BboxMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.BboxMapper'>>, AnnotationType.caption: <bound method CaptionMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.CaptionMapper'>>, AnnotationType.cuboid_3d: <bound method Cuboid3dMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.Cuboid3dMapper'>>, AnnotationType.ellipse: <bound method EllipseMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.EllipseMapper'>>, AnnotationType.cuboid_2d: <bound method Cuboid2DMapper.backward of <class 'datumaro.plugins.data_formats.datumaro_binary.mapper.annotation.Cuboid2DMapper'>>}#
classmethod forward(anns: List[Annotation]) bytes[source]#

Convert an object to bytes.

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

Build an object from bytes.