All Projects → FLming → CRNN.tf2

FLming / CRNN.tf2

Licence: MIT license
Convolutional Recurrent Neural Network(CRNN) for End-to-End Text Recognition - TensorFlow 2

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to CRNN.tf2

Deep Text Recognition Benchmark
Text recognition (optical character recognition) with deep learning methods.
Stars: ✭ 2,665 (+1934.35%)
Mutual labels:  ocr, crnn, scene-text-recognition
Sightseq
Computer vision tools for fairseq, containing PyTorch implementation of text recognition and object detection
Stars: ✭ 116 (-11.45%)
Mutual labels:  ocr, ctc, crnn
Easyocr
Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.
Stars: ✭ 13,379 (+10112.98%)
Mutual labels:  ocr, crnn, scene-text-recognition
TFLite-ModelMaker-EfficientDet-Colab-Hands-On
TensorFlow Lite Model Makerで物体検出を行うハンズオン用資料です(Hands-on for object detection with TensorFlow Lite Model Maker)
Stars: ✭ 15 (-88.55%)
Mutual labels:  tensorflow-lite, tensorflow2
spectral normalization-tf2
🌈 Spectral Normalization implemented as Tensorflow 2
Stars: ✭ 36 (-72.52%)
Mutual labels:  tf2, tensorflow2
Pytorchocr
基于pytorch的ocr算法库,包括 psenet, pan, dbnet, sast , crnn
Stars: ✭ 198 (+51.15%)
Mutual labels:  ocr, crnn
Captcha break
验证码识别
Stars: ✭ 2,268 (+1631.3%)
Mutual labels:  ocr, crnn
BankCard-Recognizer
Identifying numbers from bankcard, based on Deep Learning with Keras [China Software Cup 2019]
Stars: ✭ 74 (-43.51%)
Mutual labels:  ocr, crnn
manning tf2 in action
The official code repository for "TensorFlow in Action" by Manning.
Stars: ✭ 61 (-53.44%)
Mutual labels:  tf2, tensorflow2
doctr
docTR (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning.
Stars: ✭ 1,409 (+975.57%)
Mutual labels:  ocr, tensorflow2
Awesome-Tensorflow2
基于Tensorflow2开发的优秀扩展包及项目
Stars: ✭ 45 (-65.65%)
Mutual labels:  tf2, tensorflow2
Icdar 2019 Sroie
ICDAR 2019 Robust Reading Challenge on Scanned Receipts OCR and Information Extraction
Stars: ✭ 202 (+54.2%)
Mutual labels:  ocr, ctc
Ocr.pytorch
A pure pytorch implemented ocr project including text detection and recognition
Stars: ✭ 196 (+49.62%)
Mutual labels:  ocr, crnn
Rnn ctc
Recurrent Neural Network and Long Short Term Memory (LSTM) with Connectionist Temporal Classification implemented in Theano. Includes a Toy training example.
Stars: ✭ 220 (+67.94%)
Mutual labels:  ocr, ctc
crnn.mxnet
crnn in mxnet.can train with chinese characters
Stars: ✭ 47 (-64.12%)
Mutual labels:  ocr, crnn
pcdarts-tf2
PC-DARTS (PC-DARTS: Partial Channel Connections for Memory-Efficient Differentiable Architecture Search, published in ICLR 2020) implemented in Tensorflow 2.0+. This is an unofficial implementation.
Stars: ✭ 25 (-80.92%)
Mutual labels:  tf2, tensorflow2
CRNN-OCR-lite
Lightweight CRNN for OCR (including handwritten text) with depthwise separable convolutions and spatial transformer module [keras+tf]
Stars: ✭ 130 (-0.76%)
Mutual labels:  ocr, crnn
AESRC2020
a deep accent recognition network
Stars: ✭ 35 (-73.28%)
Mutual labels:  ctc, crnn
Paddleocr
Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
Stars: ✭ 18,084 (+13704.58%)
Mutual labels:  ocr, crnn
Crnn Mxnet Chinese Text Recognition
An implementation of CRNN (CNN+LSTM+warpCTC) on MxNet for chinese text recognition
Stars: ✭ 161 (+22.9%)
Mutual labels:  ocr, crnn

Convolutional Recurrent Neural Network for End-to-End Text Recognition - TensorFlow 2

TensorFlow version Python version Paper Zhihu

This is a re-implementation of the CRNN network, build by TensorFlow 2. This repository may help you to understand how to build an End-to-End text recognition network easily. Here is the official repo implemented by bgshih.

Abstract

This repo aims to build a simple, efficient text recognize network by using the various components of TensorFlow 2. The model build by the Keras API, the data pipeline build by tf.data, and training with model.fit, so we can use most of the functions provided by TensorFlow 2, such as Tensorboard, Distribution strategy, TensorFlow Profiler etc.

Installation

$ pip install -r requirements.txt

Demo

Here I provide an example model that trained on the Mjsynth dataset, this model can only predict 0-9 and a-z(ignore case).

$ wget https://github.com/FLming/CRNN.tf2/releases/download/v0.2.0/SavedModel.tgz
$ tar xzvf SavedModel.tgz
$ python tools/demo.py --images example/images/ --config configs/mjsynth.yml --model SavedModel

Then, You will see output like this:

Path: example/images/word_1.png, y_pred: [b'tiredness'], probability: [0.9998626]
Path: example/images/word_3.png, y_pred: [b'a'], probability: [0.67493004]
Path: example/images/2_Reimbursing_64165.jpg, y_pred: [b'reimbursing'], probability: [0.990946]
Path: example/images/word_2.png, y_pred: [b'kills'], probability: [0.9994573]
Path: example/images/1_Paintbrushes_55044.jpg, y_pred: [b'paintbrushes'], probability: [0.9984008]
Path: example/images/3_Creationisms_17934.jpg, y_pred: [b'creationisms'], probability: [0.99792457]

About decode methods, sometimes the beam search method will be better than the greedy method, but it's costly.

Train

Before you start training, maybe you should prepare data first. All predictable characters are defined by the table.txt file. The configuration of the training process is defined by the yml file.

This training script uses all GPUs by default, if you want to use a specific GPU, please set the CUDA_VISIBLE_DEVICES parameter.

$ python crnn/train.py --config configs/mjsynth.yml --save_dir PATH/TO/SAVE

The training process can visualize in Tensorboard.

$ tensorboard --logdir PATH/TO/MODEL_DIR

For more instructions, please refer to the config file.

Data prepare

To train this network, you should prepare a lookup table, images and corresponding labels. Example data is copy from MJSynth and ICDAR2013 dataset.

Lookup table

The file contains all characters and blank labels (in the last or any place both ok, but I find Tensorflow decoders can't change it now, so set it to last). By the way, you can write any word as blank.

Image data

It's an End-to-End method, so we don't need to indicate the position of the character in the image.

Paintbrushes Creationisms Reimbursing

The labels corresponding to these three pictures are Paintbrushes, Creationisms, Reimbursing.

Annotation file

We should write the image path and its corresponding label to a text file in a certain format such as example data. The data input pipeline will automatically detect the support format. Customization is also very simple, please check out the dataset factory.

Support format

Eval

$ python crnn/eval.py --config PATH/TO/CONFIG_FILE --weight PATH/TO/MODEL_WEIGHT

Converte & Ecosystem

There are many components here to help us do other things. For example, deploy by Tensorflow serving. Before you deploy, you can pick up a good weight, and convertes model to SavedModel format by this command, it will add the post processing layer in the last and cull the optimizer:

$ python tools/export.py --config PATH/TO/CONFIG_FILE --weight PATH/TO/MODEL_WEIGHT --pre rescale --post greedy --output PATH/TO/OUTPUT

And now Tensorflow lite also can convert this model, that means you can deploy it to Android, iOS etc.

Note. Decoders can't convert to Tensorflow lite because of the assets. Use the softmax layer or None.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].