module documentation

Utilities for interfacing with the ETA library.

Copyright 2017-2025, Voxel51, Inc.

Class ETAModel Wrapper for running an eta.core.learning.Model model.
Class ETAModelConfig Meta-config class that encapsulates the configuration of an eta.core.learning.Model that is to be run via the ETAModel wrapper.
Function from_attribute Creates a fiftyone.core.labels.Classification from an eta.core.data.Attribute.
Function from_attributes Creates a fiftyone.core.labels.Classifications from a list of attributes.
Function from_detected_object Creates a fiftyone.core.labels.Detection from an eta.core.objects.DetectedObject.
Function from_detected_objects Creates a fiftyone.core.labels.Detections from an eta.core.objects.DetectedObjectContainer.
Function from_image_labels Loads the eta.core.image.ImageLabels or eta.core.frames.FrameLabels into a dictionary of labels.
Function from_keypoint Creates a fiftyone.core.labels.Keypoint from an eta.core.keypoints.Keypoints.
Function from_keypoints Creates a fiftyone.core.labels.Keypoints from an eta.core.keypoints.KeypointsContainer.
Function from_polyline Creates a fiftyone.core.labels.Polyline from an eta.core.polylines.Polyline.
Function from_polylines Creates a fiftyone.core.labels.Polylines from an eta.core.polylines.PolylineContainer.
Function from_video_event Creates a fiftyone.core.labels.TemporalDetection from an eta.core.events.VideoEvent.
Function from_video_events Creates a fiftyone.core.labels.TemporalDetections from an eta.core.events.VideoEventContainer.
Function from_video_labels Loads the eta.core.video.VideoLabels into a frame labels dictionary.
Function to_attribute Returns an eta.core.data.Attribute representation of the fiftyone.core.labels.Classification.
Function to_detected_object Returns an eta.core.objects.DetectedObject representation of the given fiftyone.core.labels.Detection.
Function to_image_labels Converts the image label(s) to eta.core.image.ImageLabels format.
Function to_keypoints Returns an eta.core.keypoints.Keypoints representation of the given fiftyone.core.labels.Keypoint.
Function to_polyline Returns an eta.core.polylines.Polyline representation of the given fiftyone.core.labels.Polyline.
Function to_video_event Returns an eta.core.events.VideoEvent representation of the given fiftyone.core.labels.TemporalDetection.
Function to_video_labels Converts the given labels to eta.core.video.VideoLabels format.
Function _add_frame_labels Undocumented
Function _add_logits Undocumented
Function _add_video_labels Undocumented
Function _expand_with_labels_dict Undocumented
Function _expand_with_prefix Undocumented
Function _from_eta_attributes Undocumented
Function _from_eta_labels Undocumented
Function _squeeze_extra_unit_dims Undocumented
Function _to_eta_attributes Undocumented
Constant _IMAGE_MODELS Undocumented
Constant _VIDEO_MODELS Undocumented
def from_attribute(attr): (source)

Creates a fiftyone.core.labels.Classification from an eta.core.data.Attribute.

The attribute value is cast to a string, if necessary.

Parameters
attran eta.core.data.Attribute
Returns
a fiftyone.core.labels.Classification
def from_attributes(attrs, skip_non_categorical=False): (source)

Creates a fiftyone.core.labels.Classifications from a list of attributes.

Parameters
attrsan iterable of eta.core.data.Attribute instances
skip_non_categorical:Falsewhether to skip non-categorical attributes (True) or cast all attribute values to strings (False)
Returns
a fiftyone.core.labels.Classifications
def from_detected_object(dobj): (source)

Creates a fiftyone.core.labels.Detection from an eta.core.objects.DetectedObject.

Parameters
dobja eta.core.objects.DetectedObject
Returns
a fiftyone.core.labels.Detection
def from_detected_objects(objects): (source)

Creates a fiftyone.core.labels.Detections from an eta.core.objects.DetectedObjectContainer.

Parameters
objectsa eta.core.objects.DetectedObjectContainer
Returns
a fiftyone.core.labels.Detections
def from_image_labels(image_labels_or_path, prefix=None, labels_dict=None, multilabel=False, skip_non_categorical=False): (source)

