From a923f35de57b5e378f8dd16e54d0a3e4f51267fd Mon Sep 17 00:00:00 2001 From: Double_V Date: Wed, 15 Feb 2023 10:37:40 +0800 Subject: [PATCH] delte unused params (#9078) --- ppocr/modeling/heads/det_db_head.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/ppocr/modeling/heads/det_db_head.py b/ppocr/modeling/heads/det_db_head.py index a686ae5ab..77cb6f1db 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], **kwargs): + def __init__(self, in_channels, kernel_list=[3, 2, 2], **kwargs): super(Head, self).__init__() self.conv1 = nn.Conv2D( @@ -93,16 +93,8 @@ class DBHead(nn.Layer): def __init__(self, in_channels, k=50, **kwargs): super(DBHead, self).__init__() self.k = k - binarize_name_list = [ - 'conv2d_56', 'batch_norm_47', 'conv2d_transpose_0', 'batch_norm_48', - 'conv2d_transpose_1', 'binarize' - ] - thresh_name_list = [ - 'conv2d_57', 'batch_norm_49', 'conv2d_transpose_2', 'batch_norm_50', - 'conv2d_transpose_3', 'thresh' - ] - self.binarize = Head(in_channels, binarize_name_list, **kwargs) - self.thresh = Head(in_channels, thresh_name_list, **kwargs) + self.binarize = Head(in_channels, **kwargs) + self.thresh = Head(in_channels, **kwargs) def step_function(self, x, y): return paddle.reciprocal(1 + paddle.exp(-self.k * (x - y)))