class documentation

class OpenLABELObjects(OpenLABELGroup): (source)

View In Hierarchy

A collection of OpenLABELObject and corresponding utility methods.

Method add_object Adds an OpenLABELObject to this collection.
Method get_objects Gets any objects that correspond to an info in the given stream infos.
Method parse_objects_dict Parses the OpenLABEL annotations corresponding to a specific dictionary of objects.
Method to_labels Converts the stored OpenLABELObject to FiftyOne labels.
Property all_objects A list of OpenLABELObject instances in this collection.
Property streams Get streams corresponding to any object in this collection.
Method _get_filtered_object Undocumented
Property _element_type Undocumented

Inherited from OpenLABELGroup:

Method __init__ Undocumented
Class Method _get_element_id Undocumented
Class Method _get_label_file_id Undocumented
Method _add_element_dict Parses the given raw stream dictionary.
Method _parse_group_dict Undocumented
Instance Variable _element_id_to_element Undocumented
Instance Variable _keys_by_label_file_id Undocumented
def add_object(self, obj_key, label_file_id, obj): (source)

Adds an OpenLABELObject to this collection.

Parameters
obj_keythe name of the object in the OpenLABEL annotations
label_file_idthe filename of the annotations file containing this label
objthe OpenLABELObject to add
def get_objects(self, stream_infos): (source)

Gets any objects that correspond to an info in the given stream infos.

Parameters
stream_infosa OpenLABELStreamInfos used to get corresponding objects
Returns
an OpenLABELObjects with objects that correspond to any of the given stream infos
def parse_objects_dict(self, objects_dict, label_file_id, frame_number=None): (source)

Parses the OpenLABEL annotations corresponding to a specific dictionary of objects.

Parameters
objects_dictthe dict of OpenLABEL object annotations
label_file_idthe name of the annotations file containing these objects
frame_number:Nonean optional frame that this objects_dict is in
def to_labels(self, frame_size, label_types, seg_type, stream_infos, skeleton=None, skeleton_key=None): (source)

Converts the stored OpenLABELObject to FiftyOne labels.

Parameters
frame_sizethe size of the image frame in pixels (width, height)
label_typesa list of label types to load
seg_typethe SegmentationType to use to store segmentations
stream_infosthe OpenLABELStreamInfos containing sample-level attributes to parse into labels
skeleton:Nonea fiftyone.core.odm.dataset.KeypointSkeleton to use when loading keypoint annotations
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
@property
all_objects = (source)

A list of OpenLABELObject instances in this collection.

Get streams corresponding to any object in this collection.

def _get_filtered_object(self, obj_id, stream_info): (source)

Undocumented