This repository contains code for a simple image search engine using Flask & Pytorch trained model. The VAE model was trained using the Fruits 360 data that can be found on Kaggle. The script to get the trained model object (checkpoint.pth) can be found here
-
This repository is based on the Simple Image Search Project by matsui528
-
The Variational Autoencoder was trained using Pytorch . This video tutorial by Dr Yann LeCun & Dr Alfredo Canziani was helpful.
* server.py - running this file will activate the local application, where the user will choose images. This python file also generates embedding.npy & img_paths.json
* embedding.npy - embedding of each image stored in '.static/img/'
* img_paths.json - This keeps a record of all the images in '.static/img/'
* requirements.txt - List of libraries used for this application.
* feature_extractor.py - This contains functions that will be used by the application to extract image embeddings.
* model/
- checkpoint.pth - This is the saved model file
* templates/
- index.html - File that contains information about the UI of the app
* static
- img/
- Contains All the images that are used to construct the embeddings
- uploaded/
- Contains images that are uploaded into the application.
Run the following and open http://0.0.0.0:5000/
gh repo clone adhok/Searching-Similar-Images-using-VAE
cd Searching-Similar-Images-using-VAE
pip install -r requirements.txt
python server.py
Please let me know if you have any feedback. You can send me an email on padhokshaja@gmail.com