datumaro.plugins.data_formats.voc.format#

Module Attributes

LabelMapConfig

A type representing a label map config

Functions

generate_colormap([length])

make_voc_categories([label_map, task])

make_voc_label_map([task])

parse_label_map(path)

Parses a label map file in the format: 'name : color (r, g, b) : parts (hand, feet, ...) : actions (siting, standing, ...)'

parse_meta_file(path)

write_label_map(path, label_map)

write_meta_file(path, label_map)

Classes

VocAction(value)

An enumeration.

VocBodyPart(value)

An enumeration.

VocImporterType(value)

An enumeration.

VocLabel(value)

An enumeration.

VocPath()

VocPose(value)

An enumeration.

VocTask(value)

An enumeration.

class datumaro.plugins.data_formats.voc.format.VocTask(value)[source]#

Bases: Enum

An enumeration.

voc = 1#
voc_classification = 2#
voc_detection = 3#
voc_segmentation = 4#
voc_instance_segmentation = 5#
voc_action = 6#
voc_layout = 7#
class datumaro.plugins.data_formats.voc.format.VocLabel(value)[source]#

Bases: Enum

An enumeration.

background = 0#
aeroplane = 1#
bicycle = 2#
bird = 3#
boat = 4#
bottle = 5#
bus = 6#
car = 7#
cat = 8#
chair = 9#
cow = 10#
diningtable = 11#
dog = 12#
horse = 13#
motorbike = 14#
person = 15#
pottedplant = 16#
sheep = 17#
sofa = 18#
train = 19#
tvmonitor = 20#
ignored = 255#
class datumaro.plugins.data_formats.voc.format.VocPose(value)[source]#

Bases: Enum

An enumeration.

Unspecified = 1#
Left = 2#
Right = 3#
Frontal = 4#
Rear = 5#
class datumaro.plugins.data_formats.voc.format.VocBodyPart(value)[source]#

Bases: Enum

An enumeration.

head = 1#
hand = 2#
foot = 3#
class datumaro.plugins.data_formats.voc.format.VocAction(value)[source]#

Bases: Enum

An enumeration.

other = 1#
jumping = 2#
phoning = 3#
playinginstrument = 4#
reading = 5#
ridingbike = 6#
ridinghorse = 7#
running = 8#
takingphoto = 9#
usingcomputer = 10#
walking = 11#
datumaro.plugins.data_formats.voc.format.generate_colormap(length: int = 256) Dict[int, Tuple[int, int, int]][source]#
class datumaro.plugins.data_formats.voc.format.VocImporterType(value)[source]#

Bases: Enum

An enumeration.

default = 1#
roboflow = 2#
class datumaro.plugins.data_formats.voc.format.VocPath[source]#

Bases: object

IMAGES_DIR = 'JPEGImages'#
ANNOTATIONS_DIR = 'Annotations'#
SEGMENTATION_DIR = 'SegmentationClass'#
INSTANCES_DIR = 'SegmentationObject'#
SUBSETS_DIR = 'ImageSets'#
IMAGE_EXT = '.jpg'#
SEGM_EXT = '.png'#
LABELMAP_FILE = 'labelmap.txt'#
TASK_DIR = {VocTask.voc: 'Main', VocTask.voc_action: 'Action', VocTask.voc_classification: 'Main', VocTask.voc_detection: 'Main', VocTask.voc_instance_segmentation: 'Segmentation', VocTask.voc_layout: 'Layout', VocTask.voc_segmentation: 'Segmentation'}#
datumaro.plugins.data_formats.voc.format.LabelMapConfig#

A type representing a label map config

alias of Dict[str, Tuple[Optional[Tuple[int, int, int]], List[str], List[str]]]

datumaro.plugins.data_formats.voc.format.make_voc_label_map(task: VocTask | None = None) Dict[str, Tuple[Tuple[int, int, int] | None, List[str], List[str]]][source]#
datumaro.plugins.data_formats.voc.format.parse_label_map(path: str) Dict[str, Tuple[Tuple[int, int, int] | None, List[str], List[str]]][source]#

Parses a label map file in the format: ‘name : color (r, g, b) : parts (hand, feet, …) : actions (siting, standing, …)’

Parameters:

path – File path

Returns:

label -> (color, parts, actions)

Return type:

A dictionary

datumaro.plugins.data_formats.voc.format.parse_meta_file(path: str) Dict[str, Tuple[Tuple[int, int, int] | None, List[str], List[str]]][source]#
datumaro.plugins.data_formats.voc.format.write_label_map(path: str, label_map: Dict[str, Tuple[Tuple[int, int, int] | None, List[str], List[str]]])[source]#
datumaro.plugins.data_formats.voc.format.write_meta_file(path: str, label_map: Dict[str, Tuple[Tuple[int, int, int] | None, List[str], List[str]]])[source]#
datumaro.plugins.data_formats.voc.format.make_voc_categories(label_map: Dict[str, Tuple[Tuple[int, int, int] | None, List[str], List[str]]] | None = None, task: VocTask | None = VocTask.voc) Dict[AnnotationType, Categories][source]#