class_docstr: Sturture-Preserving Transformation (SPT) as Equa. (2) in Ref. [1]
  Ref: [1] SPIN: Structure-Preserving Inner Offset Network for Scene Text Recognition. AAAI-2021.
class_docstr_tok: ["Sturture-Preserving","Transformation","(","SPT",")","as","Equa",".","(","2",")","in","Ref",".","[","1","]","Ref",":","[","1","]","SPIN",":","Structure-Preserving","Inner","Offset","Network","for","Scene","Text","Recognition",".","AAAI-2021","."]
docstr: Based on SPIN
  Args:
      nc (int): number of input channels (usually in 1 or 3)
      default_type (int): the complexity of transformation intensities (by default set to 6 as the paper)
docstr_tok: ["Based","on","SPIN","Args",":","nc","(","int",")",":","number","of","input","channels","(","usually","in","1","or","3",")","default_type","(","int",")",":","the","complexity","of","transformation","intensities","(","by","default","set","to","6","as","the","paper",")"]
code: def __init__(self, nc=1, default_type=5):
      """Based on SPIN
      Args:
          nc (int): number of input channels (usually in 1 or 3)
          default_type (int): the complexity of transformation intensities (by default set to 6 as the paper)
      """
      super(SP_TransformerNetwork, self).__init__()
      self.power_list = self.cal_K(default_type)
      self.sigmoid = nn.Sigmoid()
      self.bn = nn.InstanceNorm2D(nc)
  
file_path: PaddleOCR/ppocr/modeling/transforms/gaspin_transformer.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  from paddle import nn, ParamAttr
  from paddle.nn import functional
  import numpy
  import functools
  from .tps import GridGenerator
label_desc: Use image node_id 1 to create a new SP_TransformerNetwork object from inherited base classes: nn with example: obj = SP_TransformerNetwork(nc, default_type)