未验证 提交 26519a6d 编写于 作者: X xiaoting 提交者: GitHub

update PPLCNetV3 name (#9802)

上级 ca8c8200
...@@ -23,7 +23,7 @@ Architecture: ...@@ -23,7 +23,7 @@ Architecture:
algorithm: DB algorithm: DB
Transform: null Transform: null
Backbone: Backbone:
name: LCNetv3 name: PPLCNetV3
scale: 0.75 scale: 0.75
det: True det: True
Neck: Neck:
......
...@@ -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:
......
...@@ -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 LCNetv3 from .rec_lcnetv3 import PPLCNetV3
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",
"LCNetv3", "PPHGNet_small" "PPLCNetV3", "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 LCNetv3 from .rec_lcnetv3 import PPLCNetV3
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', 'LCNetv3', 'PPHGNet_small' 'DenseNet', 'ShallowCNN', 'PPLCNetV3', 'PPHGNet_small'
] ]
elif model_type == 'e2e': elif model_type == 'e2e':
from .e2e_resnet_vd_pg import ResNet from .e2e_resnet_vd_pg import ResNet
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册