https://github.com/wenmuzhou/segmentation-free_ocr
recognize chinese and english without segmentation
https://github.com/wenmuzhou/segmentation-free_ocr
ocr python3 tensorflow text-recognition
Last synced: 10 months ago
JSON representation
recognize chinese and english without segmentation
- Host: GitHub
- URL: https://github.com/wenmuzhou/segmentation-free_ocr
- Owner: WenmuZhou
- License: gpl-3.0
- Created: 2018-01-29T12:27:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-22T01:48:33.000Z (almost 8 years ago)
- Last Synced: 2025-04-12T19:14:29.822Z (about 1 year ago)
- Topics: ocr, python3, tensorflow, text-recognition
- Language: Python
- Size: 5.71 MB
- Stars: 11
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Convolutional Recurrent Neural Network in Tensorflow (tf.crnn)
this code is fork from and modified.
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 and code
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_info.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/simple_generate_scene_text.py` : generates Chinese and English text images
* Extra : `hlp/get_captcha.py` : draws text to images
* 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 :
```
python3 train.py -g 1 -ft train_data.csv -o ./export_model_dir
```
### Dependencies
* `tensorflow` (1.3)
* `tensorflow-tensorboard` (0.1.7)
* `tqdm`
* `json`
* `glob`