diff --git a/ppocr/modeling/backbones/rec_resnet_32.py b/ppocr/modeling/backbones/rec_resnet_32.py index 0b072dc5f6fefa8792338e8cce4716bdcbaeb135..cbd19251a3ed43a472d49f03743ead1491aa86ac 100644 --- a/ppocr/modeling/backbones/rec_resnet_32.py +++ b/ppocr/modeling/backbones/rec_resnet_32.py @@ -1,4 +1,4 @@ -# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. +# copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,11 +20,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import paddle -from paddle import ParamAttr import paddle.nn as nn -import paddle.nn.functional as F -import numpy as np __all__ = ["ResNet32"] @@ -51,10 +47,10 @@ class ResNet32(nn.Layer): def forward(self, inputs): """ Args: - inputs (torch.Tensor): input feature + inputs: input feature Returns: - torch.Tensor: output feature + output feature """ return self.ConvNet(inputs) @@ -92,7 +88,7 @@ class BasicBlock(nn.Layer): out_planes (int): channels of the middle feature stride (int): stride of the convolution Returns: - nn.Module: Conv2D with kernel = 3 + nn.Layer: Conv2D with kernel = 3 """ @@ -102,14 +98,6 @@ class BasicBlock(nn.Layer): bias_attr=False) def forward(self, x): - """ - Args: - x (torch.Tensor): input feature - - Returns: - torch.Tensor: output feature of the BasicBlock - - """ residual = x out = self.conv1(x) @@ -246,14 +234,6 @@ class ResNet(nn.Layer): return nn.Sequential(*layers) def forward(self, x): - """ - Args: - x (torch.Tensor): input feature - - Returns: - torch.Tensor: output feature of the Resnet - - """ x = self.conv0_1(x) x = self.bn0_1(x) x = self.relu(x) diff --git a/ppocr/modeling/heads/rec_spin_att_head.py b/ppocr/modeling/heads/rec_spin_att_head.py index 07a58b08327a602e9402cc122a6aedfe610fefd5..8f92d1ef45e87dd711847977a35ca7006ae52d49 100644 --- a/ppocr/modeling/heads/rec_spin_att_head.py +++ b/ppocr/modeling/heads/rec_spin_att_head.py @@ -19,7 +19,6 @@ from __future__ import print_function import paddle import paddle.nn as nn import paddle.nn.functional as F -import numpy as np class SPINAttentionHead(nn.Layer): diff --git a/ppocr/modeling/transforms/gaspin_transformer.py b/ppocr/modeling/transforms/gaspin_transformer.py index 9440e360d151e4dfd0715a8ecf26bf47c55e238a..f4719eb2162a02141620586bcb6a849ae16f3b62 100644 --- a/ppocr/modeling/transforms/gaspin_transformer.py +++ b/ppocr/modeling/transforms/gaspin_transformer.py @@ -21,7 +21,6 @@ import paddle from paddle import nn, ParamAttr from paddle.nn import functional as F import numpy as np -import itertools import functools from .tps import GridGenerator