Skip to content

The image classifier to recognize different breeds of dog. Dataset used contains 50 images of dogs. In Image Classifier Project Resnet18, Alexnet, VGG16 from torchvision.models pretrained models were used. It was loaded as a pre-trained network, in which input images are transformed and resized for better prediction.

GauravG-20/Dog-Image-Classifier

Repository files navigation

AI Programming with Python Project. Dog Image Classification using Pytorch models.

Project code for Udacity's AI Programming with Python Nanodegree program. In this project, code was developed for an image classifier built with PyTorch.

The image classifier recognizes different breeds of dogs. The dataset used contains 50 images of dogs.

In Image Classifier Project Resnet18, Alexnet, VGG16 from torchvision.models pre-trained models were used. It was loaded as a pre-trained network, in which input images are transformed and resized for better prediction.

Dataset used :

  • Dog Breed Images from ImageNet
  • Dog images can be downloaded from here

Neural Network used :

You can download Resnet18 here
You can download VGG16 here
You can download Alexnet here

Refresher on Neural Network :

Gradient Descent
Backpropogation

Command line applications available:

For command-line applications, there is an option to select either Alexnet or VGG16 or Resnet models.

Following arguments mandatory or optional for check_images.py

  1. --dir. 'Provide data directory of Dog Images.', type = str, default = 'pet_images/'
  2. --dogfile. 'Provide data directory of names of dogs,' type = str, default = 'dognames.txt'
  3. --arch. 'Alexnet or Resnet can be used if this argument is specified, otherwise, VGG16 will be used', type = str

Run on windows -

Make sure you have installed Python, Pytorch and Jupyter Notebook.

  • Download all the folders and files
    git clone https://github.com/GauravG-20/Dog-Image-Classifier.git
  • Then open Visual Studio Code (or powershell) and change the directory to the path where all the files are located.
    cd Dog-Image-Classifier
  • Now run the following commands -
    1. python check_images.py -- will download the models and then will predict the breeds of the dogs with default parameters.
    2. sh run_models_batch.sh -- will run the program from the command line within Project Workspace (see run_models_batch.sh for further clarification)
    3. sh run_models_batch_uploaded.sh -- will run the program from the command line within Project Workspace (see run_models_batch_uploaded.sh for further clarification)

About

The image classifier to recognize different breeds of dog. Dataset used contains 50 images of dogs. In Image Classifier Project Resnet18, Alexnet, VGG16 from torchvision.models pretrained models were used. It was loaded as a pre-trained network, in which input images are transformed and resized for better prediction.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published