Notebooks
W
Weaviate
Image Search Clip

Image Search Clip

vector-searchvector-databaseretrieval-augmented-generationllm-frameworksweaviate-featuresfunction-callingweaviate-recipesmedia-searchPythongenerative-ai

Open In Colab

Image Search with CLIP

This recipe demonstrates how build image search with CLIP model (multi2vec-clip).

CLIP allows us to search through text and images.

Weaviate Setup

The CLIP model is only available with local Weaviate deployments with Docker or Kubernetes.

CLIP is not supported with Weaviate Cloud Database (WCD).

Steps to deploy Weaviate locally with CLIP

We will use docker-compose-clip.yaml. For that, run:

[ ]

Dependencies

[ ]

Configuration

[ ]

Create Animals collection

The collection has the following key characteristics:

  1. Name: "Animals"
  2. Vectorizer: multi2vec-clip
  3. Image property: "image" - Weaviate will use values in "image" property to generate vectors. Note, you can call it anything you want.
[ ]

Import Images

For every object, we will store:

  • name - the file name
  • path - path to the file, so that we could display returned images at query time.
  • image - a base64 representation of the image file, Weaviate will use it to generate a vector - see imageFields.
[ ]
[ ]

Check number of objects in the Animals collection

[ ]
[ ]

Query examples

[ ]

Text to Image search

[ ]

Image to Image search

[ ]