code: def postprocess(
      data_out,
      org_im,
      org_im_shape,
      org_im_path,
      output_dir,
      visualization,
      thresh=120,
  ):
      """
      Postprocess output of network. one image at a time.
  
      Args:
          data_out (numpy.ndarray): output of network.
          org_im (numpy.ndarray): original image.
          org_im_shape (list): shape pf original image.
          org_im_path (list): path of riginal image.
          output_dir (str): output directory to store image.
          visualization (bool): whether to save image or not.
          thresh (float): threshold.
  
      Returns:
          result (dict): The data of processed image.
      """
      result = dict()
      for logit in data_out:
          logit = logit[1] * 255
          logit = cv2.resize(logit, (org_im_shape[1], org_im_shape[0]))
          logit -= thresh
          logit[logit < 0] = 0
          logit = 255 * logit / (255 - thresh)
          rgba = np.concatenate(
              (org_im, np.expand_dims(logit, axis=2)), axis=2
          )
  
          if visualization:
              check_dir(output_dir)
              save_im_path = get_save_image_name(
                  org_im, org_im_path, output_dir
              )
              cv2.imwrite(save_im_path, rgba)
              result["save_path"] = save_im_path
              result["data"] = rgba[:, :, 3]
          else:
              result["data"] = rgba[:, :, 3]
      return result
  
file_path: PaddleHub/modules/image/semantic_segmentation/deeplabv3p_xception65_humanseg/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
label_desc: Use image node_id 3 for calling a global function with example usage: postprocess(data_out, org_im, org_im_shape, org_im_path, output_dir, visualization, thresh) and returns: result