🐶 Dog and face person matcher based on image similarity
This project came to my mind in order to improve the experience seen in all the Instagram filters where everything is random. With that being said, I wanted to really know which dog is the one that is most similar to me. Yeah, it's random. I know.
From an image (image path or image URL), it returns the most similar dog given the Standford Dogs dataset. Simple and beautiful.
Using Python 3.7, Tensorflow, NMSLIB, NumPy and Pillow, it builds a similarity index where I extract the features of the input image versus the built index and get the closest one.
To be honest, I wanted to do another project (completely different from this one) in this hackathon (HackFromHome Round 2) but I got stuck after several hours and realized that was impossible. Yeah, what a pity.
That's why I decided to move to this project.
Building this random thing in less than 3 hours.
A lot of things, like a beautiful UI and getting this deployed somewhere.
- Python 3.7+.
Usage of virtualenv is recommended for package library / runtime isolation.
To run the pipeline, please execute the following from the root directory:
-
Setup virtual environment
-
Install dependencies
pip3 install -r requirements.lock
-
Download the Standford Dogs dataset into
data/standford-dogs-dataset.zip
-
Prepare dataset
python3 -m src.prepare_dataset [--images_per_race N]
-
Build similarity index
python3 -m src.build
-
Run similarity search
python3 -m src.run [--image_url https://example.org/image.jpg] [--image_path image.jpg] [--show]
MIT © Which dog are you?