code: def postprocess(res, output_dir, visualization):
      """
      postprocess ouput of network, one face at a time.
      """
      output = []
      _cur_id = -1
      for idx, _result in enumerate(res):
          if _result["id"] != _cur_id:
              _cur_id = _result["id"]
              output.append({"data": []})
          _result["points"][:, 0] *= _result["x2"] - _result["x1"]
          _result["points"][:, 0] += _result["x1"]
          _result["points"][:, 1] *= _result["y2"] - _result["y1"]
          _result["points"][:, 1] += _result["y1"]
          output[-1]["data"].append(_result["points"].tolist())
  
      if visualization:
          check_dir(output_dir)
          for idx, sample in enumerate(output):
              orig_im = res[idx]["orig_im"]
              for points in sample["data"]:
                  for x, y in points:
                      cv2.circle(
                          orig_im, (int(x), int(y)), 1, (0, 0, 255), 2
                      )
              orig_im_path = res[idx]["orig_im_path"]
              ext = (
                  os.path.splitext(orig_im_path) if orig_im_path else ""
              )
              ext = ext if ext else get_image_ext(orig_im)
              org_im_path = (
                  orig_im_path
                  if orig_im_path
                  else "ndarray_{}{}".format(time.time(), ext)
              )
              im_name = os.path.basename(org_im_path)
              im_save_path = os.path.join(output_dir, im_name)
              sample["save_path"] = im_save_path
              cv2.imwrite(im_save_path, orig_im)
  
      return output
  
file_path: PaddleHub/modules/image/keypoint_detection/face_landmark_localization/processor.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import base64
  import os
  import time
  import cv2
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: postprocess(res, output_dir, visualization) and returns: output