Merge branch 'develop' into fixocr
This commit is contained in:
commit
e50a35e59d
52
README.md
52
README.md
|
@ -16,7 +16,7 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
|
|||
- 单模型支持中英文数字组合识别、竖排文本识别、长文本识别
|
||||
- 检测模型DB(4.1M)+识别模型CRNN(4.5M)
|
||||
- 实用通用中文OCR模型
|
||||
- 多种预测推理部署方案,包括服务部署和端测部署
|
||||
- 多种预测推理部署方案,包括服务部署和端侧部署
|
||||
- 多种文本检测训练算法,EAST、DB
|
||||
- 多种文本识别训练算法,Rosetta、CRNN、STAR-Net、RARE
|
||||
- 可运行于Linux、Windows、MacOS等多种系统
|
||||
|
@ -29,7 +29,7 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
|
|||
|
||||
- 超轻量级中文OCR在线体验地址:https://www.paddlepaddle.org.cn/hub/scene/ocr
|
||||
|
||||
- [中文OCR模型快速使用](./doc/doc_ch/quickstart.md)
|
||||
- [**中文OCR模型快速使用**](./doc/doc_ch/quickstart.md)
|
||||
|
||||
## 中文OCR模型列表
|
||||
|
||||
|
@ -38,6 +38,31 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
|
|||
|chinese_db_crnn_mobile|超轻量级中文OCR模型|[inference模型](https://paddleocr.bj.bcebos.com/ch_models/ch_det_mv3_db_infer.tar) / [预训练模型](https://paddleocr.bj.bcebos.com/ch_models/ch_det_mv3_db.tar)|[inference模型](https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_infer.tar) / [预训练模型](https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn.tar)|[inference模型](https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_enhance_infer.tar) / [预训练模型](https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_enhance.tar)
|
||||
|chinese_db_crnn_server|通用中文OCR模型|[inference模型](https://paddleocr.bj.bcebos.com/ch_models/ch_det_r50_vd_db_infer.tar) / [预训练模型](https://paddleocr.bj.bcebos.com/ch_models/ch_det_r50_vd_db.tar)|[inference模型](https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_infer.tar) / [预训练模型](https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn.tar)|[inference模型](https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_enhance_infer.tar) / [预训练模型](https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_enhance.tar)
|
||||
|
||||
## 文档教程
|
||||
- [快速安装](./doc/doc_ch/installation.md)
|
||||
- [中文OCR模型快速使用](./doc/doc_ch/quickstart.md)
|
||||
- [算法介绍](#算法介绍)
|
||||
- 模型训练/评估
|
||||
- [文本检测](./doc/doc_ch/detection.md)
|
||||
- [文本识别](./doc/doc_ch/recognition.md)
|
||||
- [yml参数配置文件介绍](./doc/doc_ch/config.md)
|
||||
- 预测部署
|
||||
- [基于Python预测引擎推理](./doc/doc_ch/inference.md)
|
||||
- 基于C++预测引擎推理(comming soon)
|
||||
- [服务部署](./doc/doc_ch/serving.md)
|
||||
- [端侧部署](./deploy/lite/readme.md)
|
||||
- [数据集](./doc/doc_ch/datasets.md)
|
||||
- [FAQ](#FAQ)
|
||||
- 效果展示
|
||||
- [超轻量级中文OCR效果展示](#超轻量级中文OCR效果展示)
|
||||
- [通用中文OCR效果展示](#通用中文OCR效果展示)
|
||||
- [支持空格的中文OCR效果展示](#支持空格的中文OCR效果展示)
|
||||
- [技术交流群](#欢迎加入PaddleOCR技术交流群)
|
||||
- [参考文献](./doc/doc_ch/reference.md)
|
||||
- [许可证书](#许可证书)
|
||||
- [贡献代码](#贡献代码)
|
||||
|
||||
<a name="算法介绍"></a>
|
||||
## 算法介绍
|
||||
### 1.文本检测算法
|
||||
|
||||
|
@ -98,29 +123,6 @@ PaddleOCR文本识别算法的训练和使用请参考文档教程中[模型训
|
|||
### 3.端到端OCR算法
|
||||
- [ ] [End2End-PSL](https://arxiv.org/abs/1909.07808)(百度自研, comming soon)
|
||||
|
||||
## 文档教程
|
||||
- [快速安装](./doc/doc_ch/installation.md)
|
||||
- [中文OCR模型快速使用](./doc/doc_ch/quickstart.md)
|
||||
- 模型训练/评估
|
||||
- [文本检测](./doc/doc_ch/detection.md)
|
||||
- [文本识别](./doc/doc_ch/recognition.md)
|
||||
- [yml参数配置文件介绍](./doc/doc_ch/config.md)
|
||||
- 预测部署
|
||||
- [基于Python预测引擎推理](./doc/doc_ch/inference.md)
|
||||
- 基于C++预测引擎推理(comming soon)
|
||||
- [服务部署](./doc/doc_ch/serving.md)
|
||||
- [端侧部署](./deploy/lite/readme.md)
|
||||
- [数据集](./doc/doc_ch/datasets.md)
|
||||
- [FAQ](#FAQ)
|
||||
- 效果展示
|
||||
- [超轻量级中文OCR效果展示](#超轻量级中文OCR效果展示)
|
||||
- [通用中文OCR效果展示](#通用中文OCR效果展示)
|
||||
- [支持空格的中文OCR效果展示](#支持空格的中文OCR效果展示)
|
||||
- [技术交流群](#欢迎加入PaddleOCR技术交流群)
|
||||
- [参考文献](./doc/doc_ch/reference.md)
|
||||
- [许可证书](#许可证书)
|
||||
- [贡献代码](#贡献代码)
|
||||
|
||||
## 效果展示
|
||||
|
||||
<a name="超轻量级中文OCR效果展示"></a>
|
||||
|
|
|
@ -14,6 +14,7 @@ Global:
|
|||
character_type: en
|
||||
loss_type: ctc
|
||||
distort: true
|
||||
debug: false
|
||||
reader_yml: ./configs/rec/rec_icdar15_reader.yml
|
||||
pretrain_weights: ./pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy
|
||||
checkpoints:
|
||||
|
|
|
@ -48,3 +48,4 @@ PaddleOCR已完成Windows和Mac系统适配,运行时注意两点:1、在[
|
|||
|
||||
11. **自定义字典训练的模型,识别结果出现字典里没出现的字**
|
||||
预测时没有设置采用的自定义字典路径。设置方法是在预测时,通过增加输入参数rec_char_dict_path来设置。
|
||||
|
||||
|
|
|
@ -117,12 +117,16 @@ def main(args):
|
|||
image_file_list = get_image_file_list(args.image_dir)
|
||||
text_sys = TextSystem(args)
|
||||
is_visualize = True
|
||||
tackle_img_num = 0
|
||||
for image_file in image_file_list:
|
||||
img = cv2.imread(image_file)
|
||||
if img is None:
|
||||
logger.info("error in loading image:{}".format(image_file))
|
||||
continue
|
||||
starttime = time.time()
|
||||
tackle_img_num += 1
|
||||
if not args.use_gpu and tackle_img_num % 30 == 0:
|
||||
text_sys = TextSystem(args)
|
||||
dt_boxes, rec_res = text_sys(img)
|
||||
elapse = time.time() - starttime
|
||||
print("Predict time of %s: %.3fs" % (image_file, elapse))
|
||||
|
|
|
@ -75,6 +75,8 @@ class AttrDict(dict):
|
|||
|
||||
global_config = AttrDict()
|
||||
|
||||
default_config = {'Global': {'debug': False, }}
|
||||
|
||||
|
||||
def load_config(file_path):
|
||||
"""
|
||||
|
@ -85,6 +87,7 @@ def load_config(file_path):
|
|||
|
||||
Returns: global config
|
||||
"""
|
||||
merge_config(default_config)
|
||||
_, ext = os.path.splitext(file_path)
|
||||
assert ext in ['.yml', '.yaml'], "only support yaml files for now"
|
||||
merge_config(yaml.load(open(file_path), Loader=yaml.Loader))
|
||||
|
|
|
@ -43,6 +43,7 @@ logger = initial_logger()
|
|||
from ppocr.data.reader_main import reader_main
|
||||
from ppocr.utils.save_load import init_model
|
||||
from ppocr.utils.character import CharacterOps
|
||||
from paddle.fluid.contrib.model_stat import summary
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -87,6 +88,14 @@ def main():
|
|||
# compile program for multi-devices
|
||||
train_compile_program = program.create_multi_devices_program(
|
||||
train_program, train_opt_loss_name)
|
||||
|
||||
# dump mode structure
|
||||
if config['Global']['debug']:
|
||||
if 'Attention' in config['Head'].keys():
|
||||
logger.warning('Does not suport dump attention...')
|
||||
else:
|
||||
summary(train_program)
|
||||
|
||||
init_model(config, train_program, exe)
|
||||
|
||||
train_info_dict = {'compile_program':train_compile_program,\
|
||||
|
|
Loading…
Reference in New Issue