This is a flask app which predicts whether the given image belongs to cat category or dog category. I have used the concept of transfer learning in this project. I used the pre-trained VGG-16 model architecture which was trained with ImageNet dataset. I trained this model (by freezing the in-between convolutional layers having previously trained weights) on Cat-vs-Dog dataset from Kaggle competition. I am able to achieve around 92% accuracy on the validation dataset.
This repository contains an LFS file (VGG_model.h5) as this weights file is of 156 mb and github only allows to upload files which are less than 100 mb. So follow the steps below to clone it -
- Download and install Git LFS on your machine.
- Then after configuring Git LFS, open Bash console and type the usual git clone command.
git clone https://github.com/sudeeep885/Cat-vs-Dog-Flask-web-app.git
-
Fire up the terminal in the cloned repository directory.
-
First create a virtual environment.
virtualenv .env
-
Activate the virtual environment.
. ./.env/Scripts/activate
-
Install the packages from requirements.txt file
pip install -r requirements.txt
-
Then finally start the flask app by typing
python main.py