In this job, I collaborated with Chayma Bouzaidi
In this project, we built a content-based image retrieval engine that allows users to send a request image in order to display similar images from 1M images database stored in GridFs (MongoDB).🧐
To build this app, we followed this main steps:
• Building feature vectors using Principal Component Analysis
• Storing feature vectors and thumbnail images in MongoDB
• Building a VP-Tree
to optimize searching time
• Setting an interactive web app using Flask
NB : You can get 1M thumbnail images database and corresponding edge histogram descriptors from here
• MongoDB (version 4.2.1).
• Python (version 2.7.15+).
• Create a MongoDB database called CBIR
.
• Specify your MongoDB connection URL in the script app/app.py
.
• Go to app/
directory and install the requirements via pip :
• pip install flask numpy scipy matplotlib scikit-image gunicorn
.
• pip freeze > requirements.txt
.
• Go to scripts/
directory and run toGridFs.py script in order to dump the Thumbnails, the Principal Components and the VP-Tree into GridFs :
• python toGridFs.py -td <YOUR_THUMBNAILS_DIRECTORY> -id <YOUR_PC_VPTREE_DIRECTORY>
.
NB : You can get the Principal Components and the VP-Tree files from here and here
• Run python app/app.py
to start the App.
NB : The list of query images is static. You can change it by hosting the thumbnails on a Free server and specifying the image URL in img
tag in app/templates/index.html
.