Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
8f22d440
Commit
8f22d440
authored
May 27, 2022
by
LDOUBLEV
Browse files
add faq
parent
767fad23
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
doc/doc_ch/FAQ.md
doc/doc_ch/FAQ.md
+25
-0
No files found.
doc/doc_ch/FAQ.md
View file @
8f22d440
...
@@ -455,6 +455,19 @@ A:以检测中的resnet骨干网络为例,图像输入网络之后,需要
...
@@ -455,6 +455,19 @@ A:以检测中的resnet骨干网络为例,图像输入网络之后,需要
A:可以在命令中加入 --det_db_unclip_ratio ,参数定义位置,这个参数是检测后处理时控制文本框大小的,默认1.6,可以尝试改成2.5或者更大,反之,如果觉得文本框不够紧凑,也可以把该参数调小。
A:可以在命令中加入 --det_db_unclip_ratio ,参数定义位置,这个参数是检测后处理时控制文本框大小的,默认1.6,可以尝试改成2.5或者更大,反之,如果觉得文本框不够紧凑,也可以把该参数调小。
#### Q:PP-OCR文本检测出现明显漏检,该如何调整参数或者训练。
A:以
[
#issue5851
](
https://github.com/PaddlePaddle/PaddleOCR/issues/5815
)
为例,文字出现漏检时,先分析问题原因。
首先,在
[
后处理处
](
https://github.com/PaddlePaddle/PaddleOCR/blob/767fad23a2b217f775f3c32314ab8b781966671c/ppocr/postprocess/db_postprocess.py#L177
)
添加如下代码,可视化模型对文字的分割区域:
```
import cv2
im = np.array(segmentation[0]*255).astype(np.uint8)
cv2.imwrite("db_seg_vis.jpg", im)
```
如果模型在漏检文字区域有分割区域,但是没有生成框,此类情况多为文字太小,文字弯曲,或者某一行开头的文字过大等等。可减小DB后处理参数
[
det_db_thresh
](
https://github.com/PaddlePaddle/PaddleOCR/blob/767fad23a2b217f775f3c32314ab8b781966671c/tools/infer/utility.py#L52
)
和
[
det_db_box_thresh
](
https://github.com/PaddlePaddle/PaddleOCR/blob/767fad23a2b217f775f3c32314ab8b781966671c/tools/infer/utility.py#L53
)
,或者设置
[
use_dilation
](
https://github.com/PaddlePaddle/PaddleOCR/blob/767fad23a2b217f775f3c32314ab8b781966671c/tools/infer/utility.py#L56
)
为True扩大文字分割区域。
如果模型在漏检文字区域没有分割区域,是模型对此类数据没有训练好,建议用PP-OCR的模型在你的数据场景上finetune。
<a
name=
"27"
></a>
<a
name=
"27"
></a>
### 2.7 模型结构
### 2.7 模型结构
...
@@ -839,3 +852,15 @@ nvidia-smi --lock-gpu-clocks=1590 -i 0
...
@@ -839,3 +852,15 @@ nvidia-smi --lock-gpu-clocks=1590 -i 0
#### Q: 预测时显存爆炸、内存泄漏问题?
#### Q: 预测时显存爆炸、内存泄漏问题?
**A**
: 打开显存/内存优化开关
`enable_memory_optim`
可以解决该问题,相关代码已合入,
[
查看详情
](
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/tools/infer/utility.py#L153
)
。
**A**
: 打开显存/内存优化开关
`enable_memory_optim`
可以解决该问题,相关代码已合入,
[
查看详情
](
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/tools/infer/utility.py#L153
)
。
#### Q: TRT预测报错:InvalidArgumentError: some trt inputs dynamic shape info not set, check the INFO log above for more details.
**A**
: PP-OCR的模型采用动态shape预测,因为TRT子图划分问题,需要设置额外参数的shape;
首先,屏蔽此行代码
[
config.disable_glog_info()
](
https://github.com/PaddlePaddle/PaddleOCR/blob/767fad23a2b217f775f3c32314ab8b781966671c/tools/infer/utility.py#L306
)
输出日志,重新预测,根据报错信息中的提示设置某些参数的动态shape。
假设报错信息中:
trt input [lstm_1.tmp_0] dynamic shape info not set, please check and retry.
可以参考
[
检测模型里设置动态shape的方式
](
https://github.com/PaddlePaddle/PaddleOCR/blob/8de06d2370e81e0ee1473d17925fb2e05295a0fe/tools/infer/utility.py#L268-L270
)
设置lstm_1.tmp_0的动态shape,识别模型的动态shape在
[
这里
](
https://github.com/PaddlePaddle/PaddleOCR/blob/8de06d2370e81e0ee1473d17925fb2e05295a0fe/tools/infer/utility.py#L275-L277
)
;
如果不清楚lstm_1.tmp_0的shape是多少,可以把inference.pdmodel 放在网页 https://netron.app/ 里可视化,搜索lstm_1.tmp_0 查看该参数的shape信息。
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment