diff --git a/ppocr/modeling/heads/det_db_head.py b/ppocr/modeling/heads/det_db_head.py index 5539d7737e..a686ae5ab0 100644 --- a/ppocr/modeling/heads/det_db_head.py +++ b/ppocr/modeling/heads/det_db_head.py @@ -31,7 +31,7 @@ def get_bias_attr(k): class Head(nn.Layer): - def __init__(self, in_channels, name_list, kernel_list=[3, 2, 2]): + def __init__(self, in_channels, name_list, kernel_list=[3, 2, 2], **kwargs): super(Head, self).__init__() self.conv1 = nn.Conv2D( @@ -101,8 +101,8 @@ class DBHead(nn.Layer): 'conv2d_57', 'batch_norm_49', 'conv2d_transpose_2', 'batch_norm_50', 'conv2d_transpose_3', 'thresh' ] - self.binarize = Head(in_channels, binarize_name_list) - self.thresh = Head(in_channels, thresh_name_list) + self.binarize = Head(in_channels, binarize_name_list, **kwargs) + self.thresh = Head(in_channels, thresh_name_list, **kwargs) def step_function(self, x, y): return paddle.reciprocal(1 + paddle.exp(-self.k * (x - y))) diff --git a/ppocr/modeling/necks/__init__.py b/ppocr/modeling/necks/__init__.py index aa1d77ba74..9a4218d1a9 100644 --- a/ppocr/modeling/necks/__init__.py +++ b/ppocr/modeling/necks/__init__.py @@ -16,7 +16,7 @@ __all__ = ['build_neck'] def build_neck(config): - from .db_fpn import DBFPN, CAFPN, FEPAN, FEPANLite + from .db_fpn import DBFPN, CAFPN, FEPAN from .east_fpn import EASTFPN from .sast_fpn import SASTFPN from .rnn import SequenceEncoder @@ -26,8 +26,8 @@ def build_neck(config): from .fce_fpn import FCEFPN from .pren_fpn import PRENFPN support_dict = [ - 'FPN', 'FCEFPN', 'FEPAN', 'FEPANLite', 'DBFPN', 'CAFPN', 'EASTFPN', - 'SASTFPN', 'SequenceEncoder', 'PGFPN', 'TableFPN', 'PRENFPN' + 'FPN', 'FCEFPN', 'FEPAN', 'DBFPN', 'CAFPN', 'EASTFPN', 'SASTFPN', + 'SequenceEncoder', 'PGFPN', 'TableFPN', 'PRENFPN' ] module_name = config.pop('name')