Loads the eta.core.image.ImageLabels or eta.core.frames.FrameLabels into a dictionary of labels.

Provide labels_dict if you want to customize which components of the labels are expanded. Otherwise, all labels are expanded as explained below.

If multilabel is False, frame attributes will be stored in separate Classification fields with names prefix + attr.name.

If multilabel if True, all frame attributes will be stored in a Classifications field called prefix + "attributes".

Objects are expanded into fields with names prefix + obj.name, or prefix + "detections" for objects that do not have their name field populated.

Polylines are expanded into fields with names prefix + polyline.name, or prefix + "polylines" for polylines that do not have their name field populated.

Keypoints are expanded into fields with names prefix + keypoints.name, or prefix + "keypoints" for keypoints that do not have their name field populated.

Segmentation masks are expanded into a field with name prefix + "mask".

Parameters
image_labels_or_pathcan be a eta.core.image.ImageLabels instance, a eta.core.frames.FrameLabels instance, a serialized dict representation of either, or the path to either on disk
prefix:Nonea string prefix to prepend to each field name in the output dict
labels_dict:Nonea dictionary mapping names of labels to keys to assign them in the output dictionary
multilabel:Falsewhether to store attributes in a single Classifications instance
skip_non_categorical:Falsewhether to skip non-categorical attributes (True) or cast them to strings (False)
Returns
a dict mapping names to fiftyone.core.labels.Label instances
def from_keypoint(keypoints): (source)

Creates a fiftyone.core.labels.Keypoint from an eta.core.keypoints.Keypoints.

Parameters
keypointsan eta.core.keypoints.Keypoints
Returns
a fiftyone.core.labels.Keypoint
def from_keypoints(keypoints): (source)

Creates a fiftyone.core.labels.Keypoints from an eta.core.keypoints.KeypointsContainer.

Parameters
keypointsan eta.core.keypoints.KeypointsContainer
Returns
a fiftyone.core.labels.Keypoints
def from_polyline(polyline): (source)

Creates a fiftyone.core.labels.Polyline from an eta.core.polylines.Polyline.

Parameters
polylinean eta.core.polylines.Polyline
Returns
a fiftyone.core.labels.Polyline
def from_polylines(polylines): (source)

Creates a fiftyone.core.labels.Polylines from an eta.core.polylines.PolylineContainer.

Parameters
polylinesan eta.core.polylines.PolylineContainer
Returns
a fiftyone.core.labels.Polylines
def from_video_event(video_event): (source)

Creates a fiftyone.core.labels.TemporalDetection from an eta.core.events.VideoEvent.

Parameters
video_eventan eta.core.events.VideoEvent
Returns
a fiftyone.core.labels.TemporalDetection
def from_video_events(video_events): (source)

Creates a fiftyone.core.labels.TemporalDetections from an eta.core.events.VideoEventContainer.

Parameters
video_eventsan eta.core.events.VideoEventContainer
Returns
a fiftyone.core.labels.TemporalDetections
def from_video_labels(video_labels_or_path, prefix=None, labels_dict=None, frame_labels_dict=None, multilabel=False, skip_non_categorical=False): (source)

Loads the eta.core.video.VideoLabels into a frame labels dictionary.

Parameters
video_labels_or_pathcan be a eta.core.video.VideoLabels instance, a serialized dict representation of one, or the path to one on disk
prefix:Nonea string prefix to prepend to each label name in the expanded sample/frame label dictionaries
labels_dict:Nonea dictionary mapping names of attributes/objects in the sample labels to field names into which to expand them. By default, all sample labels are loaded
frame_labels_dict:Nonea dictionary mapping names of attributes/objects in the frame labels to field names into which to expand them. By default, all frame labels are loaded
multilabel:Falsewhether to store attributes in a single fiftyone.core.labels.Classifications instance
skip_non_categorical:Falsewhether to skip non-categorical attributes (True) or cast them to strings (False)
Returns
a tuple of
def to_attribute(classification, name=None): (source)

