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
c85036dd
Commit
c85036dd
authored
May 14, 2020
by
tink2123
Browse files
change pretrain and label path
parent
7be2882f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
doc/config.md
doc/config.md
+11
-11
doc/recognition.md
doc/recognition.md
+13
-1
No files found.
doc/config.md
View file @
c85036dd
...
...
@@ -12,18 +12,18 @@
| 字段 | 用途 | 默认值 | 备注 |
| :----------------------: | :---------------------: | :--------------: | :--------------------: |
| algorithm | 设置算法 | CRNN | 选择模型,支持模型请参考
[
简介
](
)
|
| algorithm | 设置算法 | CRNN | 选择模型,支持模型请参考
[
简介
](
../../README.md
)
|
| use_gpu | 设置代码运行场所 | true |
\
|
| epoch_num | 最大训练epoch数 | 3000 |
\
|
| log_smooth_window | 滑动窗口大小 | 20 |
\
|
| print_batch_step | 设置打印log间隔 | 10 |
\
|
| save_model_dir | 设置模型保存路径 | output/rec_CRNN |
\
|
| save_epoch_step | 设置模型保存间隔 | 3 |
\
|
| eval_batch_step | 设置模型评估间隔 | 2000 |
\
|
|train_batch_size_per_card | 设置训练时单卡batch size | 256 |
\
|
| test_batch_size_per_card | 设置评估时单卡batch size | 256 |
\
|
| image_shape | 设置输入图片尺寸 | [3, 32, 100] |
\
|
| max_text_length | 设置文本最大长度 | 25 |
\
|
| epoch_num | 最大训练epoch数 | 3000 |
\
|
| log_smooth_window | 滑动窗口大小 | 20 |
\
|
| print_batch_step | 设置打印log间隔 | 10 |
\
|
| save_model_dir | 设置模型保存路径 | output/rec_CRNN |
\
|
| save_epoch_step | 设置模型保存间隔 | 3 |
\
|
| eval_batch_step | 设置模型评估间隔 | 2000 |
\
|
|train_batch_size_per_card | 设置训练时单卡batch size | 256 |
\
|
| test_batch_size_per_card | 设置评估时单卡batch size | 256 |
\
|
| image_shape | 设置输入图片尺寸 | [3, 32, 100] |
\
|
| max_text_length | 设置文本最大长度 | 25 |
\
|
| character_type | 设置字符类型 | ch | en/ch, en时将使用默认dict,ch时使用自定义dict|
| character_dict_path | 设置字典路径 | ./ppocr/utils/ic15_dict.txt |
\
|
| loss_type | 设置 loss 类型 | ctc | 支持两种loss: ctc / attention |
...
...
doc/recognition.md
View file @
c85036dd
...
...
@@ -98,6 +98,18 @@ word_dict.txt 每行有一个单字,将字符与数字索引映射在一起,
PaddleOCR提供了训练脚本、评估脚本和预测脚本,本节将以 CRNN 识别模型为例:
首先下载pretrain model,您可以下载训练好的模型在 icdar2015 数据上进行finetune
``
cd PaddleOCR/
# 下载MobileNetV3的预训练模型
wget -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/rec_mv3_none_bilstm_ctc.tar
# 解压模型参数
cd pretrain_models
tar -xf rec_mv3_none_bilstm_ctc.tar && rm -rf rec_mv3_none_bilstm_ctc.tar
```
开始训练:
```
# 设置PYTHONPATH路径
export PYTHONPATH=$PYTHONPATH:.
...
...
@@ -106,7 +118,7 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3
python3 tools/train.py -c configs/rec/rec_icdar15_train.yml
```
PaddleOCR支持训练和评估交替进行, 可以在
`configs/rec/rec_icdar15_train.yml`
中修改
`eval_batch_step`
设置评估频率,默认每
20
00个iter评估一次。评估过程中默认将最佳acc模型,保存为
`output/rec_CRNN/best_accuracy`
。
PaddleOCR支持训练和评估交替进行, 可以在 `
configs/rec/rec_icdar15_train.yml
` 中修改 `
eval_batch_step
` 设置评估频率,默认每
5
00个iter评估一次。评估过程中默认将最佳acc模型,保存为 `
output/rec_CRNN/best_accuracy
` 。
如果验证集很大,测试将会比较耗时,建议减少评估次数,或训练完再进行评估。
...
...
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