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
e50a35e5
"docs/source/en/using-diffusers/reproducibility.md" did not exist on "008c22d334ef978bc51df60de8a66b8613a81035"
Unverified
Commit
e50a35e5
authored
Jul 12, 2020
by
dyning
Committed by
GitHub
Jul 12, 2020
Browse files
Merge branch 'develop' into fixocr
parents
a9a6274a
f2a2f595
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
25 deletions
+45
-25
README.md
README.md
+27
-25
configs/rec/rec_icdar15_train.yml
configs/rec/rec_icdar15_train.yml
+1
-0
doc/doc_ch/FAQ.md
doc/doc_ch/FAQ.md
+1
-0
tools/infer/predict_system.py
tools/infer/predict_system.py
+4
-0
tools/program.py
tools/program.py
+3
-0
tools/train.py
tools/train.py
+9
-0
No files found.
README.md
View file @
e50a35e5
...
@@ -16,7 +16,7 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
...
@@ -16,7 +16,7 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
-
单模型支持中英文数字组合识别、竖排文本识别、长文本识别
-
单模型支持中英文数字组合识别、竖排文本识别、长文本识别
-
检测模型DB(4.1M)+识别模型CRNN(4.5M)
-
检测模型DB(4.1M)+识别模型CRNN(4.5M)
-
实用通用中文OCR模型
-
实用通用中文OCR模型
-
多种预测推理部署方案,包括服务部署和端
测
部署
-
多种预测推理部署方案,包括服务部署和端
侧
部署
-
多种文本检测训练算法,EAST、DB
-
多种文本检测训练算法,EAST、DB
-
多种文本识别训练算法,Rosetta、CRNN、STAR-Net、RARE
-
多种文本识别训练算法,Rosetta、CRNN、STAR-Net、RARE
-
可运行于Linux、Windows、MacOS等多种系统
-
可运行于Linux、Windows、MacOS等多种系统
...
@@ -29,7 +29,7 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
...
@@ -29,7 +29,7 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
-
超轻量级中文OCR在线体验地址:https://www.paddlepaddle.org.cn/hub/scene/ocr
-
超轻量级中文OCR在线体验地址:https://www.paddlepaddle.org.cn/hub/scene/ocr
-
[
中文OCR模型快速使用
](
./doc/doc_ch/quickstart.md
)
-
[
**
中文OCR模型快速使用
**
](
./doc/doc_ch/quickstart.md
)
## 中文OCR模型列表
## 中文OCR模型列表
...
@@ -38,6 +38,31 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
...
@@ -38,6 +38,31 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
|chinese_db_crnn_mobile|超轻量级中文OCR模型|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_det_mv3_db_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_det_mv3_db.tar
)
|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn.tar
)
|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_enhance_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_enhance.tar
)
|chinese_db_crnn_mobile|超轻量级中文OCR模型|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_det_mv3_db_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_det_mv3_db.tar
)
|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn.tar
)
|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_enhance_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_mv3_crnn_enhance.tar
)
|chinese_db_crnn_server|通用中文OCR模型|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_det_r50_vd_db_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_det_r50_vd_db.tar
)
|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn.tar
)
|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_enhance_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_enhance.tar
)
|chinese_db_crnn_server|通用中文OCR模型|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_det_r50_vd_db_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_det_r50_vd_db.tar
)
|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn.tar
)
|
[
inference模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_enhance_infer.tar
)
/
[
预训练模型
](
https://paddleocr.bj.bcebos.com/ch_models/ch_rec_r34_vd_crnn_enhance.tar
)
## 文档教程
-
[
快速安装
](
./doc/doc_ch/installation.md
)
-
[
中文OCR模型快速使用
](
./doc/doc_ch/quickstart.md
)
-
[
算法介绍
](
#算法介绍
)
-
模型训练/评估
-
[
文本检测
](
./doc/doc_ch/detection.md
)
-
[
文本识别
](
./doc/doc_ch/recognition.md
)
-
[
yml参数配置文件介绍
](
./doc/doc_ch/config.md
)
-
预测部署
-
[
基于Python预测引擎推理
](
./doc/doc_ch/inference.md
)
-
基于C++预测引擎推理(comming soon)
-
[
服务部署
](
./doc/doc_ch/serving.md
)
-
[
端侧部署
](
./deploy/lite/readme.md
)
-
[
数据集
](
./doc/doc_ch/datasets.md
)
-
[
FAQ
](
#FAQ
)
-
效果展示
-
[
超轻量级中文OCR效果展示
](
#超轻量级中文OCR效果展示
)
-
[
通用中文OCR效果展示
](
#通用中文OCR效果展示
)
-
[
支持空格的中文OCR效果展示
](
#支持空格的中文OCR效果展示
)
-
[
技术交流群
](
#欢迎加入PaddleOCR技术交流群
)
-
[
参考文献
](
./doc/doc_ch/reference.md
)
-
[
许可证书
](
#许可证书
)
-
[
贡献代码
](
#贡献代码
)
<a
name=
"算法介绍"
></a>
## 算法介绍
## 算法介绍
### 1.文本检测算法
### 1.文本检测算法
...
@@ -98,29 +123,6 @@ PaddleOCR文本识别算法的训练和使用请参考文档教程中[模型训
...
@@ -98,29 +123,6 @@ PaddleOCR文本识别算法的训练和使用请参考文档教程中[模型训
### 3.端到端OCR算法
### 3.端到端OCR算法
-
[
] [End2End-PSL
](
https://arxiv.org/abs/1909.07808
)(
百度自研,
comming soon)
-
[
] [End2End-PSL
](
https://arxiv.org/abs/1909.07808
)(
百度自研,
comming soon)
## 文档教程
-
[
快速安装
](
./doc/doc_ch/installation.md
)
-
[
中文OCR模型快速使用
](
./doc/doc_ch/quickstart.md
)
-
模型训练/评估
-
[
文本检测
](
./doc/doc_ch/detection.md
)
-
[
文本识别
](
./doc/doc_ch/recognition.md
)
-
[
yml参数配置文件介绍
](
./doc/doc_ch/config.md
)
-
预测部署
-
[
基于Python预测引擎推理
](
./doc/doc_ch/inference.md
)
-
基于C++预测引擎推理(comming soon)
-
[
服务部署
](
./doc/doc_ch/serving.md
)
-
[
端侧部署
](
./deploy/lite/readme.md
)
-
[
数据集
](
./doc/doc_ch/datasets.md
)
-
[
FAQ
](
#FAQ
)
-
效果展示
-
[
超轻量级中文OCR效果展示
](
#超轻量级中文OCR效果展示
)
-
[
通用中文OCR效果展示
](
#通用中文OCR效果展示
)
-
[
支持空格的中文OCR效果展示
](
#支持空格的中文OCR效果展示
)
-
[
技术交流群
](
#欢迎加入PaddleOCR技术交流群
)
-
[
参考文献
](
./doc/doc_ch/reference.md
)
-
[
许可证书
](
#许可证书
)
-
[
贡献代码
](
#贡献代码
)
## 效果展示
## 效果展示
<a
name=
"超轻量级中文OCR效果展示"
></a>
<a
name=
"超轻量级中文OCR效果展示"
></a>
...
...
configs/rec/rec_icdar15_train.yml
View file @
e50a35e5
...
@@ -14,6 +14,7 @@ Global:
...
@@ -14,6 +14,7 @@ Global:
character_type
:
en
character_type
:
en
loss_type
:
ctc
loss_type
:
ctc
distort
:
true
distort
:
true
debug
:
false
reader_yml
:
./configs/rec/rec_icdar15_reader.yml
reader_yml
:
./configs/rec/rec_icdar15_reader.yml
pretrain_weights
:
./pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy
pretrain_weights
:
./pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy
checkpoints
:
checkpoints
:
...
...
doc/doc_ch/FAQ.md
View file @
e50a35e5
...
@@ -48,3 +48,4 @@ PaddleOCR已完成Windows和Mac系统适配,运行时注意两点:1、在[
...
@@ -48,3 +48,4 @@ PaddleOCR已完成Windows和Mac系统适配,运行时注意两点:1、在[
11.
**自定义字典训练的模型,识别结果出现字典里没出现的字**
11.
**自定义字典训练的模型,识别结果出现字典里没出现的字**
预测时没有设置采用的自定义字典路径。设置方法是在预测时,通过增加输入参数rec_char_dict_path来设置。
预测时没有设置采用的自定义字典路径。设置方法是在预测时,通过增加输入参数rec_char_dict_path来设置。
tools/infer/predict_system.py
View file @
e50a35e5
...
@@ -117,12 +117,16 @@ def main(args):
...
@@ -117,12 +117,16 @@ def main(args):
image_file_list
=
get_image_file_list
(
args
.
image_dir
)
image_file_list
=
get_image_file_list
(
args
.
image_dir
)
text_sys
=
TextSystem
(
args
)
text_sys
=
TextSystem
(
args
)
is_visualize
=
True
is_visualize
=
True
tackle_img_num
=
0
for
image_file
in
image_file_list
:
for
image_file
in
image_file_list
:
img
=
cv2
.
imread
(
image_file
)
img
=
cv2
.
imread
(
image_file
)
if
img
is
None
:
if
img
is
None
:
logger
.
info
(
"error in loading image:{}"
.
format
(
image_file
))
logger
.
info
(
"error in loading image:{}"
.
format
(
image_file
))
continue
continue
starttime
=
time
.
time
()
starttime
=
time
.
time
()
tackle_img_num
+=
1
if
not
args
.
use_gpu
and
tackle_img_num
%
30
==
0
:
text_sys
=
TextSystem
(
args
)
dt_boxes
,
rec_res
=
text_sys
(
img
)
dt_boxes
,
rec_res
=
text_sys
(
img
)
elapse
=
time
.
time
()
-
starttime
elapse
=
time
.
time
()
-
starttime
print
(
"Predict time of %s: %.3fs"
%
(
image_file
,
elapse
))
print
(
"Predict time of %s: %.3fs"
%
(
image_file
,
elapse
))
...
...
tools/program.py
View file @
e50a35e5
...
@@ -75,6 +75,8 @@ class AttrDict(dict):
...
@@ -75,6 +75,8 @@ class AttrDict(dict):
global_config
=
AttrDict
()
global_config
=
AttrDict
()
default_config
=
{
'Global'
:
{
'debug'
:
False
,
}}
def
load_config
(
file_path
):
def
load_config
(
file_path
):
"""
"""
...
@@ -85,6 +87,7 @@ def load_config(file_path):
...
@@ -85,6 +87,7 @@ def load_config(file_path):
Returns: global config
Returns: global config
"""
"""
merge_config
(
default_config
)
_
,
ext
=
os
.
path
.
splitext
(
file_path
)
_
,
ext
=
os
.
path
.
splitext
(
file_path
)
assert
ext
in
[
'.yml'
,
'.yaml'
],
"only support yaml files for now"
assert
ext
in
[
'.yml'
,
'.yaml'
],
"only support yaml files for now"
merge_config
(
yaml
.
load
(
open
(
file_path
),
Loader
=
yaml
.
Loader
))
merge_config
(
yaml
.
load
(
open
(
file_path
),
Loader
=
yaml
.
Loader
))
...
...
tools/train.py
View file @
e50a35e5
...
@@ -43,6 +43,7 @@ logger = initial_logger()
...
@@ -43,6 +43,7 @@ logger = initial_logger()
from
ppocr.data.reader_main
import
reader_main
from
ppocr.data.reader_main
import
reader_main
from
ppocr.utils.save_load
import
init_model
from
ppocr.utils.save_load
import
init_model
from
ppocr.utils.character
import
CharacterOps
from
ppocr.utils.character
import
CharacterOps
from
paddle.fluid.contrib.model_stat
import
summary
def
main
():
def
main
():
...
@@ -87,6 +88,14 @@ def main():
...
@@ -87,6 +88,14 @@ def main():
# compile program for multi-devices
# compile program for multi-devices
train_compile_program
=
program
.
create_multi_devices_program
(
train_compile_program
=
program
.
create_multi_devices_program
(
train_program
,
train_opt_loss_name
)
train_program
,
train_opt_loss_name
)
# dump mode structure
if
config
[
'Global'
][
'debug'
]:
if
'Attention'
in
config
[
'Head'
].
keys
():
logger
.
warning
(
'Does not suport dump attention...'
)
else
:
summary
(
train_program
)
init_model
(
config
,
train_program
,
exe
)
init_model
(
config
,
train_program
,
exe
)
train_info_dict
=
{
'compile_program'
:
train_compile_program
,
\
train_info_dict
=
{
'compile_program'
:
train_compile_program
,
\
...
...
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