Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
26519a6d
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
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看板
未验证
提交
26519a6d
编写于
4月 23, 2023
作者:
X
xiaoting
提交者:
GitHub
4月 23, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update PPLCNetV3 name (#9802)
上级
ca8c8200
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
22 addition
and
26 deletion
+22
-26
configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml
configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml
+1
-1
configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml
configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml
+2
-1
ppocr/modeling/backbones/__init__.py
ppocr/modeling/backbones/__init__.py
+4
-4
ppocr/modeling/backbones/rec_lcnetv3.py
ppocr/modeling/backbones/rec_lcnetv3.py
+15
-20
未找到文件。
configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml
浏览文件 @
26519a6d
...
@@ -23,7 +23,7 @@ Architecture:
...
@@ -23,7 +23,7 @@ Architecture:
algorithm
:
DB
algorithm
:
DB
Transform
:
null
Transform
:
null
Backbone
:
Backbone
:
name
:
LCNetv
3
name
:
PPLCNetV
3
scale
:
0.75
scale
:
0.75
det
:
True
det
:
True
Neck
:
Neck
:
...
...
configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml
浏览文件 @
26519a6d
...
@@ -39,7 +39,8 @@ Architecture:
...
@@ -39,7 +39,8 @@ Architecture:
algorithm
:
SVTR_LCNet
algorithm
:
SVTR_LCNet
Transform
:
Transform
:
Backbone
:
Backbone
:
name
:
LCNetv3
name
:
PPLCNetV3
scale
:
0.95
Head
:
Head
:
name
:
MultiHead
name
:
MultiHead
head_list
:
head_list
:
...
...
ppocr/modeling/backbones/__init__.py
浏览文件 @
26519a6d
...
@@ -22,11 +22,11 @@ def build_backbone(config, model_type):
...
@@ -22,11 +22,11 @@ def build_backbone(config, model_type):
from
.det_resnet_vd
import
ResNet_vd
from
.det_resnet_vd
import
ResNet_vd
from
.det_resnet_vd_sast
import
ResNet_SAST
from
.det_resnet_vd_sast
import
ResNet_SAST
from
.det_pp_lcnet
import
PPLCNet
from
.det_pp_lcnet
import
PPLCNet
from
.rec_lcnetv3
import
LCNetv
3
from
.rec_lcnetv3
import
PPLCNetV
3
from
.rec_hgnet
import
PPHGNet_small
from
.rec_hgnet
import
PPHGNet_small
support_dict
=
[
support_dict
=
[
"MobileNetV3"
,
"ResNet"
,
"ResNet_vd"
,
"ResNet_SAST"
,
"PPLCNet"
,
"MobileNetV3"
,
"ResNet"
,
"ResNet_vd"
,
"ResNet_SAST"
,
"PPLCNet"
,
"
LCNetv
3"
,
"PPHGNet_small"
"
PPLCNetV
3"
,
"PPHGNet_small"
]
]
if
model_type
==
"table"
:
if
model_type
==
"table"
:
from
.table_master_resnet
import
TableResNetExtra
from
.table_master_resnet
import
TableResNetExtra
...
@@ -48,13 +48,13 @@ def build_backbone(config, model_type):
...
@@ -48,13 +48,13 @@ def build_backbone(config, model_type):
from
.rec_resnet_rfl
import
ResNetRFL
from
.rec_resnet_rfl
import
ResNetRFL
from
.rec_densenet
import
DenseNet
from
.rec_densenet
import
DenseNet
from
.rec_shallow_cnn
import
ShallowCNN
from
.rec_shallow_cnn
import
ShallowCNN
from
.rec_lcnetv3
import
LCNetv
3
from
.rec_lcnetv3
import
PPLCNetV
3
from
.rec_hgnet
import
PPHGNet_small
from
.rec_hgnet
import
PPHGNet_small
support_dict
=
[
support_dict
=
[
'MobileNetV1Enhance'
,
'MobileNetV3'
,
'ResNet'
,
'ResNetFPN'
,
'MTB'
,
'MobileNetV1Enhance'
,
'MobileNetV3'
,
'ResNet'
,
'ResNetFPN'
,
'MTB'
,
'ResNet31'
,
'ResNet45'
,
'ResNet_ASTER'
,
'MicroNet'
,
'ResNet31'
,
'ResNet45'
,
'ResNet_ASTER'
,
'MicroNet'
,
'EfficientNetb3_PREN'
,
'SVTRNet'
,
'ViTSTR'
,
'ResNet32'
,
'ResNetRFL'
,
'EfficientNetb3_PREN'
,
'SVTRNet'
,
'ViTSTR'
,
'ResNet32'
,
'ResNetRFL'
,
'DenseNet'
,
'ShallowCNN'
,
'
LCNetv
3'
,
'PPHGNet_small'
'DenseNet'
,
'ShallowCNN'
,
'
PPLCNetV
3'
,
'PPHGNet_small'
]
]
elif
model_type
==
'e2e'
:
elif
model_type
==
'e2e'
:
from
.e2e_resnet_vd_pg
import
ResNet
from
.e2e_resnet_vd_pg
import
ResNet
...
...
ppocr/modeling/backbones/rec_lcnetv3.py
浏览文件 @
26519a6d
...
@@ -372,7 +372,7 @@ class PPLCNetV3(nn.Layer):
...
@@ -372,7 +372,7 @@ class PPLCNetV3(nn.Layer):
stride
=
2
,
stride
=
2
,
lr_mult
=
self
.
lr_mult_list
[
0
])
lr_mult
=
self
.
lr_mult_list
[
0
])
self
.
blocks2
=
nn
.
Sequential
(
*
[
self
.
blocks2
=
nn
.
Sequential
(
*
[
LCNetV3Block
(
LCNetV3Block
(
in_channels
=
make_divisible
(
in_c
*
scale
),
in_channels
=
make_divisible
(
in_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
...
@@ -382,11 +382,11 @@ class PPLCNetV3(nn.Layer):
...
@@ -382,11 +382,11 @@ class PPLCNetV3(nn.Layer):
conv_kxk_num
=
conv_kxk_num
,
conv_kxk_num
=
conv_kxk_num
,
lr_mult
=
self
.
lr_mult_list
[
1
],
lr_mult
=
self
.
lr_mult_list
[
1
],
lab_lr
=
lab_lr
)
lab_lr
=
lab_lr
)
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
)
in
enumerate
(
self
.
net_config
[
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
"blocks2"
])
)
in
enumerate
(
self
.
net_config
[
"blocks2"
])
])
])
self
.
blocks3
=
nn
.
Sequential
(
*
[
self
.
blocks3
=
nn
.
Sequential
(
*
[
LCNetV3Block
(
LCNetV3Block
(
in_channels
=
make_divisible
(
in_c
*
scale
),
in_channels
=
make_divisible
(
in_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
...
@@ -396,11 +396,11 @@ class PPLCNetV3(nn.Layer):
...
@@ -396,11 +396,11 @@ class PPLCNetV3(nn.Layer):
conv_kxk_num
=
conv_kxk_num
,
conv_kxk_num
=
conv_kxk_num
,
lr_mult
=
self
.
lr_mult_list
[
2
],
lr_mult
=
self
.
lr_mult_list
[
2
],
lab_lr
=
lab_lr
)
lab_lr
=
lab_lr
)
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
)
in
enumerate
(
self
.
net_config
[
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
"blocks3"
])
)
in
enumerate
(
self
.
net_config
[
"blocks3"
])
])
])
self
.
blocks4
=
nn
.
Sequential
(
*
[
self
.
blocks4
=
nn
.
Sequential
(
*
[
LCNetV3Block
(
LCNetV3Block
(
in_channels
=
make_divisible
(
in_c
*
scale
),
in_channels
=
make_divisible
(
in_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
...
@@ -410,11 +410,11 @@ class PPLCNetV3(nn.Layer):
...
@@ -410,11 +410,11 @@ class PPLCNetV3(nn.Layer):
conv_kxk_num
=
conv_kxk_num
,
conv_kxk_num
=
conv_kxk_num
,
lr_mult
=
self
.
lr_mult_list
[
3
],
lr_mult
=
self
.
lr_mult_list
[
3
],
lab_lr
=
lab_lr
)
lab_lr
=
lab_lr
)
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
)
in
enumerate
(
self
.
net_config
[
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
"blocks4"
])
)
in
enumerate
(
self
.
net_config
[
"blocks4"
])
])
])
self
.
blocks5
=
nn
.
Sequential
(
*
[
self
.
blocks5
=
nn
.
Sequential
(
*
[
LCNetV3Block
(
LCNetV3Block
(
in_channels
=
make_divisible
(
in_c
*
scale
),
in_channels
=
make_divisible
(
in_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
...
@@ -424,11 +424,11 @@ class PPLCNetV3(nn.Layer):
...
@@ -424,11 +424,11 @@ class PPLCNetV3(nn.Layer):
conv_kxk_num
=
conv_kxk_num
,
conv_kxk_num
=
conv_kxk_num
,
lr_mult
=
self
.
lr_mult_list
[
4
],
lr_mult
=
self
.
lr_mult_list
[
4
],
lab_lr
=
lab_lr
)
lab_lr
=
lab_lr
)
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
)
in
enumerate
(
self
.
net_config
[
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
"blocks5"
])
)
in
enumerate
(
self
.
net_config
[
"blocks5"
])
])
])
self
.
blocks6
=
nn
.
Sequential
(
*
[
self
.
blocks6
=
nn
.
Sequential
(
*
[
LCNetV3Block
(
LCNetV3Block
(
in_channels
=
make_divisible
(
in_c
*
scale
),
in_channels
=
make_divisible
(
in_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
out_channels
=
make_divisible
(
out_c
*
scale
),
...
@@ -438,8 +438,8 @@ class PPLCNetV3(nn.Layer):
...
@@ -438,8 +438,8 @@ class PPLCNetV3(nn.Layer):
conv_kxk_num
=
conv_kxk_num
,
conv_kxk_num
=
conv_kxk_num
,
lr_mult
=
self
.
lr_mult_list
[
5
],
lr_mult
=
self
.
lr_mult_list
[
5
],
lab_lr
=
lab_lr
)
lab_lr
=
lab_lr
)
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
)
in
enumerate
(
self
.
net_config
[
for
i
,
(
k
,
in_c
,
out_c
,
s
,
se
"blocks6"
])
)
in
enumerate
(
self
.
net_config
[
"blocks6"
])
])
])
self
.
out_channels
=
make_divisible
(
512
*
scale
)
self
.
out_channels
=
make_divisible
(
512
*
scale
)
...
@@ -489,8 +489,3 @@ class PPLCNetV3(nn.Layer):
...
@@ -489,8 +489,3 @@ class PPLCNetV3(nn.Layer):
else
:
else
:
x
=
F
.
avg_pool2d
(
x
,
[
3
,
2
])
x
=
F
.
avg_pool2d
(
x
,
[
3
,
2
])
return
x
return
x
def
LCNetv3
(
scale
=
0.95
,
**
kwargs
):
model
=
PPLCNetV3
(
scale
=
scale
,
conv_kxk_num
=
4
,
**
kwargs
)
return
model
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录