lens-image-search.ipynb
Given a folder of input images that you intend to search, run this script to download all the similar images in the first page of searched result.
image-similarity.ipynb
Reference: https://huggingface.co/blog/image-similarity
Pre-processing: resize and crop the images to 224x224 -> convert to Tensors and normalize
Embeddings: use Transformer to encode the images and get embeddings
Compute similarity: use cosine similarity to calculate the scores