oke-aditya / image_similarity

PyTorch Blog Post On Image Similarity Search
https://oke-aditya.github.io/image_similarity/
Apache License 2.0
250 stars 59 forks source link
auto-encoders autoencoder image-retrieval image-similarity pytorch unsupervised-learning

Image Similarity using PyTorch

CI Tests Check Formatting Deploy mkdocs PyPi Release Install Package

Auto-encoder based Image-Similarity Engine

Blog Post is here

Dataset is available over Kaggle

Published in Official PyTorch Medium Channel. Thank you PyTorch team !

Tasks that it can do.

Repostory Structure.

=== data                        Read data from here. It is in gitignore so it won't appear here.
=== docs                        Documentation using mkdocs.
=== image_similarity
====== cluster_images.py        Clusters the embeddings learnt using PCA and T-SNE.
====== torch_data.py            Contains Dataset class to create PyTorch dataset from folder.
====== torch_model.py           Convolutional Auto-enocder Model.
====== torch_engine.py          Train_step and validation_step for training.
====== torch_train.py           Trainng script. Trains Auto-enocder and saves the embeddings.
====== torch_infer.py           Contains inference code
====== config.py                Configurations of models and paths.
====== torch_inference.ipynb    Inference code in .ipynb to play with.
====== torch_train.ipynb        Stand-alone code to train in Jupyter.
=== tests                       Contains tests for CI

Documentation

Please visit here for documentation.

It contains detailed description of work.

Image similarity Outputs

Some sample outputs of recommendations.

Output 1

Output 2

More outputs can be found in outputs folder.

Models