code: def img_totensor(content_img, style_img):
      if content_img.ndim == 2:
          content_img = cv.cvtColor(content_img, cv.COLOR_GRAY2RGB)
      else:
          content_img = cv.cvtColor(content_img, cv.COLOR_BGR2RGB)
      h, w, c = content_img.shape
      content_img = Image.fromarray(content_img)
      content_img = content_img.resize((512, 512), Image.BILINEAR)
      content_img = np.array(content_img)
      content_img = img(content_img)
      content_img = functional.to_tensor(content_img)
  
      style_img = cv.cvtColor(style_img, cv.COLOR_BGR2RGB)
      style_img = Image.fromarray(style_img)
      style_img = style_img.resize((512, 512), Image.BILINEAR)
      style_img = np.array(style_img)
      style_img = img(style_img)
      style_img = functional.to_tensor(style_img)
  
      content_img = paddle.unsqueeze(content_img, axis=0)
      style_img = paddle.unsqueeze(style_img, axis=0)
      return content_img, style_img, h, w
  
imports: import os
  import urllib.request
  import cv2
  import numpy
  import paddle
  import paddle.nn.functional
  from paddle.vision.transforms import functional
  from PIL import Image
  from ppgan.models.generators import DecoderNet
  from ppgan.models.generators import Encoder
  from ppgan.models.generators import RevisionNet
  from ppgan.utils.visual import tensor2img
label_desc: Use image node_id 2 for calling a global function with example usage: img_totensor(content_img, style_img) and returns: content_img,  style_img,  h,  w