Git Product home page Git Product logo

flowercnn's Introduction

pytorch_image_classification

In this project, an image classifier was built with PyTorch, then converted into a command line applications: train.py, predict.py.

The image classifier to recognize different species of flowers. Dataset contains 102 flower categories.

In Image Classifier Project.ipynb Alexnet from torchvision.models pretrained models was used. It was loaded as a pre-trained network, based on which defined a new, untrained feed-forward network as a classifier, using ReLU activations and dropout. Trained the classifier layers using backpropagation using the pre-trained network to get the features. The loss and accuracy on the validation set were tracked to determine the best hyperparameters.

Command line applications train.py and predict.py

For command line applications there is an option to select either Alexnet or VGG13 models.

Following arguments mandatory or optional for train.py

'data_dir'. 'Provide data directory. Mandatory argument', type = str

'--save_dir'. 'Provide saving directory. Optional argument', type = str

'--arch'. 'Vgg13 can be used if this argument specified, otherwise Alexnet will be used', type = str

'--lrn'. 'Learning rate, default value 0.001', type = float

'--hidden_units'. 'Hidden units in Classifier. Default value is 2048', type = int

'--epochs'. 'Number of epochs', type = int

'--GPU'. "Option to use GPU", type = str

Following arguments mandatory or optional for predict.py

'image_dir'. 'Provide path to image. Mandatory argument', type = str

'load_dir'. 'Provide path to checkpoint. Mandatory argument', type = str

'--top_k'. 'Top K most likely classes. Optional', type = int

'--category_names'. 'Mapping of categories to real names. JSON file name to be provided. Optional', type = str

'--GPU'. "Option to use GPU. Optional", type = str

flowercnn's People

Contributors

abdulelahsm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.