Intelligent Image Gallery with Uploads, Deduplication, and Text-Based Search Using Vector DB Qdrant and Sentence Transformers.
Smart Image Gallery powered by AI. That can perform the following Tasks:
- Search your images using just Text. (Ex: "Smiling group photos", "Surfing", "Exam Notes", etc.,.)
- Image Deduplication
-
Dataset
: Currently testing out with an open-source dataset called cats_vs_dogs from HuggingFace.
Dataset : cats_vs_dogs contains about 23,422 images of dogs and cats. -
Qdrant
: Qdrant is a lightweight vector database that recently started their managed cloud services, which let you use a free cluster for trial and the option to upgrade as you use more features. We will use it to store our dataset in the form of vectors. -
CLIP
: CLIP is a text and image encoder model that generates embeddings for both text and images! We need a vector representation of images to store them in the Qdrant collection. CLIP -
Gradio
: User interface built using the open-source demo platform Gradio.
-
Go to qdrant, Create a new account -> Create new cluster -> Create API key for usage.
-
Set up environment :
pip install qdrant-client datasets sentence-transformers gradio
-
Download datasets from HuggingFace :
dataset = load_dataset("cats_vs_dogs",verification_mode='no_checks').shuffle()
-
Code : -> Notebook
CLIP
Qdrant
HuggingFace
- https://qdrant.tech/documentation/
- https://www.gradio.app/docs/interface/
- https://huggingface.co/docs/hub/en/sentence-transformers
- https://pytorch.org/get-started/locally/
- https://openai.com/research/clip
- https://github.com/openai/CLIP
- https://www.sbert.net/examples/applications/image-search/README.html
- https://qdrant.tech/documentation/tutorials/bulk-upload/