code: def get_save_image_name(img, output_dir, image_path):
      """Get save image name from source image path."""
      if not os.path.exists(output_dir):
          os.makedirs(output_dir)
      image_name = os.path.split(image_path)[-1]
      name, ext = os.path.splitext(image_name)
  
      if ext == "":
          if img.format == "PNG":
              ext = ".png"
          elif img.format == "JPEG":
              ext = ".jpg"
          elif img.format == "BMP":
              ext = ".bmp"
          else:
              if img.mode == "RGB" or img.mode == "L":
                  ext = ".jpg"
              elif img.mode == "RGBA" or img.mode == "P":
                  ext = ".png"
  
      return os.path.join(output_dir, "{}".format(name)) + ext
  
file_path: PaddleHub/modules/image/object_detection/faster_rcnn_resnet50_fpn_coco2017/processor.py
imports: import base64
  import os
  import cv2
  import numpy
  from PIL import Image, ImageDraw
label_desc: Use image node_id 3 for calling a global function with example usage: get_save_image_name(img, output_dir, image_path) and returns: unknown