Skip to content

edcalderin/clip-image-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLIP Image search

It consists on an image searcher based on user input. The applications is able to search for images that match the query. The resulting images will be shown in rank order, with the ranking calculated using the cosine similarity.

Video:
IMAGE ALT TEXT HERE

Setup

  • Install conda

  • Create the environment: conda create -n clip_image_search python=3.12

  • Activate environment: source activate clip_image_search or
    conda activate clip_image_search if the previous one fails.

  • Install pip: conda install pip This ensures that the requirements will be installed inside the environment directory.

  • (Optional) Run where pip and verify that pip command comes from the current environment.

  • Install requirements: pip install -r requirements.txt

Run the app

  1. Generate the embeddings: python -m src.get_embeddings

It will create a binary with the embeddings in the root directory called embeddings.pkl

  1. Start the streamlit application: python -m streamlit run src/app.py

  2. Feel free to add more images to enrich the application. I only collected a few.

Lint

Ruff commands:

  • ruff format .
  • ruff check . --fix

Enjoyed this content?

Explore more of my work on Medium

I regularly share insights, tutorials, and reflections on tech, AI, and more. Your feedback and thoughts are always welcome!

About

Image Searcher with CLIP model.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages