Constructor

ImageSpace(image, model="clip-ViT-B-32", model_cache_dir=None, model_handler=ModelHandler.SENTENCE_TRANSFORMERS, embedding_engine_config=None)
Initialize the ImageSpace instance for generating vector representations from images, supporting models from the OpenCLIP project.

Parameters

image
Blob | DescribedBlob | Sequence[Blob | DescribedBlob]
required
The image content as a Blob or DescribedBlob (write image+description), or a sequence of them.
model
str
default:"clip-ViT-B-32"
The model identifier for generating image embeddings. Defaults to “clip-ViT-B-32”.
model_handler
ModelHandler
default:"ModelHandler.SENTENCE_TRANSFORMERS"
The handler for the model, defaults to ModelHandler.SENTENCE_TRANSFORMERS.
model_cache_dir
Path | None
default:"None"
Directory to cache downloaded models. If None, uses the default cache directory. Defaults to None.
embedding_engine_config
EmbeddingEngineConfig | None
default:"None"
Configuration for the embedding engine. Defaults to EmbeddingEngineConfig().
Raises: InvalidInputException - If the image and description fields are not from the same schema.

Inheritance

Inheritance Chain:
  • ImageSpace
  • Space
  • HasTransformationConfig
  • HasLength
  • Generic
  • ABC

Properties

transformation_config
TransformationConfig[Vector, ImageData]
Configuration for transforming image data into vectors.