class documentation
class ZeroShotTransformerEmbeddingsMixin(EmbeddingsMixin): (source)
Known subclasses: fiftyone.utils.transformers.FiftyOneZeroShotTransformer
Mixin for Transformers that can generate embeddings.
Method | embed |
Generates an embedding for the given data. |
Method | embed |
Generates embeddings for the given iterable of data. |
Property | has |
Whether this instance has embeddings. |
Method | _embed |
Undocumented |
Inherited from EmbeddingsMixin
:
Method | get |
Returns the embeddings generated by the last forward pass of the model. |
Generates an embedding for the given data.
Subclasses can override this method to increase efficiency, but, by
default, this method simply calls predict
and then returns
get_embeddings
.
Parameters | |
arg | the data. See predict for details |
Returns | |
a numpy array containing the embedding |
Generates embeddings for the given iterable of data.
Subclasses can override this method to increase efficiency, but, by
default, this method simply iterates over the data and applies
embed
to each.
Parameters | |
args | an iterable of data. See predict_all for details |
Returns | |
a numpy array containing the embeddings stacked along axis 0 |