Pytorch使用CRNN+CTCLoss实现OCR系统
Song •
3149 次浏览 •
0个评论 •
2019年02月02日
卷积递归神经网络
此项目使用CNN + RNN + CTCLoss
实现OCR
系统,灵感来自CRNN
网络。
一、用法
python ./train.py --help
二、演示
1、使用TestDataset
数据生成器训练简单的OCR
。训练60-100
次。
python train.py --test-init True --test-epoch 10 --output-dir <path_to_folder_with_snapshots>
2、运行test来训练可视化模型。
python test.py --snapshot <path_to_folder_with_snapshots>/crnn_resnet18_10_best --visualize True
三、训练自定义数据集
1、创建数据集
- 数据集的结构:
<root_dataset_dir>
---- data
-------- <img_filename_0>
...
-------- <img_filename_1>
---- desc.json
- desc.json的结构:
{ "abc": <symbols_in_aphabet>, "train": [ { "text": <text_on_image> "name": <img_filename> }, ... { "text": <text_on_image> "name": <img_filename> } ], "test": [ { "text": <text_on_image> "name": <img_filename> }, ... { "text": <text_on_image> "name": <img_filename> } ] }
2、使用自定义数据集训练简单的OCR。
python train.pt --test-init True --test-epoch 10 --output-dir <path_to_folder_with_snapshots> --data-path <path_to_custom_dataset>
3、运行test来训练可视化模型。
python test.py --snapshot <path_to_folder_with_snapshots>/crnn_resnet18_10_best --visualize True --data-path <path_to_custom_dataset>
四、依赖
- pytorch 0.3.0 +
- warp-ctc
五、相关文章
项目地址:BelBES/crnn-pytorch
用户评论
-
Song 2019-03-21 09:09:01
123更多相关好文
当前暂无更多相关好文推荐...
-
微信公众号文章/菜单添加小程序时路径如何获取? 2021-12-22
-
如何轻松获取微信小程序路径path? 2021-12-22
-
cannot import name 'CUDA_HOME' from 'mmcv.utils' 2021-12-05
-
vgg的loss一轮达到ln(1/n)阈值,如何解决 2021-11-21
-
如何下载使用utils库 2021-10-27
热门文章
-
微信公众号文章/菜单添加小程序时路径如何获取? 2021-12-22
-
如何轻松获取微信小程序路径path? 2021-12-22
-
python/MySQL分页查询方法与性能优化 2021-06-23
-
mitmproxy & python 忽略所有的https/ssl请求 2021-04-19
-
如何使用邮件/邮箱推广微信公众号/小程序? 2021-01-28
栏目最新文章
公告提示
- pytorch中文文档
- pytorch官方文档
提交评论