code: def deconv_layer(net, up_scale, n_channel, method="transpose"):
      nh = tf.shape(net)[-3] * up_scale
      nw = tf.shape(net)[-2] * up_scale
  
      if method == "transpose":
          net = slim.conv2d_transpose(
              net,
              n_channel,
              (up_scale, up_scale),
              (up_scale, up_scale),
              activation_fn=None,
              padding="VALID",
          )
      elif method == "transpose+conv":
          net = slim.conv2d_transpose(
              net,
              n_channel,
              (up_scale, up_scale),
              (up_scale, up_scale),
              activation_fn=None,
              padding="VALID",
          )
          net = slim.conv2d(net, n_channel, (3, 3), (1, 1))
      elif method == "transpose+conv+relu":
          net = slim.conv2d_transpose(
              net,
              n_channel,
              (up_scale, up_scale),
              (up_scale, up_scale),
              padding="VALID",
          )
          net = slim.conv2d(net, n_channel, (3, 3), (1, 1))
      elif method == "bilinear":
          net = tf.image.resize_images(net, [nh, nw])
      else:
          raise Exception(
              "Unrecognised Deconvolution Method: %s" % method
          )
  
      return net
  
file_path: insightface/reconstruction/ostec/external/landmark_detector/models.py
imports: import tensorflow
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: deconv_layer(net, up_scale, n_channel, method) and returns: net