Coder Social home page Coder Social logo

tensorflow-svhn's Introduction

Project 5: Deep Learning Capstone Project. Decoding a Sequence of Digits in Real World Photos.

This project is a TensorFlow implementation of a Convolution Nueral Network to decode a sequence of digits in the realworld using trained on the SVHN dataset. This project is partial fulfillment of the Udacity Machine Learning nanodegree program.

Installation

git clone https://github.com/bdiesel/machine-learning.git
cd ./machine-learning/projects/capstone

Libraries and Dependicies

The following Python 2.7 libraries are required:

  • h5py
  • matplotlib
  • numpy
  • PIL
  • tensorflow
  • scipy
  • six
  • sklearn

##Step 1: Download and preprocess the SVHN data Download and preprocess the SVHN data using the svhn_data.py utility.

python svhn_data.py

This should generate a data folder data\svhn with two sub-directories cropped and full

The cropped cropped directory should contain 2 newly downloaded .mat files amd 6 numpy file for each dataset which wil be used for training.

The full directory should contain two sub directories test and full which contain png images of various sizes. The full directory should also contain 6 numpy files and and 3 tar.gz files, the tar.gz files may be removed to free up disk space.

##Step 2: Train your own models First train the classifer. The weights generated here will be resused in the training of the multi-digit reader. Note this step may take some time depending of your hardware. Pre-trained models can be downloaded from here for the single digit reader Single Digit Weights, and here for the Multi-Digit Weights.

python train_classifier.py

This should generate a tensorflow checkpoint file:

classifier.ckpt

Next train the multi-digit reader

python train_regressor.py

This should generate a tensorflow checkpoint file:

regression.ckpt

##Step 3: Check model performance The training files generate logs which can be used with TensorBoard to inspect the models performance overtime.

To view the single digit performance after running train_classifier.py run:

tensorboard --logdir="/tmp/svhn_classifier_logs"

To view the multi digit performance after running train_regressor.py run:

tensorboard --logdir="/tmp/svhn_regression_logs"

Usage

The single digit reader for an image file 1.png python single_digit_reader.py 1.png

The multi digit reader for an image file 123.png python mulit_digit_reader.py 123.png

tensorflow-svhn's People

Contributors

bdiesel 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.