code: def transform_logits(
      logits, center, scale, width, height, input_size
  ):
      trans = get_affine_transform(center, scale, 0, input_size, inv=1)
      channel = logits.shape[2]
      target_logits = []
      for i in range(channel):
          target_logit = cv2.warpAffine(
              logits[:, :, i],
              trans,
              (int(width), int(height)),
              flags=cv2.INTER_LINEAR,
              borderMode=cv2.BORDER_CONSTANT,
              borderValue=(0),
          )
          target_logits.append(target_logit)
      target_logits = np.stack(target_logits, axis=2)
      return target_logits
  
file_path: PaddleHub/modules/image/semantic_segmentation/ace2p/processor.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import time
  import base64
  import cv2
  import numpy
  from PIL import Image
label_desc: Use image node_id 8 for calling a global function with example usage: transform_logits(logits, center, scale, width, height, input_size) and returns: target_logits