YCG09/chinese_ocr
YCG09/chinese_ocr has 2,778 GitHub stars and 1,063 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-06 20:37 UTC. Last push 2019-10-08.
CTPN + DenseNet + CTC based end-to-end Chinese OCR implemented using tensorflow and keras
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original简介
基于Tensorflow和Keras实现端到端的不定长中文字符检测和识别
- 文本检测:CTPN
- 文本识别:DenseNet + CTC
环境部署
sh setup.sh
- 注:CPU环境执行前需注释掉for gpu部分,并解开for cpu部分的注释
Demo
将测试图片放入test_images目录,检测结果会保存到test_result中
python demo.py
模型训练
CTPN训练
详见ctpn/README.md
DenseNet + CTC训练
1. 数据准备
数据集:https://pan.baidu.com/s/1QkI7kjah8SPHwOQ40rS1Pw (密码:lu7m)
- 共约364万张图片,按照99:1划分成训练集和验证集
- 数据利用中文语料库(新闻 + 文言文),通过字体、大小、灰度、模糊、透视、拉伸等变化随机生成
- 包含汉字、英文字母、数字和标点共5990个字符
- 每个样本固定10个字符,字符随机截取自语料库中的句子
- 图片分辨率统一为280x32
图片解压后放置到train/images目录下,描述文件放到train目录下
2. 训练
cd train
python train.py
3. 结果
| val acc | predict | model |
|---|---|---|
| 0.983 | 8ms | 18.9MB |
- GPU: GTX TITAN X
- Keras Backend: Tensorflow
4. 生成自己的样本
可参考SynthText_Chinese_version,TextRecognitionDataGenerator和text_renderer
效果展示
参考
[1] https://github.com/eragonruan/text-detection-ctpn
[2] https://github.com/senlinuc/caffe_ocr
Explore related projects
tensorflow/tensorflow
An Open Source Machine Learning Framework for Everyone
201,311 starshuggingface/transformers
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
168,576 starsAUTOMATIC1111/stable-diffusion-webui
Stable Diffusion web UI
165,264 starsComfy-Org/ComfyUI
The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
145,310 stars