class documentation

class OpenLABELAnnotations(object): (source)

View In Hierarchy

Annotations parsed from OpenLABEL format able to be converted to FiftyOne labels.

Method __init__ Undocumented
Method get_dimensions Get the width and height of a given URI or file id
Method get_labels Get the FiftyOne labels corresponding to the annotations of a given URI. The results are two dictionaries, sample- and frame-level, mapping field names to values and label objects.
Method parse_labels Parses a single OpenLABEL labels file.
Instance Variable metadata Undocumented
Instance Variable objects Undocumented
Instance Variable streams Undocumented
Method _parse_frames Undocumented
def __init__(self): (source)

Undocumented

def get_dimensions(self, file_id): (source)

Get the width and height of a given URI or file id

Parameters
file_idthe unique identifier to a media file
Returns
(width, height) of the given file
def get_labels(self, uri, label_types, frame_size, seg_type, skeleton=None, skeleton_key=None): (source)

Get the FiftyOne labels corresponding to the annotations of a given URI. The results are two dictionaries, sample- and frame-level, mapping field names to values and label objects.

Parameters
urithe unique identifier to a media file
label_typesa list of label types to load. The supported values are ("detections", "segmentations", "keypoints").
frame_sizethe (width, height) tuple for the media frame
seg_typethe SegmentationType to use for segmentation annotations
skeleton:Nonea fiftyone.core.odm.dataset.KeypointSkeleton to use as a reference when loading keypoints
skeleton_key:Nonethe name of the field in the OpenLABEL annotations containing the labels of keypoints matching the labels of the given skeleton
Returns
a dictionary of sample level fields and label objects and a dictionary of frame numbers to frame level fields and label objects
def parse_labels(self, base_dir, labels_path): (source)

Parses a single OpenLABEL labels file.

Parameters
base_dirpath to the directory containing the labels file
labels_pathpath to the labels json file
Returns
a list of potential file_ids that the parsed labels correspond to
metadata: dict = (source)

Undocumented

Undocumented

Undocumented

def _parse_frames(self, frames, label_file_id): (source)

Undocumented