FiftyOne models.
Class |
|
Mixin for Model classes that can generate embeddings for their predictions. |
Class |
|
Mixin for Model classes that can generate logits for their predictions. |
Class |
|
Abstract base class for models. |
Class |
|
Base configuration class that encapsulates the name of a Model and an instance of its associated Config class. |
Class |
|
Class for downloading FiftyOne models from the web. |
Class |
|
Config settings for a ModelManager . |
Class |
|
Mixin for Model classes that can generate prompt embeddings. |
Class |
|
Mixin for Model classes that need samples for prediction. |
Class |
|
Mixin for Model classes that support feeding data for inference via a torch:torch.utils.data.DataLoader . |
Function | apply |
Applies the model to the samples in the collection. |
Function | compute |
Computes embeddings for the samples in the collection using the given model. |
Function | compute |
Computes embeddings for the image patches defined by patches_field of the samples in the collection using the given model. |
Function | load |
Loads the model specified by the given ModelConfig dict. |
Variable | foue |
Undocumented |
Variable | fouf |
Undocumented |
Variable | foui |
Undocumented |
Variable | foup |
Undocumented |
Variable | fous |
Undocumented |
Variable | fout |
Undocumented |
Variable | foutr |
Undocumented |
Variable | fouu |
Undocumented |
Variable | logger |
Undocumented |
Variable | tud |
Undocumented |
Function | _apply |
Undocumented |
Function | _apply |
Undocumented |
Function | _apply |
Undocumented |
Function | _apply |
Undocumented |
Function | _apply |
Undocumented |
Function | _apply |
Undocumented |
Function | _compute |
Undocumented |
Function | _compute |
Undocumented |
Function | _compute |
Undocumented |
Function | _compute |
Undocumented |
Function | _compute |
Undocumented |
Function | _compute |
Undocumented |
Function | _convert |
Undocumented |
Function | _do |
Undocumented |
Function | _embed |
Undocumented |
Function | _embed |
Undocumented |
Function | _embed |
Undocumented |
Function | _embed |
Undocumented |
Function | _embed |
Undocumented |
Function | _export |
Undocumented |
Function | _get |
Undocumented |
Function | _is |
Undocumented |
Function | _is |
Undocumented |
Function | _is |
Undocumented |
Function | _is |
Undocumented |
Function | _iter |
Undocumented |
Function | _make |
Undocumented |
Function | _make |
Undocumented |
Function | _make |
Undocumented |
Function | _merge |
Undocumented |
Function | _parse |
Undocumented |
Constant | _ALLOWED |
Undocumented |
Applies the model to the samples in the collection.
This method supports all of the following cases:
- Applying an image model to an image collection
- Applying an image model to the frames of a video collection
- Applying a video model to a video collection
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
model | a Model , Hugging Face Transformers model, Ultralytics
model, SuperGradients model, or Lightning Flash model |
label | the name of the field in which to store the model predictions. When performing inference on video frames, the "frames." prefix is optional |
confidenceNone | an optional confidence threshold to apply to any applicable labels generated by the model |
storeFalse | whether to store logits for the model predictions. This is only supported when the provided model has logits, model.has_logits == True |
batchNone | an optional batch size to use, if the model supports batching |
numNone | the number of workers to use when loading images. Only applicable for Torch-based models |
skipTrue | whether to gracefully continue without raising an
error if predictions cannot be generated for a sample. Only
applicable to Model instances |
outputNone | an optional output directory in which to write segmentation images. Only applicable if the model generates segmentations. If none is provided, the segmentations are stored in the database |
relNone | an optional relative directory to strip from each input
filepath to generate a unique identifier that is joined with
output_dir to generate an output path for each segmentation
image. This argument allows for populating nested subdirectories in
output_dir that match the shape of the input paths. The path is
converted to an absolute path (if necessary) via
fiftyone.core.storage.normalize_path |
progress:None | whether to render a progress bar (True/False), use the default value fiftyone.config.show_progress_bars (None), or a progress callback function to invoke instead |
**kwargs | optional model-specific keyword arguments passed through to the underlying inference implementation |
Computes embeddings for the samples in the collection using the given model.
This method supports all the following cases:
- Using an image model to compute embeddings for an image collection
- Using an image model to compute frame embeddings for a video collection
- Using a video model to compute embeddings for a video collection
The model must expose embeddings, i.e., Model.has_embeddings
must return True.
If an embeddings_field is provided, the embeddings are saved to the samples; otherwise, the embeddings are returned in-memory.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
model | a Model , Hugging Face Transformers model, Ultralytics
model, SuperGradients model, or Lightning Flash model |
embeddingsNone | the name of a field in which to store the embeddings. When computing video frame embeddings, the "frames." prefix is optional |
batchNone | an optional batch size to use, if the model supports batching |
numNone | the number of workers to use when loading images. Only applicable for Torch-based models |
skipTrue | whether to gracefully continue without raising an
error if embeddings cannot be generated for a sample. Only
applicable to Model instances |
progress:None | whether to render a progress bar (True/False), use the default value fiftyone.config.show_progress_bars (None), or a progress callback function to invoke instead |
**kwargs | optional model-specific keyword arguments passed through to the underlying inference implementation |
Returns | |
one of the following |
|
Computes embeddings for the image patches defined by patches_field of the samples in the collection using the given model.
This method supports all the following cases:
- Using an image model to compute patch embeddings for an image collection
- Using an image model to compute frame patch embeddings for a video collection
The model must expose embeddings, i.e., Model.has_embeddings
must return True.
If an embeddings_field is provided, the embeddings are saved to the samples; otherwise, the embeddings are returned in-memory.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
model | a Model , Hugging Face Transformers model, Ultralytics
model, SuperGradients model, or Lightning Flash model |
patches | the name of the field defining the image patches in each
sample to embed. Must be of type
fiftyone.core.labels.Detection ,
fiftyone.core.labels.Detections ,
fiftyone.core.labels.Polyline , or
fiftyone.core.labels.Polylines . When computing video frame
embeddings, the "frames." prefix is optional |
embeddingsNone | the name of a label attribute in which to store the embeddings |
forceFalse | whether to minimally manipulate the patch bounding boxes into squares prior to extraction |
alpha:None | an optional expansion/contraction to apply to the patches before extracting them, in [-1, inf). If provided, the length and width of the box are expanded (or contracted, when alpha < 0) by (100 * alpha)%. For example, set alpha = 0.1 to expand the boxes by 10%, and set alpha = -0.1 to contract the boxes by 10% |
handle | how to handle images with no patches. Supported values are:
|
batchNone | an optional batch size to use, if the model supports batching |
numNone | the number of workers to use when loading images. Only applicable for Torch models |
skipTrue | whether to gracefully continue without raising an error if embeddings cannot be generated for a sample |
progress:None | whether to render a progress bar (True/False), use the default value fiftyone.config.show_progress_bars (None), or a progress callback function to invoke instead |
Returns | |
one of the following |
|
Loads the model specified by the given ModelConfig
dict.
Parameters | |
model | a ModelConfig dict |
modelNone | an optional model path to inject into the model_path field of the model's Config instance, which must implement the eta.core.learning.HasPublishedModel interface. This is useful when working with a model whose weights are stored locally and do not need to be downloaded |
**kwargs | optional keyword arguments to inject into the model's Config instance |
Returns | |
a Model instance |
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented