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
8bdc050c
Unverified
Commit
8bdc050c
authored
Oct 26, 2021
by
Bin Lu
Committed by
GitHub
Oct 26, 2021
Browse files
Merge branch 'PaddlePaddle:dygraph' into dygraph
parents
7da39b93
cc01a59b
Changes
78
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
46 additions
and
68 deletions
+46
-68
configs/rec/multi_language/rec_german_lite_train.yml
configs/rec/multi_language/rec_german_lite_train.yml
+0
-1
configs/rec/multi_language/rec_japan_lite_train.yml
configs/rec/multi_language/rec_japan_lite_train.yml
+0
-1
configs/rec/multi_language/rec_korean_lite_train.yml
configs/rec/multi_language/rec_korean_lite_train.yml
+0
-1
configs/rec/multi_language/rec_latin_lite_train.yml
configs/rec/multi_language/rec_latin_lite_train.yml
+0
-1
configs/rec/rec_icdar15_train.yml
configs/rec/rec_icdar15_train.yml
+0
-1
configs/rec/rec_mtb_nrtr.yml
configs/rec/rec_mtb_nrtr.yml
+2
-3
configs/rec/rec_mv3_none_bilstm_ctc.yml
configs/rec/rec_mv3_none_bilstm_ctc.yml
+1
-2
configs/rec/rec_mv3_none_none_ctc.yml
configs/rec/rec_mv3_none_none_ctc.yml
+0
-1
configs/rec/rec_mv3_tps_bilstm_att.yml
configs/rec/rec_mv3_tps_bilstm_att.yml
+1
-2
configs/rec/rec_mv3_tps_bilstm_ctc.yml
configs/rec/rec_mv3_tps_bilstm_ctc.yml
+0
-1
configs/rec/rec_r31_sar.yml
configs/rec/rec_r31_sar.yml
+0
-1
configs/rec/rec_r34_vd_none_bilstm_ctc.yml
configs/rec/rec_r34_vd_none_bilstm_ctc.yml
+1
-2
configs/rec/rec_r34_vd_none_none_ctc.yml
configs/rec/rec_r34_vd_none_none_ctc.yml
+0
-1
configs/rec/rec_r34_vd_tps_bilstm_att.yml
configs/rec/rec_r34_vd_tps_bilstm_att.yml
+1
-2
configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
+1
-2
configs/rec/rec_r50_fpn_srn.yml
configs/rec/rec_r50_fpn_srn.yml
+1
-2
configs/rec/rec_resnet_stn_bilstm_att.yml
configs/rec/rec_resnet_stn_bilstm_att.yml
+1
-2
doc/doc_ch/config.md
doc/doc_ch/config.md
+18
-20
doc/doc_ch/inference.md
doc/doc_ch/inference.md
+7
-7
doc/doc_ch/recognition.md
doc/doc_ch/recognition.md
+12
-15
No files found.
configs/rec/multi_language/rec_german_lite_train.yml
View file @
8bdc050c
...
@@ -16,7 +16,6 @@ Global:
...
@@ -16,7 +16,6 @@ Global:
infer_img
:
infer_img
:
# for data or label process
# for data or label process
character_dict_path
:
ppocr/utils/dict/german_dict.txt
character_dict_path
:
ppocr/utils/dict/german_dict.txt
character_type
:
german
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/multi_language/rec_japan_lite_train.yml
View file @
8bdc050c
...
@@ -16,7 +16,6 @@ Global:
...
@@ -16,7 +16,6 @@ Global:
infer_img
:
infer_img
:
# for data or label process
# for data or label process
character_dict_path
:
ppocr/utils/dict/japan_dict.txt
character_dict_path
:
ppocr/utils/dict/japan_dict.txt
character_type
:
japan
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/multi_language/rec_korean_lite_train.yml
View file @
8bdc050c
...
@@ -16,7 +16,6 @@ Global:
...
@@ -16,7 +16,6 @@ Global:
infer_img
:
infer_img
:
# for data or label process
# for data or label process
character_dict_path
:
ppocr/utils/dict/korean_dict.txt
character_dict_path
:
ppocr/utils/dict/korean_dict.txt
character_type
:
korean
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/multi_language/rec_latin_lite_train.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
use_visualdl
:
false
use_visualdl
:
false
infer_img
:
null
infer_img
:
null
character_dict_path
:
ppocr/utils/dict/latin_dict.txt
character_dict_path
:
ppocr/utils/dict/latin_dict.txt
character_type
:
latin
max_text_length
:
25
max_text_length
:
25
infer_mode
:
false
infer_mode
:
false
use_space_char
:
true
use_space_char
:
true
...
...
configs/rec/rec_icdar15_train.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
ppocr/utils/en_dict.txt
character_dict_path
:
ppocr/utils/en_dict.txt
character_type
:
EN
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_mtb_nrtr.yml
View file @
8bdc050c
...
@@ -14,11 +14,10 @@ Global:
...
@@ -14,11 +14,10 @@ Global:
use_visualdl
:
False
use_visualdl
:
False
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
ppocr/utils/EN_symbol_dict.txt
character_type
:
EN_symbol
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
Tru
e
use_space_char
:
Fals
e
save_res_path
:
./output/rec/predicts_nrtr.txt
save_res_path
:
./output/rec/predicts_nrtr.txt
Optimizer
:
Optimizer
:
...
...
configs/rec/rec_mv3_none_bilstm_ctc.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_mv3_none_none_ctc.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_mv3_tps_bilstm_att.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words/ch/word_1.jpg
infer_img
:
doc/imgs_words/ch/word_1.jpg
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_mv3_tps_bilstm_ctc.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_r31_sar.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
infer_img
:
# for data or label process
# for data or label process
character_dict_path
:
ppocr/utils/dict90.txt
character_dict_path
:
ppocr/utils/dict90.txt
character_type
:
EN_symbol
max_text_length
:
30
max_text_length
:
30
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_r34_vd_none_bilstm_ctc.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_r34_vd_none_none_ctc.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_r34_vd_tps_bilstm_att.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words/ch/word_1.jpg
infer_img
:
doc/imgs_words/ch/word_1.jpg
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
configs/rec/rec_r50_fpn_srn.yml
View file @
8bdc050c
...
@@ -15,7 +15,6 @@ Global:
...
@@ -15,7 +15,6 @@ Global:
infer_img
:
doc/imgs_words/ch/word_1.jpg
infer_img
:
doc/imgs_words/ch/word_1.jpg
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
character_type
:
en
max_text_length
:
25
max_text_length
:
25
num_heads
:
8
num_heads
:
8
infer_mode
:
False
infer_mode
:
False
...
...
configs/rec/rec_resnet_stn_bilstm_att.yml
View file @
8bdc050c
...
@@ -14,8 +14,7 @@ Global:
...
@@ -14,8 +14,7 @@ Global:
use_visualdl
:
False
use_visualdl
:
False
infer_img
:
doc/imgs_words_en/word_10.png
infer_img
:
doc/imgs_words_en/word_10.png
# for data or label process
# for data or label process
character_dict_path
:
character_dict_path
:
ppocr/utils/EN_symbol_dict.txt
character_type
:
EN_symbol
max_text_length
:
100
max_text_length
:
100
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
...
doc/doc_ch/config.md
View file @
8bdc050c
...
@@ -37,10 +37,9 @@
...
@@ -37,10 +37,9 @@
| checkpoints | 加载模型参数路径 | None | 用于中断后加载参数继续训练 |
| checkpoints | 加载模型参数路径 | None | 用于中断后加载参数继续训练 |
| use_visualdl | 设置是否启用visualdl进行可视化log展示 | False |
[
教程地址
](
https://www.paddlepaddle.org.cn/paddle/visualdl
)
|
| use_visualdl | 设置是否启用visualdl进行可视化log展示 | False |
[
教程地址
](
https://www.paddlepaddle.org.cn/paddle/visualdl
)
|
| infer_img | 设置预测图像路径或文件夹路径 | ./infer_img |
\|
| infer_img | 设置预测图像路径或文件夹路径 | ./infer_img |
\|
| character_dict_path | 设置字典路径 | ./ppocr/utils/ppocr_keys_v1.txt |
\
|
| character_dict_path | 设置字典路径 | ./ppocr/utils/ppocr_keys_v1.txt |
如果为空,则默认使用小写字母+数字作为字典
|
| max_text_length | 设置文本最大长度 | 25 |
\
|
| max_text_length | 设置文本最大长度 | 25 |
\
|
| character_type | 设置字符类型 | ch | en/ch, en时将使用默认dict,ch时使用自定义dict|
| use_space_char | 设置是否识别空格 | True | |
| use_space_char | 设置是否识别空格 | True | 仅在 character_type=ch 时支持空格 |
| label_list | 设置方向分类器支持的角度 | ['0','180'] | 仅在方向分类器中生效 |
| label_list | 设置方向分类器支持的角度 | ['0','180'] | 仅在方向分类器中生效 |
| save_res_path | 设置检测模型的结果保存地址 | ./output/det_db/predicts_db.txt | 仅在检测模型中生效 |
| save_res_path | 设置检测模型的结果保存地址 | ./output/det_db/predicts_db.txt | 仅在检测模型中生效 |
...
@@ -191,7 +190,6 @@ PaddleOCR目前已支持80种(除中文外)语种识别,`configs/rec/multi
...
@@ -191,7 +190,6 @@ PaddleOCR目前已支持80种(除中文外)语种识别,`configs/rec/multi
use_gpu: True
use_gpu: True
epoch_num: 500
epoch_num: 500
...
...
character_type: it # 需要识别的语种
character_dict_path: {path/of/dict} # 字典文件所在路径
character_dict_path: {path/of/dict} # 字典文件所在路径
Train:
Train:
...
@@ -212,17 +210,17 @@ PaddleOCR目前已支持80种(除中文外)语种识别,`configs/rec/multi
...
@@ -212,17 +210,17 @@ PaddleOCR目前已支持80种(除中文外)语种识别,`configs/rec/multi
目前PaddleOCR支持的多语言算法有:
目前PaddleOCR支持的多语言算法有:
| 配置文件 | 算法名称 | backbone | trans | seq | pred | language |
character_type |
| 配置文件 | 算法名称 | backbone | trans | seq | pred | language |
| :--------: | :-------: | :-------: | :-------: | :-----: | :-----: | :-----: |
:-----: |
| :--------: | :-------: | :-------: | :-------: | :-----: | :-----: | :-----: |
| rec_chinese_cht_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 中文繁体 |
chinese_cht|
| rec_chinese_cht_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 中文繁体 |
| rec_en_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 英语(区分大小写) |
EN |
| rec_en_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 英语(区分大小写) |
| rec_french_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 法语 |
french |
| rec_french_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 法语 |
| rec_ger_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 德语 |
german |
| rec_ger_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 德语 |
| rec_japan_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 日语 |
japan |
| rec_japan_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 日语 |
| rec_korean_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 韩语 |
korean |
| rec_korean_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 韩语 |
| rec_latin_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 拉丁字母 |
latin |
| rec_latin_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 拉丁字母 |
| rec_arabic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 阿拉伯字母 |
ar |
| rec_arabic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 阿拉伯字母 |
| rec_cyrillic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 斯拉夫字母 |
cyrillic |
| rec_cyrillic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 斯拉夫字母 |
| rec_devanagari_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 梵文字母 |
devanagari |
| rec_devanagari_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 梵文字母 |
更多支持语种请参考:
[
多语言模型
](
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_ch/multi_languages.md#%E8%AF%AD%E7%A7%8D%E7%BC%A9%E5%86%99
)
更多支持语种请参考:
[
多语言模型
](
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_ch/multi_languages.md#%E8%AF%AD%E7%A7%8D%E7%BC%A9%E5%86%99
)
doc/doc_ch/inference.md
View file @
8bdc050c
...
@@ -273,7 +273,7 @@ python3 tools/export_model.py -c configs/rec/rec_r34_vd_none_bilstm_ctc.yml -o G
...
@@ -273,7 +273,7 @@ python3 tools/export_model.py -c configs/rec/rec_r34_vd_none_bilstm_ctc.yml -o G
CRNN 文本识别模型推理,可以执行如下命令:
CRNN 文本识别模型推理,可以执行如下命令:
```
```
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png" --rec_model_dir="./inference/rec_crnn/" --rec_image_shape="3, 32, 100" --rec_char_
type="en
"
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png" --rec_model_dir="./inference/rec_crnn/" --rec_image_shape="3, 32, 100" --rec_char_
dict_path="./ppocr/utils/ic15_dict.txt
"
```
```


