A simple Reverse Image Search function uses Resnet50 to extract the features of all images in the directory, and uses Milvus as a vector database to store and query similar images.
The UI is shown below:
You can run the following script to start the Gradio web UI:
python3 reverse_image_search.py
A brief description video is below:
https://www.bilibili.com/video/BV1oi421m7mR
中文解释文档在这里。
If you can't run it directly, you may need to do some preparation, including but not limilited to:
- Install libaray:
pip3 install gradio pymilvus torch
- Prepare dataset:
$ cd data
$ curl -L http://github.com/towhee-io/examples/releases/download/data/reverse_image_search.zip -O
$ unzip -q -o reverse_image_search.zip
- Install vector database:
$ wget http://github.com/milvus-io/milvus/releases/download/v2.2.10/milvus-standalone-docker-compose.yml -O docker-compose.yml
$ docker-compose up -d
$ docker ps