-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize PaddleOCR #3
Conversation
LDOUBLEV
commented
May 11, 2020
•
edited
Loading
edited
- add checkpoints in yml
- add doc directory
- supporting sort predict box
- add detection fluid inference
- masked memory optimization and ir optimization options in utility.py
doc/detection.md
Outdated
|
||
## 3.2 快速启动训练 | ||
|
||
首先下载pretrain model,目前支持两种backbone,分别是MobileNetV3、ResNet50,您可以根据需求使用PaddleClas中的模型更换 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要再详细说明下网络结构,MobileNetV3有10个,ResNet50是ResNet50_vd
|
||
PaddleOCR计算三个OCR检测相关的指标,分别是:Precision、Recall、Hmean。 | ||
|
||
运行如下代码,根据配置文件det_db_mv3.yml中save_res_path指定的测试集检测结果文件,计算评估指标。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码里面需要注明评估来源于DB repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
doc/detection.md
Outdated
运行如下代码,根据配置文件det_db_mv3.yml中save_res_path指定的测试集检测结果文件,计算评估指标。 | ||
|
||
``` | ||
python3 tools/eval.py -c configs/det/det_db_mv3.yml -o checkpoints ./output/best_accuracy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这块为什么使用checkpoints,而不是pretrainedweights?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretrained weights是加载的backbone的模型参数,在评估或者测试时要加载训练好的参数文件,换成checkpoints是不是更能区分些?
|
||
我们提供了PaddleOCR开发环境的docker,您可以pull我们提供的docker运行PaddleOCR的环境。 | ||
|
||
1. 准备docker环境。第一次使用这个镜像,会自动下载该镜像,请耐心等待。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
自动下载删掉,需要让用户操作下载吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
换了一个官方镜像,测试了可以PaddleOCR可以正常运行,不需要用户再去手动下载。
tools/infer/utility.py
Outdated
@@ -99,14 +99,15 @@ def create_predictor(args, mode): | |||
config.disable_gpu() | |||
|
|||
config.disable_glog_info() | |||
config.switch_ir_optim(args.ir_optim) | |||
# config.switch_ir_optim(args.ir_optim) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接删了吧,包括trt和fp16的参数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
README.md
Outdated
OCR algorithms with PaddlePaddle (still under develop) | ||
|
||
# 简介 | ||
PaddleOCR旨在打造一套丰富、领先、且实用的文字检测、识别模型/工具库,助力使用者训练出更好的模型,并应用落地。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCR工具库
README.md
Outdated
|
||
## 文档教程 | ||
- [快速安装](./doc/installation.md) | ||
- [文本识别模型训练/评估/预测](./doc/detection.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改目录
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
添加快速开始
export model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
- [文本识别模型训练/评估/预测](./doc/detection.md) | ||
- [文本预测模型训练/评估/预测](./doc/recognition.md) | ||
|
||
## 特性: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
特性上移
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
- [SAST](https://arxiv.org/abs/1908.05498) | ||
|
||
算法效果: | ||
|模型|骨干网络|数据集|Hmean| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
表格里添加模型引用,然后todo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
数据集去掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -12,6 +12,7 @@ Global: | |||
image_shape: [3, 640, 640] | |||
reader_yml: ./configs/det/det_db_icdar15_reader.yml | |||
pretrain_weights: ./pretrain_models/MobileNetV3_pretrained/MobileNetV3_large_x0_5_pretrained/ | |||
checkpoints: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确认对不对?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
doc/detection.md
Outdated
@@ -0,0 +1,78 @@ | |||
# 文字检测 | |||
|
|||
本节以icdar15数据集为例,介绍PaddleOCR中检测模型的使用方式。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用方式展开
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
doc/detection.md
Outdated
" 图像文件名 json.dumps编码的图像标注信息" | ||
ch4_test_images/img_61.jpg [{"transcription": "MASA", "points": [[310, 104], [416, 141], [418, 216], [312, 179]], ...}] | ||
``` | ||
json.dumps编码前的图像标注信息是包含多个字典的list,字典中的points表示文本框的位置,如果您想在其他数据集上训练PaddleOCR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
说明检测不需要文本信息,points 四点
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x1,y1,x2,y2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
doc/installation.md
Outdated
pip3 install -r requirements.txt | ||
``` | ||
|
||
## 快速运行 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
快速运行删掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
# NOTE(paddle-dev): All of these flags should be | ||
# set before `import paddle`. Otherwise, it would | ||
# not take any effect. | ||
set_paddle_flags( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
暂定不删,等更新1.8代码时更新
tools/infer_det.py
Outdated
|
||
|
||
def simple_reader(img_file, config): | ||
imgs_lists = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
读图使用utility的独立函数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done,读图函数封装了一个函数,位置在tools/infer/utility.py-get_image_file_list()
test=develop
* update code & doc
add relative path