code: def reverse_transform(alpha: paddle.Tensor, trans_info: List[str]):
      """recover pred to origin shape"""
      for item in trans_info[::-1]:
          if item[0] == "resize":
              h, w = item[1][0], item[1][1]
              alpha = F.interpolate(alpha, [h, w], mode="bilinear")
          elif item[0] == "padding":
              h, w = item[1][0], item[1][1]
              alpha = alpha[:, :, 0:h, 0:w]
          else:
              raise Exception(
                  "Unexpected info '{}' in im_info".format(item[0])
              )
      return alpha
  
imports: import random
  import base64
  from typing import Callable, Union, List, Tuple
  import cv2
  import numpy
  import paddle
  import paddle.nn.functional
  from paddleseg.transforms import functional
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: reverse_transform(alpha, trans_info) and returns: alpha