learning-it by example

Back to the video

Image Search With CLIP in Python: Tested on 12 Drawings

I searched twelve drawn pictures with sentences. It found the blue square. Left of a square, it got wrong.

Video #55 ยท RAG and vector search

Steps in the video

  1. 0:00 I searched pictures with a sentence, and left was not left
  2. 0:23 The idea
  3. 0:47 Setup
  4. 1:12 Twelve drawn pictures
  5. 1:35 Embed and search
  6. 2:12 Count by kind
  7. 2:59 What this does not show
  8. 3:37 Mistakes to avoid
  9. 4:03 My take and next steps
  10. 4:34 Recap

Files

  • compare.py (34 lines)
  • pictures.py (46 lines)

Download the code (zip)

Tested with

Python 3.12.15 | fastembed==0.9.1

What this does not show

Twelve pictures drawn by the code, plain shapes on white, with sentences I wrote. One CLIP model of one size, one run. Twelve pictures cannot say how it behaves across thousands of real photos: a pattern, not a verdict.

Sources

Learning IT by Example.