diff --git a/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml b/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml index 3b5ab51b6967efbcfaf0f50599164e2545cc1b89..6a838fd8d03c83754a07294406fe4ba575761643 100644 --- a/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml +++ b/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml @@ -32,12 +32,12 @@ NetWorks: model_name: large disable_se: true Neck: - name: FEPAN + name: CAPAN out_channels: 96 + shortcut: True Head: name: DBHead k: 50 - kernel_size: [7, 2, 2] Student2: model_type: det algorithm: DB @@ -48,12 +48,12 @@ NetWorks: model_name: large disable_se: true Neck: - name: FEPAN + name: CAPAN out_channels: 96 + shortcut: True Head: name: DBHead k: 50 - kernel_size: [7, 2, 2] Teacher: pretrained: ./inference/ch_ppocr_resnet50/student model_type: det @@ -63,12 +63,11 @@ NetWorks: in_channels: 3 layers: 50 Neck: - name: DBFPN + name: FEPAN out_channels: 256 - big_kernel: true Head: name: DBHead - big_kernel: true + kernel_list: [7,2,2] k: 50 Loss: diff --git a/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.yml b/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.yml index 696e8a2168511f683d12e9cc2e57d61003e2de95..a9e1d3a6a256c42e7b203d83d3c84ed7e48263d0 100644 --- a/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.yml +++ b/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.yml @@ -28,12 +28,12 @@ Architecture: model_name: large disable_se: True Neck: - name: FEPAN + name: CAPAN out_channels: 96 + shortcut: True Head: name: DBHead k: 50 - kernel_size: [7, 2, 2] Loss: name: DBLoss diff --git a/ppocr/modeling/necks/db_fpn.py b/ppocr/modeling/necks/db_fpn.py index c78f11040d49c854f880fc44b4c03d91e8123303..c1272b4e3d89dec5f65583dd7ab8bcfdde8e616d 100644 --- a/ppocr/modeling/necks/db_fpn.py +++ b/ppocr/modeling/necks/db_fpn.py @@ -21,6 +21,8 @@ from paddle import nn import paddle.nn.functional as F from paddle import ParamAttr import os +import sys + __dir__ = os.path.dirname(os.path.abspath(__file__)) sys.path.append(__dir__) sys.path.insert(0, os.path.abspath(os.path.join(__dir__, '../../..'))) @@ -138,11 +140,11 @@ class CALayer(nn.Layer): class CAFPN(nn.Layer): - def __init__(self, in_channels, out_channels, shortcut, **kwargs): + def __init__(self, in_channels, out_channels, shortcut=True, **kwargs): super(CAFPN, self).__init__() - - self.ins_convs = [] - self.inp_convs = [] + self.out_channels = out_channels + self.ins_conv = [] + self.inp_conv = [] for i in range(len(in_channels)): self.ins_conv.append( @@ -192,8 +194,8 @@ class FEPAN(nn.Layer): self.out_channels = out_channels weight_attr = paddle.nn.initializer.KaimingUniform() - self.ins_convs = [] - self.inp_convs = [] + self.ins_conv = [] + self.inp_conv = [] # pan head self.pan_head_conv = [] self.pan_lat_conv = []