All Projects → Sanster → Text_renderer

Sanster / Text_renderer

Licence: mit
Generate text images for training deep learning ocr model

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Text renderer

Crnn Mxnet Chinese Text Recognition
An implementation of CRNN (CNN+LSTM+warpCTC) on MxNet for chinese text recognition
Stars: ✭ 161 (-82.71%)
Mutual labels:  crnn, ocr
Pytorchocr
基于pytorch的ocr算法库,包括 psenet, pan, dbnet, sast , crnn
Stars: ✭ 198 (-78.73%)
Mutual labels:  crnn, ocr
Captcha break
验证码识别
Stars: ✭ 2,268 (+143.61%)
Mutual labels:  crnn, ocr
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 (+1337.06%)
Mutual labels:  crnn, ocr
CRNN.tf2
Convolutional Recurrent Neural Network(CRNN) for End-to-End Text Recognition - TensorFlow 2
Stars: ✭ 131 (-85.93%)
Mutual labels:  ocr, crnn
Crnn.pytorch
crnn实现水平和垂直方向中文文字识别, 提供在3w多个中文字符训练的水平识别和垂直识别的预训练模型; 欢迎关注,试用和反馈问题... ...
Stars: ✭ 145 (-84.43%)
Mutual labels:  crnn, ocr
Ocr.pytorch
A pure pytorch implemented ocr project including text detection and recognition
Stars: ✭ 196 (-78.95%)
Mutual labels:  crnn, ocr
Deep Text Recognition Benchmark
Text recognition (optical character recognition) with deep learning methods.
Stars: ✭ 2,665 (+186.25%)
Mutual labels:  crnn, ocr
crnn.mxnet
crnn in mxnet.can train with chinese characters
Stars: ✭ 47 (-94.95%)
Mutual labels:  ocr, crnn
BankCard-Recognizer
Identifying numbers from bankcard, based on Deep Learning with Keras [China Software Cup 2019]
Stars: ✭ 74 (-92.05%)
Mutual labels:  ocr, crnn
Sightseq
Computer vision tools for fairseq, containing PyTorch implementation of text recognition and object detection
Stars: ✭ 116 (-87.54%)
Mutual labels:  crnn, ocr
Crnn attention ocr chinese
CRNN with attention to do OCR,add Chinese recognition
Stars: ✭ 315 (-66.17%)
Mutual labels:  crnn, ocr
Crnn With Stn
implement CRNN in Keras with Spatial Transformer Network
Stars: ✭ 83 (-91.08%)
Mutual labels:  crnn, ocr
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 (+1842.43%)
Mutual labels:  crnn, ocr
Pottan Ocr
A stupid OCR for malayalam language
Stars: ✭ 39 (-95.81%)
Mutual labels:  crnn, ocr
CRNN-OCR-lite
Lightweight CRNN for OCR (including handwritten text) with depthwise separable convolutions and spatial transformer module [keras+tf]
Stars: ✭ 130 (-86.04%)
Mutual labels:  ocr, crnn
insightocr
MXNet OCR implementation. Including text recognition and detection.
Stars: ✭ 100 (-89.26%)
Mutual labels:  ocr, crnn
Tr
Free Offline OCR 离线的中文文本检测+识别SDK
Stars: ✭ 598 (-35.77%)
Mutual labels:  crnn, ocr
Evil
Optical Character Recognition in Swift for iOS&macOS. 银行卡、身份证、门牌号光学识别
Stars: ✭ 648 (-30.4%)
Mutual labels:  ocr
Dmsmsgrcg
A photo OCR project aims to output DMS messages contained in sign structure images.
Stars: ✭ 18 (-98.07%)
Mutual labels:  ocr

New version release:https://github.com/oh-my-ocr/text_renderer

Text Renderer

Generate text images for training deep learning OCR model (e.g. CRNN). Support both latin and non-latin text.

Setup

  • Ubuntu 16.04
  • python 3.5+

Install dependencies:

pip3 install -r requirements.txt

Demo

By default, simply run python3 main.py will generate 20 text images and a labels.txt file in output/default/.

example1.jpg example2.jpg

example3.jpg example4.jpg

Use your own data to generate image

  1. Please run python3 main.py --help to see all optional arguments and their meanings. And put your own data in corresponding folder.

  2. Config text effects and fraction in configs/default.yaml file(or create a new config file and use it by --config_file option), here are some examples:

Effect name Image
Origin(Font size 25) origin
Perspective Transform perspective
Random Crop rand_crop
Curve curve
Light border light border
Dark border dark border
Random char space big random char space big
Random char space small random char space small
Middle line middle line
Table line table line
Under line under line
Emboss emboss
Reverse color reverse color
Blur blur
Text color font_color
Line color line_color
  1. Run main.py file.

Strict mode

For no-latin language(e.g Chinese), it's very common that some fonts only support limited chars. In this case, you will get bad results like these:

bad_example1

bad_example2

bad_example3

Select fonts that support all chars in --chars_file is annoying. Run main.py with --strict option, renderer will retry get text from corpus during generate processing until all chars are supported by a font.

Tools

You can use check_font.py script to check how many chars your font not support in --chars_file:

python3 tools/check_font.py

checking font ./data/fonts/eng/Hack-Regular.ttf
chars not supported(4971):
['第', '朱', '广', '沪', '联', '自', '治', '县', '驼', '身', '进', '行', '纳', '税', '防', '火', '墙', '掏', '心', '内', '容', '万', '警','钟', '上', '了', '解'...]
0 fonts support all chars(5071) in ./data/chars/chn.txt:
[]

Generate image using GPU

If you want to use GPU to make generate image faster, first compile opencv with CUDA. Compiling OpenCV with CUDA support

Then build Cython part, and add --gpu option when run main.py

cd libs/gpu
python3 setup.py build_ext --inplace

Debug mode

Run python3 main.py --debug will save images with extract information. You can see how perspectiveTransform works and all bounding/rotated boxes.

debug_demo

Todo

See https://github.com/Sanster/text_renderer/projects/1

Citing text_renderer

If you use text_renderer in your research, please consider use the following BibTeX entry.

@misc{text_renderer,
  author =       {weiqing.chu},
  title =        {text_renderer},
  howpublished = {\url{https://github.com/Sanster/text_renderer}},
  year =         {2021}
}
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].