...
@@ -288,7 +288,7 @@ Predicts of ./doc/imgs_words_en/word_336.png:('super', 0.9999073)
...
@@ -288,7 +288,7 @@ Predicts of ./doc/imgs_words_en/word_336.png:('super', 0.9999073)
-
训练时采用的图像分辨率不同,训练上述模型采用的图像分辨率是[3,32,100],而中文模型训练时,为了保证长文本的识别效果,训练时采用的图像分辨率是[3, 32, 320]。预测推理程序默认的的形状参数是训练中文采用的图像分辨率,即[3, 32, 320]。因此,这里推理上述英文模型时,需要通过参数rec_image_shape设置识别图像的形状。
-
训练时采用的图像分辨率不同,训练上述模型采用的图像分辨率是[3,32,100],而中文模型训练时,为了保证长文本的识别效果,训练时采用的图像分辨率是[3, 32, 320]。预测推理程序默认的的形状参数是训练中文采用的图像分辨率,即[3, 32, 320]。因此,这里推理上述英文模型时,需要通过参数rec_image_shape设置识别图像的形状。
-
字符列表,DTRB论文中实验只是针对26个小写英文本母和10个数字进行实验,总共36个字符。所有大小字符都转成了小写字符,不在上面列表的字符都忽略,认为是空格。因此这里没有输入字符字典,而是通过如下命令生成字典.因此在推理时需要设置参数rec_char_
type,指定为英文"en
"。
-
字符列表,DTRB论文中实验只是针对26个小写英文本母和10个数字进行实验,总共36个字符。所有大小字符都转成了小写字符,不在上面列表的字符都忽略,认为是空格。因此这里没有输入字符字典,而是通过如下命令生成字典.因此在推理时需要设置参数rec_char_
dict_path,指定为英文字典"./ppocr/utils/ic15_dict.txt
"。
```
```
self.character_str = "0123456789abcdefghijklmnopqrstuvwxyz"
self.character_str = "0123456789abcdefghijklmnopqrstuvwxyz"
...
@@ -303,15 +303,15 @@ dict_character = list(self.character_str)
...
@@ -303,15 +303,15 @@ dict_character = list(self.character_str)
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png" \
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png" \
--rec_model_dir="./inference/srn/" \
--rec_model_dir="./inference/srn/" \
--rec_image_shape="1, 64, 256" \
--rec_image_shape="1, 64, 256" \
--rec_char_
type="en
" \
--rec_char_
dict_path="./ppocr/utils/ic15_dict.txt
" \
--rec_algorithm="SRN"
--rec_algorithm="SRN"
```
```
### 4. 自定义文本识别字典的推理
### 4. 自定义文本识别字典的推理
如果训练时修改了文本的字典,在使用inference模型预测时,需要通过
`--rec_char_dict_path`
指定使用的字典路径
,并且设置
`rec_char_type=ch`
如果训练时修改了文本的字典,在使用inference模型预测时,需要通过
`--rec_char_dict_path`
指定使用的字典路径
```
```
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png" --rec_model_dir="./your inference model" --rec_image_shape="3, 32, 100"
--rec_char_type="ch"
--rec_char_dict_path="your text dict path"
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png" --rec_model_dir="./your inference model" --rec_image_shape="3, 32, 100" --rec_char_dict_path="your text dict path"
```
```
<a
name=
"多语言模型的推理"
></a>
<a
name=
"多语言模型的推理"
></a>
...
@@ -320,7 +320,7 @@ python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png
...
@@ -320,7 +320,7 @@ python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png
需要通过
`--vis_font_path`
指定可视化的字体路径,
`doc/fonts/`
路径下有默认提供的小语种字体,例如韩文识别:
需要通过
`--vis_font_path`
指定可视化的字体路径,
`doc/fonts/`
路径下有默认提供的小语种字体,例如韩文识别:
```
```
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words/korean/1.jpg" --rec_model_dir="./your inference model"
--rec_char_type="korean"
--rec_char_dict_path="ppocr/utils/dict/korean_dict.txt" --vis_font_path="doc/fonts/korean.ttf"
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words/korean/1.jpg" --rec_model_dir="./your inference model" --rec_char_dict_path="ppocr/utils/dict/korean_dict.txt" --vis_font_path="doc/fonts/korean.ttf"
```
```