Returns an eta.core.data.Attribute representation of the fiftyone.core.labels.Classification.

Parameters
classificationa fiftyone.core.labels.Classification
name:Nonethe name of the label field
Returns
a eta.core.data.CategoricalAttribute
def to_detected_object(detection, name=None, extra_attrs=True): (source)

Returns an eta.core.objects.DetectedObject representation of the given fiftyone.core.labels.Detection.

Parameters
detectiona fiftyone.core.labels.Detection
name:Nonethe name of the label field
extra_attrs:Truewhether to include custom attributes in the conversion
Returns
an eta.core.objects.DetectedObject
def to_image_labels(labels, warn_unsupported=True): (source)

Converts the image label(s) to eta.core.image.ImageLabels format.

Parameters
labelsa fiftyone.core.labels.Label instance or a dict mapping names to fiftyone.core.labels.Label instances
warn_unsupported:Truewhether to issue warnings if unsupported label values are encountered
Returns
an eta.core.image.ImageLabels instance
def to_keypoints(keypoint, name=None, extra_attrs=True): (source)

Returns an eta.core.keypoints.Keypoints representation of the given fiftyone.core.labels.Keypoint.

Parameters
keypointa fiftyone.core.labels.Keypoint
name:Nonethe name of the label field
extra_attrs:Truewhether to include custom attributes in the conversion
Returns
an eta.core.keypoints.Keypoints
def to_polyline(polyline, name=None, extra_attrs=True): (source)

Returns an eta.core.polylines.Polyline representation of the given fiftyone.core.labels.Polyline.

Parameters
polylinea fiftyone.core.labels.Polyline
name:Nonethe name of the label field
extra_attrs:Truewhether to include custom attributes in the conversion
Returns
an eta.core.polylines.Polyline
def to_video_event(temporal_detection, name=None, extra_attrs=True): (source)

Returns an eta.core.events.VideoEvent representation of the given fiftyone.core.labels.TemporalDetection.

Parameters
temporal_detectiona fiftyone.core.labels.TemporalDetection
name:Nonethe name of the label field
extra_attrs:Truewhether to include custom attributes in the conversion
Returns
an eta.core.events.VideoEvent
def to_video_labels(label=None, frames=None, support=None, warn_unsupported=True): (source)

Converts the given labels to eta.core.video.VideoLabels format.

Parameters
label:Nonevideo-level labels provided as a fiftyone.core.labels.Label instance or dict mapping field names to fiftyone.core.labels.Label instances
frames:Noneframe-level labels provided as a dict mapping frame numbers to dicts mapping field names to fiftyone.core.labels.Label instances
support:Nonean optional [first, last] support to store on the returned labels
warn_unsupported:Truewhether to issue warnings if unsupported label values are encountered
Returns
a eta.core.video.VideoLabels
def _add_frame_labels(frame_labels, labels, warn_unsupported=True): (source)

Undocumented

def _add_logits(label, logits): (source)

Undocumented

def _add_video_labels(video_labels, labels, warn_unsupported=True): (source)

Undocumented

def _expand_with_labels_dict(video_or_frame_labels, labels_dict, multilabel, skip_non_categorical): (source)

Undocumented

def _expand_with_prefix(video_or_frame_labels, prefix, multilabel, skip_non_categorical): (source)

Undocumented

def _from_eta_attributes(attrs): (source)

Undocumented

def _from_eta_labels(eta_labels): (source)

Undocumented

def _squeeze_extra_unit_dims(embeddings): (source)

Undocumented

def _to_eta_attributes(label, extra_attrs=True, warn_unsupported=True): (source)

Undocumented

_IMAGE_MODELS = (source)

Undocumented

Value
(etal.ImageModel,
 etal.ImageClassifier,
 etal.ObjectDetector,
 etal.ImageSemanticSegmenter)
_VIDEO_MODELS = (source)

Undocumented

Value
(etal.VideoModel,
 etal.VideoClassifier,
 etal.VideoObjectDetector,
 etal.VideoEventDetector,
 etal.VideoSemanticSegmenter)