This project provides a simple image similarity calculator using the CLIP (Contrastive Language-Image Pre-training) model. It consists of two Python scripts, predictor.py
and app.py
, that allow you to calculate the cosine similarity between two images.
- Python 3.7+
- PyTorch
- CLIP (PyTorch)
- PIL (Python Imaging Library)
- FastAPI (for running app.py)
- Clone this repository to your local machine:
git clone https://github.com/cobanov/clip-image-similarity
cd clip-image-similarity
- Build and run the docker image
docker build -t image_similarity .
docker run -d -p 8002:8002 image_similarity