clip-vit-base-patch32 requires well-defined input formats for both images and text, along with specific preprocessing steps to ensure the embeddings are meaningful and consistent. For images, the model expects standard RGB images, typically loaded as PIL images or tensors. These images must be resized to the model’s expected resolution (commonly 224×224 pixels), converted to RGB if necessary, normalized using predefined mean and standard deviation values, and batched correctly. For text, the model expects raw strings, which are then tokenized using the tokenizer provided with the model.
From an implementation standpoint, most developers rely on official CLIP utilities or widely used libraries that bundle preprocessing logic. Image preprocessing usually includes resizing, center-cropping, normalization, and conversion to tensors. Text preprocessing involves tokenization, padding, and truncation to the maximum sequence length supported by the text encoder. These steps are not optional; skipping or altering them can lead to embeddings that are incompatible with those generated elsewhere in the system.
Once preprocessing is complete, the resulting embeddings are consistent and suitable for storage in a vector database such as Milvus or Zilliz Cloud. Because preprocessing is deterministic, embeddings generated at different times remain comparable, which is critical for similarity search and retrieval. In practice, teams often standardize preprocessing code as part of their data pipeline to avoid subtle bugs.
For more information, click here:https://zilliz.com/ai-models/text-embedding-3-large