From 7e81a9e62d8ebe1e8213575b6cb0602f54fff424 Mon Sep 17 00:00:00 2001 From: smilelite Date: Sun, 10 Jul 2022 09:45:52 +0800 Subject: [PATCH] modified annotation --- ppocr/modeling/backbones/rec_resnet_32.py | 28 +++---------------- ppocr/modeling/heads/rec_spin_att_head.py | 1 - .../modeling/transforms/gaspin_transformer.py | 1 - 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/ppocr/modeling/backbones/rec_resnet_32.py b/ppocr/modeling/backbones/rec_resnet_32.py index 0b072dc5..cbd19251 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 07a58b08..8f92d1ef 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 9440e360..f4719eb2 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 -- GitLab