GithubHelp home page GithubHelp logo

fendaq / tf-crnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from solivr/tf-crnn

0.0 1.0 0.0 129 KB

TensorFlow Convolutional Recurrent Neural Network (CRNN) using TF's Estimator

License: GNU General Public License v3.0

Python 100.00%

tf-crnn's Introduction

Convolutional Recurrent Neural Network in Tensorflow (tf.crnn)

CRNN model in Tensorflow using Estimators

Implementation of the Convolutional Recurrent Neural Network (CRNN) for image-based sequence recognition tasks, such as scene text recognition and OCR. Original paper http://arxiv.org/abs/1507.05717 and code https://github.com/bgshih/crnn

This version uses the tf.estimator.Estimator to build the model.

Contents

  • src/model.py : definition of the model
  • src/data_handler.py : functions for data loading, preprocessing and data augmentation
  • src/config.py : class Params manages parameters of model and experiments
  • src/decoding.py : helper fucntion to transform characters to words
  • train.py : script to launch for training the model, more info on the parameters and options inside
  • export_model.py: script to export a model once trained, i.e for serving
  • Extra : hlp/numbers_mnist_generator.py : generates a sequence of digits to form a number using the MNIST database
  • Extra : hlp/csv_path_convertor.py : converts a csv file with relative paths to a csv file with absolute paths

How to train a model

The main script to launch is train.py. To train the model, you should input a csv file with each row containing the filename of the image (full path) and its label (plain text) separated by a delimiting character (let's say ';') :

/full/path/to/image1.{jpg,png};string_label1
/full/path/to/image2.{jpg,png};string_label2
...

For example launch the script using :

python train.py -g 1 -ft train_data.csv -fe val_data.csv -o ./export_model_dir

See train.py for more details on the options.

Dependencies

  • tensorflow (1.3)
  • tensorflow-tensorboard (0.1.7) (not mandatory but useful to visualise loss, accuracy and inputs / outputs)
  • tqdm for progress bars
  • json
  • glob

tf-crnn's People

Contributors

solivr avatar

Watchers

 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.