Skip to content

Commit

Permalink
fix det
Browse files Browse the repository at this point in the history
  • Loading branch information
LDOUBLEV committed Apr 26, 2022
1 parent 5492c10 commit 217b040
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
13 changes: 6 additions & 7 deletions configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions ppocr/modeling/necks/db_fpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
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__, '../../..')))
Expand Down Expand Up @@ -138,11 +140,11 @@ def forward(self, ins):


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(
Expand Down Expand Up @@ -192,8 +194,8 @@ def __init__(self, in_channels, out_channels, **kwargs):
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 = []
Expand Down

0 comments on commit 217b040

Please sign in to comment.