Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
2400bacf
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 2 年 前同步成功
通知
1557
Star
32965
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
2400bacf
编写于
10月 14, 2021
作者:
B
Bin Lu
提交者:
GitHub
10月 14, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'PaddlePaddle:dygraph' into dygraph
上级
bb253d6d
37eec4d5
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
109 addition
and
15 deletion
+109
-15
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_cml.yml
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_cml.yml
+1
-0
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_distill.yml
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_distill.yml
+2
-2
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_dml.yml
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_dml.yml
+1
-0
configs/e2e/e2e_r50_vd_pg.yml
configs/e2e/e2e_r50_vd_pg.yml
+2
-2
ppocr/losses/rec_sar_loss.py
ppocr/losses/rec_sar_loss.py
+6
-3
ppocr/modeling/necks/rnn.py
ppocr/modeling/necks/rnn.py
+1
-1
ppocr/utils/dict90.txt
ppocr/utils/dict90.txt
+90
-0
ppstructure/layout/train_layoutparser_model.md
ppstructure/layout/train_layoutparser_model.md
+6
-6
tools/infer/predict_e2e.py
tools/infer/predict_e2e.py
+0
-1
未找到文件。
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_cml.yml
浏览文件 @
2400bacf
...
...
@@ -141,6 +141,7 @@ Train:
img_mode
:
BGR
channel_first
:
False
-
DetLabelEncode
:
# Class handling label
-
CopyPaste
:
-
IaaAugment
:
augmenter_args
:
-
{
'
type'
:
Fliplr
,
'
args'
:
{
'
p'
:
0.5
}
}
...
...
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_distill.yml
浏览文件 @
2400bacf
...
...
@@ -68,8 +68,7 @@ Loss:
ohem_ratio
:
3
-
DistillationDBLoss
:
weight
:
1.0
model_name_list
:
[
"
Student"
,
"
Teacher"
]
# key: maps
model_name_list
:
[
"
Student"
]
name
:
DBLoss
balance_loss
:
true
main_loss_type
:
DiceLoss
...
...
@@ -116,6 +115,7 @@ Train:
img_mode
:
BGR
channel_first
:
False
-
DetLabelEncode
:
# Class handling label
-
CopyPaste
:
-
IaaAugment
:
augmenter_args
:
-
{
'
type'
:
Fliplr
,
'
args'
:
{
'
p'
:
0.5
}
}
...
...
configs/det/ch_PP-OCRv2/ch_PP-OCR_det_dml.yml
浏览文件 @
2400bacf
...
...
@@ -118,6 +118,7 @@ Train:
img_mode
:
BGR
channel_first
:
False
-
DetLabelEncode
:
# Class handling label
-
CopyPaste
:
-
IaaAugment
:
augmenter_args
:
-
{
'
type'
:
Fliplr
,
'
args'
:
{
'
p'
:
0.5
}
}
...
...
configs/e2e/e2e_r50_vd_pg.yml
浏览文件 @
2400bacf
...
...
@@ -94,7 +94,7 @@ Eval:
label_file_list
:
[
./train_data/total_text/test/test.txt
]
transforms
:
-
DecodeImage
:
# load image
img_mode
:
RGB
img_mode
:
BGR
channel_first
:
False
-
E2ELabelEncodeTest
:
-
E2EResizeForTest
:
...
...
ppocr/losses/rec_sar_loss.py
浏览文件 @
2400bacf
...
...
@@ -9,11 +9,14 @@ from paddle import nn
class
SARLoss
(
nn
.
Layer
):
def
__init__
(
self
,
**
kwargs
):
super
(
SARLoss
,
self
).
__init__
()
self
.
loss_func
=
paddle
.
nn
.
loss
.
CrossEntropyLoss
(
reduction
=
"mean"
,
ignore_index
=
96
)
self
.
loss_func
=
paddle
.
nn
.
loss
.
CrossEntropyLoss
(
reduction
=
"mean"
,
ignore_index
=
92
)
def
forward
(
self
,
predicts
,
batch
):
predict
=
predicts
[:,
:
-
1
,
:]
# ignore last index of outputs to be in same seq_len with targets
label
=
batch
[
1
].
astype
(
"int64"
)[:,
1
:]
# ignore first index of target in loss calculation
predict
=
predicts
[:,
:
-
1
,
:]
# ignore last index of outputs to be in same seq_len with targets
label
=
batch
[
1
].
astype
(
"int64"
)[:,
1
:]
# ignore first index of target in loss calculation
batch_size
,
num_steps
,
num_classes
=
predict
.
shape
[
0
],
predict
.
shape
[
1
],
predict
.
shape
[
2
]
assert
len
(
label
.
shape
)
==
len
(
list
(
predict
.
shape
))
-
1
,
\
...
...
ppocr/modeling/necks/rnn.py
浏览文件 @
2400bacf
...
...
@@ -51,7 +51,7 @@ class EncoderWithFC(nn.Layer):
super
(
EncoderWithFC
,
self
).
__init__
()
self
.
out_channels
=
hidden_size
weight_attr
,
bias_attr
=
get_para_bias_attr
(
l2_decay
=
0.00001
,
k
=
in_channels
,
name
=
'reduce_encoder_fea'
)
l2_decay
=
0.00001
,
k
=
in_channels
)
self
.
fc
=
nn
.
Linear
(
in_channels
,
hidden_size
,
...
...
ppocr/utils/dict90.txt
0 → 100644
浏览文件 @
2400bacf
0
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
!
"
#
$
%
&
'
(
)
*
+
,
-
.
/
:
;
<
=
>
?
@
[
\
]
_
`
~
\ No newline at end of file
ppstructure/layout/train_layoutparser_model.md
浏览文件 @
2400bacf
...
...
@@ -4,9 +4,9 @@
[
1.1 Requirements
](
#Requirements
)
[
1.2 Install PaddleDetection
](
#Install
PaddleDetection)
[
1.2 Install PaddleDetection
](
#Install
_
PaddleDetection
)
[
2. Data preparation
](
#Data
p
reparation)
[
2. Data preparation
](
#Data
_
reparation
)
[
3. Configuration
](
#Configuration
)
...
...
@@ -16,7 +16,7 @@
[
6. Deployment
](
#Deployment
)
[
6.1 Export model
](
#Export
model)
[
6.1 Export model
](
#Export
_
model
)
[
6.2 Inference
](
#Inference
)
...
...
@@ -35,7 +35,7 @@
-
CUDA >= 10.1
-
cuDNN >= 7.6
<a
name=
"Install
PaddleDetection"
></a>
<a
name=
"Install
_
PaddleDetection"
></a>
### 1.2 Install PaddleDetection
...
...
@@ -51,7 +51,7 @@ pip install -r requirements.txt
For more installation tutorials, please refer to:
[
Install doc
](
https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/docs/tutorials/INSTALL_cn.md
)
<a
name=
"Data
preparation"
></a>
<a
name=
"Data
_
preparation"
></a>
## 2. Data preparation
...
...
@@ -165,7 +165,7 @@ python tools/infer.py -c configs/ppyolo/ppyolov2_r50vd_dcn_365e_coco.yml --infer
Use your trained model in Layout Parser
<a
name=
"Export
model"
></a>
<a
name=
"Export
_
model"
></a>
### 6.1 Export model
...
...
tools/infer/predict_e2e.py
浏览文件 @
2400bacf
...
...
@@ -141,7 +141,6 @@ if __name__ == "__main__":
img
,
flag
=
check_and_read_gif
(
image_file
)
if
not
flag
:
img
=
cv2
.
imread
(
image_file
)
img
=
img
[:,
:,
::
-
1
]
if
img
is
None
:
logger
.
info
(
"error in loading image:{}"
.
format
(
image_file
))
continue
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录