code: def __init__(self, in_channels, num_ctrlpoints, activation="none"):
      super(STN, self).__init__()
      self.in_channels = in_channels
      self.num_ctrlpoints = num_ctrlpoints
      self.activation = activation
      self.stn_convnet = nn.Sequential(
          conv3x3_block(in_channels, 32),  # 32x64
          nn.MaxPool2D(kernel_size=2, stride=2),
          conv3x3_block(32, 64),  # 16x32
          nn.MaxPool2D(kernel_size=2, stride=2),
          conv3x3_block(64, 128),  # 8*16
          nn.MaxPool2D(kernel_size=2, stride=2),
          conv3x3_block(128, 256),  # 4*8
          nn.MaxPool2D(kernel_size=2, stride=2),
          conv3x3_block(256, 256),  # 2*4,
          nn.MaxPool2D(kernel_size=2, stride=2),
          conv3x3_block(256, 256),
      )  # 1*2
      self.stn_fc1 = nn.Sequential(
          nn.Linear(
              2 * 256,
              512,
              weight_attr=nn.initializer.Normal(0, 0.001),
              bias_attr=nn.initializer.Constant(0),
          ),
          nn.BatchNorm1D(512),
          nn.ReLU(),
      )
      fc2_bias = self.init_stn()
      self.stn_fc2 = nn.Linear(
          512,
          num_ctrlpoints * 2,
          weight_attr=nn.initializer.Constant(0.0),
          bias_attr=nn.initializer.Assign(fc2_bias),
      )
  
file_path: PaddleOCR/ppocr/modeling/transforms/stn.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
  from .tps_spatial_transformer import TPSSpatialTransformer
label_desc: Use image node_id 1 to create a new STN object from inherited base classes: nn with example: obj = STN(in_channels, num_ctrlpoints, activation)