...
@@ -388,7 +388,7 @@ python3 tools/infer/predict_system.py --image_dir="./doc/imgs/00018069.jpg" --de
...
@@ -388,7 +388,7 @@ python3 tools/infer/predict_system.py --image_dir="./doc/imgs/00018069.jpg" --de
下面给出基于EAST文本检测和STAR-Net文本识别执行命令:
下面给出基于EAST文本检测和STAR-Net文本识别执行命令:
```
```
python3 tools/infer/predict_system.py --image_dir="./doc/imgs_en/img_10.jpg" --det_model_dir="./inference/det_east/" --det_algorithm="EAST" --rec_model_dir="./inference/starnet/" --rec_image_shape="3, 32, 100" --rec_char_
type="en
"
python3 tools/infer/predict_system.py --image_dir="./doc/imgs_en/img_10.jpg" --det_model_dir="./inference/det_east/" --det_algorithm="EAST" --rec_model_dir="./inference/starnet/" --rec_image_shape="3, 32, 100" --rec_char_
dict_path="./ppocr/utils/ic15_dict.txt
"
```
```
执行命令后,识别结果图像如下:
执行命令后,识别结果图像如下:
...
...
doc/doc_ch/recognition.md
View file @
8bdc050c
...
@@ -159,7 +159,6 @@ PaddleOCR内置了一部分字典,可以按需使用。
...
@@ -159,7 +159,6 @@ PaddleOCR内置了一部分字典,可以按需使用。
-
自定义字典
-
自定义字典
如需自定义dic文件,请在
`configs/rec/rec_icdar15_train.yml`
中添加
`character_dict_path`
字段, 指向您的字典路径。
如需自定义dic文件,请在
`configs/rec/rec_icdar15_train.yml`
中添加
`character_dict_path`
字段, 指向您的字典路径。
并将
`character_type`
设置为
`ch`
。
<a
name=
"支持空格"
></a>
<a
name=
"支持空格"
></a>
### 1.4 添加空格类别
### 1.4 添加空格类别
...
@@ -246,8 +245,6 @@ Global:
...
@@ -246,8 +245,6 @@ Global:
...
...
# 添加自定义字典,如修改字典请将路径指向新字典
# 添加自定义字典,如修改字典请将路径指向新字典
character_dict_path: ppocr/utils/ppocr_keys_v1.txt
character_dict_path: ppocr/utils/ppocr_keys_v1.txt
# 修改字符类型
character_type: ch
...
...
# 识别空格
# 识别空格
use_space_char: True
use_space_char: True
...
@@ -311,18 +308,18 @@ PaddleOCR目前已支持80种(除中文外)语种识别,`configs/rec/multi
...
@@ -311,18 +308,18 @@ PaddleOCR目前已支持80种(除中文外)语种识别,`configs/rec/multi
按语系划分,目前PaddleOCR支持的语种有:
按语系划分,目前PaddleOCR支持的语种有:
| 配置文件 | 算法名称 | backbone | trans | seq | pred | language |
character_type |
| 配置文件 | 算法名称 | backbone | trans | seq | pred | language |
| :--------: | :-------: | :-------: | :-------: | :-----: | :-----: | :-----: |
:-----: |
| :--------: | :-------: | :-------: | :-------: | :-----: | :-----: | :-----: |
| rec_chinese_cht_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 中文繁体 |
chinese_cht|
| rec_chinese_cht_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 中文繁体 |
| rec_en_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 英语(区分大小写) |
EN |
| rec_en_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 英语(区分大小写) |
| rec_french_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 法语 |
french |
| rec_french_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 法语 |
| rec_ger_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 德语 |
german |
| rec_ger_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 德语 |
| rec_japan_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 日语 |
japan |
| rec_japan_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 日语 |
| rec_korean_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 韩语 |
korean |
| rec_korean_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 韩语 |
| rec_latin_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 拉丁字母 |
latin |
| rec_latin_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 拉丁字母 |
| rec_arabic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 阿拉伯字母 |
ar |
| rec_arabic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 阿拉伯字母 |
| rec_cyrillic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 斯拉夫字母 |
cyrillic |
| rec_cyrillic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 斯拉夫字母 |
| rec_devanagari_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 梵文字母 |
devanagari |
| rec_devanagari_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | 梵文字母 |
更多支持语种请参考:
[
多语言模型
](
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_ch/multi_languages.md#%E8%AF%AD%E7%A7%8D%E7%BC%A9%E5%86%99
)
更多支持语种请参考:
[
多语言模型
](
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_ch/multi_languages.md#%E8%AF%AD%E7%A7%8D%E7%BC%A9%E5%86%99
)
...
...
Prev
1
2
3
4
Next
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