class documentation

FiftyOne wrapper around a transformers model.

Parameters
configa FiftyOneTransformerConfig
Method __init__ Undocumented
Method predict Performs prediction on the given data.
Instance Variable config Undocumented
Instance Variable device Undocumented
Instance Variable image_processor Undocumented
Instance Variable model Undocumented
Property media_type The media type processed by the model.
Property preprocess Whether to apply transforms during inference (True) or to assume that they have already been applied (False).
Property ragged_batches True/False whether transforms may return tensors of different sizes. If True, then passing ragged lists of data to predict_all is not allowed.
Property transforms The preprocessing function that will/must be applied to each input before prediction, or None if no preprocessing is performed.
Method _load_image_processor Undocumented
Method _load_model Undocumented

Inherited from TransformerEmbeddingsMixin:

Method embed Generates an embedding for the given data.
Method embed_all Generates embeddings for the given iterable of data.
Property has_embeddings Whether this instance has embeddings.
Method _embed Undocumented

Inherited from EmbeddingsMixin (via TransformerEmbeddingsMixin):

Method get_embeddings Returns the embeddings generated by the last forward pass of the model.

Inherited from Model (via TransformerEmbeddingsMixin, EmbeddingsMixin):

Method __enter__ Undocumented
Method __exit__ Undocumented
Method predict_all Performs prediction on the given iterable of data.
Method preprocess.setter Undocumented
Property can_embed_prompts Whether this instance can generate prompt embeddings.
Property has_logits Whether this instance can generate logits for its predictions.
def __init__(self, config): (source)

Undocumented

def predict(self, arg): (source)

Performs prediction on the given data.

Image models should support, at minimum, processing arg values that are uint8 numpy arrays (HWC).

Video models should support, at minimum, processing arg values that are eta.core.video.VideoReader instances.

Parameters
argthe data
Returns
a fiftyone.core.labels.Label instance or dict of fiftyone.core.labels.Label instances containing the predictions

Undocumented

Undocumented

image_processor = (source)

Undocumented

Undocumented

The media type processed by the model.

Supported values are "image" and "video".

Whether to apply transforms during inference (True) or to assume that they have already been applied (False).

@property
ragged_batches = (source)

True/False whether transforms may return tensors of different sizes. If True, then passing ragged lists of data to predict_all is not allowed.

The preprocessing function that will/must be applied to each input before prediction, or None if no preprocessing is performed.

def _load_image_processor(self): (source)

Undocumented