Skip to content
프로젝트

소개

A tensorflow model trained using the svhn dataset to detect digit sequences in the real world.

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Decoding Digit Sequences in Real-World Photos (TensorFlow, SVHN)

A TensorFlow implementation of a convolutional neural network that reads multi-digit sequences, such as house numbers, from real-world photos. It is trained on the SVHN dataset.

Built in 2016 as the capstone project for the Udacity Machine Learning Nanodegree. The code targets Python 2.7 and early TensorFlow 1.x APIs and is kept here as-is for reference. The full write-up is in capstone report final.pdf.

Installation

git clone https://github.com/bdiesel/tensorflow-svhn.git
cd tensorflow-svhn

Libraries and dependencies

The project needs these Python 2.7 libraries:

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

Step 1: Download and preprocess the SVHN data

Download and preprocess the SVHN data with the svhn_data.py utility:

python svhn_data.py

This creates a data/svhn folder with two subdirectories, cropped and full.

The cropped directory contains 2 downloaded .mat files and 6 NumPy files for each dataset, which are used for training.

The full directory contains two subdirectories, test and full, with PNG images of various sizes. It also contains 6 NumPy files and 3 tar.gz files. You can delete the tar.gz files to free up disk space.

Step 2: Train your own models

First train the classifier. The weights it produces are reused to train the multi-digit reader. This step can take a while, depending on your hardware. Pre-trained weights are available for the single-digit reader and the multi-digit reader.

python train_classifier.py

This produces a TensorFlow checkpoint file:

classifier.ckpt

Next, train the multi-digit reader:

python train_regressor.py

This produces a TensorFlow checkpoint file:

regression.ckpt

Step 3: Check model performance

The training scripts write logs that you can open in TensorBoard to inspect the models' performance over time.

To view single-digit performance after running train_classifier.py:

tensorboard --logdir="/tmp/svhn_classifier_logs"

To view multi-digit performance after running train_regressor.py:

tensorboard --logdir="/tmp/svhn_regression_logs"

Usage

Single-digit reader, for an image file 1.png: python single_digit_reader.py 1.png

Multi-digit reader, for an image file 123.png: python multi_digit_reader.py 123.png

관련 프로젝트 살펴보기

불러오는 중…