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
a3b29192
"doc/vscode:/vscode.git/clone" did not exist on "6a8798ef88119c2b50feefe0544be3505b64770c"
Commit
a3b29192
authored
Aug 16, 2020
by
tink2123
Browse files
polish code
parent
d0d5de7f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
doc/doc_ch/config.md
doc/doc_ch/config.md
+3
-0
ppocr/modeling/architectures/rec_model.py
ppocr/modeling/architectures/rec_model.py
+3
-0
tools/eval_utils/eval_rec_utils.py
tools/eval_utils/eval_rec_utils.py
+3
-3
No files found.
doc/doc_ch/config.md
View file @
a3b29192
...
@@ -32,6 +32,9 @@
...
@@ -32,6 +32,9 @@
| loss_type | 设置 loss 类型 | ctc | 支持两种loss: ctc / attention |
| loss_type | 设置 loss 类型 | ctc | 支持两种loss: ctc / attention |
| distort | 设置是否使用数据增强 | false | 设置为true时,将在训练时随机进行扰动,支持的扰动操作可阅读
[
img_tools.py
](
https://github.com/PaddlePaddle/PaddleOCR/blob/develop/ppocr/data/rec/img_tools.py
)
|
| distort | 设置是否使用数据增强 | false | 设置为true时,将在训练时随机进行扰动,支持的扰动操作可阅读
[
img_tools.py
](
https://github.com/PaddlePaddle/PaddleOCR/blob/develop/ppocr/data/rec/img_tools.py
)
|
| use_space_char | 设置是否识别空格 | false | 仅在 character_type=ch 时支持空格 |
| use_space_char | 设置是否识别空格 | false | 仅在 character_type=ch 时支持空格 |
| average_window | ModelAverage优化器中的窗口长度计算比例 | 0.15 | 目前仅应用与SRN |
| max_average_window | 平均值计算窗口长度的最大值 | 15625 | 推荐设置为一轮训练中mini-batchs的数目|
| min_average_window | 平均值计算窗口长度的最小值 | 10000 |
\
|
| reader_yml | 设置reader配置文件 | ./configs/rec/rec_icdar15_reader.yml |
\
|
| reader_yml | 设置reader配置文件 | ./configs/rec/rec_icdar15_reader.yml |
\
|
| pretrain_weights | 加载预训练模型路径 | ./pretrain_models/CRNN/best_accuracy |
\
|
| pretrain_weights | 加载预训练模型路径 | ./pretrain_models/CRNN/best_accuracy |
\
|
| checkpoints | 加载模型参数路径 | None | 用于中断后加载参数继续训练 |
| checkpoints | 加载模型参数路径 | None | 用于中断后加载参数继续训练 |
...
...
ppocr/modeling/architectures/rec_model.py
View file @
a3b29192
...
@@ -213,6 +213,9 @@ class RecModel(object):
...
@@ -213,6 +213,9 @@ class RecModel(object):
predict
=
predicts
[
'predict'
]
predict
=
predicts
[
'predict'
]
if
self
.
loss_type
==
"ctc"
:
if
self
.
loss_type
==
"ctc"
:
predict
=
fluid
.
layers
.
softmax
(
predict
)
predict
=
fluid
.
layers
.
softmax
(
predict
)
if
self
.
loss_type
==
"srn"
:
logger
.
infor
(
"Warning! SRN does not support export model currently"
)
return
[
image
,
{
'decoded_out'
:
decoded_out
,
'predicts'
:
predict
}]
return
[
image
,
{
'decoded_out'
:
decoded_out
,
'predicts'
:
predict
}]
else
:
else
:
predict
=
predicts
[
'predict'
]
predict
=
predicts
[
'predict'
]
...
...
tools/eval_utils/eval_rec_utils.py
View file @
a3b29192
...
@@ -69,7 +69,7 @@ def eval_rec_run(exe, config, eval_info_dict, mode):
...
@@ -69,7 +69,7 @@ def eval_rec_run(exe, config, eval_info_dict, mode):
return_numpy
=
False
)
return_numpy
=
False
)
preds
=
np
.
array
(
outs
[
0
])
preds
=
np
.
array
(
outs
[
0
])
if
preds
.
shape
[
1
]
!
=
1
:
if
config
[
'Global'
][
'loss_type'
]
=
=
"attention"
:
preds
,
preds_lod
=
convert_rec_attention_infer_res
(
preds
)
preds
,
preds_lod
=
convert_rec_attention_infer_res
(
preds
)
else
:
else
:
preds_lod
=
outs
[
0
].
lod
()[
0
]
preds_lod
=
outs
[
0
].
lod
()[
0
]
...
@@ -123,8 +123,8 @@ def eval_rec_run(exe, config, eval_info_dict, mode):
...
@@ -123,8 +123,8 @@ def eval_rec_run(exe, config, eval_info_dict, mode):
def
test_rec_benchmark
(
exe
,
config
,
eval_info_dict
):
def
test_rec_benchmark
(
exe
,
config
,
eval_info_dict
):
" Evaluate lmdb dataset "
" Evaluate lmdb dataset "
eval_data_list
=
[
'IIIT5k_3000'
,
'SVT'
,
'IC03_860'
,
'IC03_867'
,
\
eval_data_list
=
[
'IIIT5k_3000'
,
'SVT'
,
'IC03_860'
,
'IC03_867'
,
\
'IC13_857'
,
'IC13_1015'
,
'IC15_1811'
,
'IC15_2077'
,
'SVTP'
,
'CUTE80'
]
'IC13_857'
,
'IC13_1015'
,
'IC15_1811'
,
'IC15_2077'
,
'SVTP'
,
'CUTE80'
]
eval_data_dir
=
config
[
'TestReader'
][
'lmdb_sets_dir'
]
eval_data_dir
=
config
[
'TestReader'
][
'lmdb_sets_dir'
]
total_evaluation_data_number
=
0
total_evaluation_data_number
=
0
total_correct_number
=
0
total_correct_number
=
0
...
...
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