torch_frame.config.ImageEmbedder

class ImageEmbedder[source]

Bases: ABC

Parent class for the image_embedder of ImageEmbedderConfig. This class first retrieves images based on given paths stored in the data frame and then embeds retrieved images into tensor. Users are responsible for implementing forward_embed() which takes a list of images and returns embeddings tensor. User can also override forward_retrieve() which takes the paths to images and return a list of PIL.Image.Image.

forward_retrieve(path_to_images: list[str]) list[PIL.Image.Image][source]

Retrieval function that reads a list of images from a list of file paths with the RGB mode.

abstract forward_embed(images: list[PIL.Image.Image]) Tensor[source]

Embedding function that takes a list of images and returns an embedding tensor.