code: def postprocess(im, output_dir, save_im_name, visualization, size):
      im = np.multiply(im, 255.0) + 0.5
      im = np.clip(im, 0, 255)
      im = im.astype(np.uint8)
      im = im.transpose((1, 2, 0))
      im = im[:, :, ::-1]
      im = cv2.resize(
          im, (size[0], size[1]), interpolation=cv2.INTER_LINEAR
      )
      result = {"data": im}
      if visualization:
          if not os.path.exists(output_dir):
              os.makedirs(output_dir)
          elif os.path.isfile(output_dir):
              os.remove(output_dir)
              os.makedirs(output_dir)
          # save image
          save_path = os.path.join(output_dir, save_im_name)
          try:
              cv2.imwrite(save_path, im)
              print(
                  'Notice: an image has been proccessed and saved in path "{}".'.format(
                      os.path.abspath(save_path)
                  )
              )
          except Exception as e:
              print(
                  'Exception {}: Fail to save output image in path "{}".'.format(
                      e, os.path.abspath(save_path)
                  )
              )
          result["save_path"] = save_path
      return result
  
file_path: PaddleHub/modules/image/Image_gan/style_transfer/stylepro_artistic/processor.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import base64
  import cv2
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: postprocess(im, output_dir, save_im_name, visualization, size) and returns: result