duongngyn0510 / text-image-retrieval

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build end2end text-image retrieval app

Local service

Requirements

$ pip install git+https://github.com/openai/CLIP.git
$ pin install -r requirements.txt

Model

Fine-tune CLIP in image-retrieval task

  • Input: Image or text query related to FASHION.

  • Output: Top images with the highest similarity according to the cosine metrics.

Database

Using Pinecone vector database for fast retrieval result

  • Vector database contains 85577 vector ids, those vectors are images embedding and their metadata.

Using Google Cloud Storage for storing image data

Local test

$ docker pull duong05102002/retrieval-local-service:v1.23
$ docker run -p 30000:30000 duong05102002/retrieval-local-service:v1.23

Run client.py for test the local api.

  • Image query
$ python client.py --save_dir temp.html --image_query your_image_file
  • Text query
$ python client.py --save_dir temp.html --text_query your_text_query

Note: Refresh the html page to display the images

  • Top 8 products images similar with image query:

ImageImageImageImageImageImageImageImage
  • Top 8 products images similar with text query: crop top
ImageImageImageImageImageImageImageImage

Response time (traces)

  • Image query result

  • Text query result

About


Languages

Language:Jupyter Notebook 98.8%Language:Python 1.2%Language:HCL 0.0%Language:Dockerfile 0.0%