Skip to content
/ scs Public

Simple image search engine by a text query using CLIP

License

Notifications You must be signed in to change notification settings

matsui528/scs

Repository files navigation

SCS: Simple CLIP Search

Open in GitHub Codespaces

Simple CLIP Search (SCS) is a system for searching images based on a text query using the OpenCLIP model. It is designed for educational purposes and can be run in a codespace (click the above badge!).

image

Tutorial

See our video tutorial (in Japanese):

  1. Algorithm
  2. Implementation

Prerequisites

Before running SCS, you will need to have Python 3 installed on your system. You will also need to install the following dependencies:

pip install -r requirements.txt

How to run

To run SCS, follow these steps:

  • Download images (Caltech256 dataset) to the img directory:
    python download_caltech256.py
  • Extract features to the feature directory:
    python extract_features.py
  • Search by querying a text. You can find the search results in the out directory:
    python search.py

How to use your own images

To use your own images, delete all images in the img directory and replace them with your own JPEG images. Then, run extract_features.py and search.py as described above.

Bonus: GUI by streamlit

pip install streamlit
streamlit run search_streamlit.py

image

Reference

  • OpenCLIP: Our project is heavily based on this repository.

Releases

No releases published

Packages

No packages published

Languages