attention-ocr.pytorch:Encoder+Decoder+attention model
======================================
This repository implements the the encoder and decoder model with attention model for OCR, the encoder uses CNN+Bi-LSTM, the decoder uses GRU. This repository is modified from https://github.com/meijieru/crnn.pytorch
Earlier I had an open source version, but had some problems identifying images of fixed width. Recently I modified the model to support image recognition with variable width. The function is the same as CRNN. Due to the time problem, there is no pre-training model this time, which will be updated later.
# requirements
pytorch 0.4.1
opencv_python
```bash
cd Attention_ocr.pytorch
pip install -r requirements.txt
```
# Test
pretrained model coming soon
# Train
1. Here i choose a small dataset from [Synthetic_Chinese_String_Dataset](https://github.com/chenjun2hao/caffe_ocr), about 270000+ images for training, 20000 images for testing.
download the image data from [Baidu](https://pan.baidu.com/s/1hIurFJ73XbzL-QG4V-oe0w)
2. the train_list.txt and test_list.txt are created as the follow form:
```
# path/to/image_name.jpg label
path/AttentionData/50843500_2726670787.jpg 情笼罩在他们满是沧桑
path/AttentionData/57724421_3902051606.jpg 心态的松弛决定了比赛
path/AttentionData/52041437_3766953320.jpg 虾的鲜美自是不可待言
```
3. change the **trainlist** and **vallist** parameter in train.py, and start train
```bash
cd Attention_ocr.pytorch
python train.py --trainlist ./data/ch_train.txt --vallist ./data/ch_test.txt
```
then you can see in the terminel as follow:

there uses the decoderV2 model for decoder.
# The previous version
**_git checkout AttentionOcrV1_**
# Reference
1. [crnn.pytorch](https://github.com/meijieru/crnn.pytorch)
2. [Attention-OCR](https://github.com/da03/Attention-OCR)
3. [Seq2Seq-PyTorch](https://github.com/MaximumEntropy/Seq2Seq-PyTorch)
4. [caffe_ocr](https://github.com/senlinuc/caffe_ocr)
# TO DO
- [ ] change LSTM to Conv1D, it can greatly accelerate the inference
- [ ] change the cnn bone model with inception net, densenet
- [ ] realize the decoder with transformer model
没有合适的资源?快使用搜索试试~ 我知道了~
Attention_ocr.pytorch-master.zip

共40555个文件
png:30501个
jpg:10000个
py:14个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉

2021AIWIN 手写体 OCR 识别竞赛总结(任务一),详见文章:https://blog.csdn.net/hhhhhhhhhhwwwwwwwwww/article/details/122563647?spm=1001.2014.3001.5501
资源推荐
资源详情
资源评论



















收起资源包目录





































































































共 40555 条
- 1
- 2
- 3
- 4
- 5
- 6
- 406


AI浩
- 粉丝: 12w+
- 资源: 188
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制

- 1
- 2
- 3
- 4
- 5
- 6
前往页