This project classifies dog breeds into one of 133 dog breeds using Pytorch
It includes a notebook with 6 parts
- Human Face Detection(Two methods used)
- Dog Detection(Two pretrained models used)
- Classiying Dogs by training Neural Network From Scratch(Got 48% accuracy)
- Classifying Dogs By using pretrained model(Got 87% accuracy)
- Algorithm to detect human or dogs with the appropriate message
- If dog detected then predict the breed
- If human detected then predict the most similar dog
- If neither print a message indication nothing detected
- Testing the algorithm in step 5
The file environment.yaml
has all the necessary packages to install so all you need to do is
git clone https://github.com/mohshawky5193/dog-breed-classifier.git
cd dog-breed-classifier
conda env create -f environment.yaml
All the packages included in the file requirements.txt
but you should modify the line for torch == 1.0.0
and replace it with your version of Pytorch
here then copy and paste the link in the file requirements.txt
then do the following
git clone https://github.com/mohshawky5193/dog-breed-classifier.git
cd dog-breed-classifier
pip install -r requirements.txt
After cloning and changing the directory run the app from the command line as follows
python dog-breed-classifier.py <input image file here> --output_path <output image file here>
if no path specified the output image name will be output.jpg
- If the image is of human then it will lay a snapchat like filter of dog on the person's face like this
- If the image is of dog the it prints the dog breed in the console in addition to writing it on the dog image like this
- If the image file contains neither human face nor a dog then print output message indicating so
There is also a web application deployed on Heroku you can also try it and have fun 😄