docstr: API for face landmark.
  
  Args:
      images (list(numpy.ndarray)): images data, shape of each is [H, W, C].
      paths (list[str]): The paths of images.
      batch_size (int): batch size.
      use_gpu (bool): Whether to use gpu.
      output_dir (str): The path to store output images.
      visualization (bool): Whether to save image or not.
  
  Returns:
      res (list[dict()]): The key points of face landmark and save path of images.
docstr_tok: ["API","for","face","landmark",".","Args",":","images","(","list","(","numpy.ndarray",")",")",":","images","data",",","shape","of","each","is","[","H",",","W",",","C","]",".","paths","(","list","[","str","]",")",":","The","paths","of","images",".","batch_size","(","int",")",":","batch","size",".","use_gpu","(","bool",")",":","Whether","to","use","gpu",".","output_dir","(","str",")",":","The","path","to","store","output","images",".","visualization","(","bool",")",":","Whether","to","save","image","or","not",".","Returns",":","res","(","list","[","dict","(",")","]",")",":","The","key","points","of","face","landmark","and","save","path","of","images","."]
code: def keypoint_detection(
      self,
      images=None,
      paths=None,
      batch_size=1,
      use_gpu=False,
      output_dir="face_landmark_output",
      visualization=False,
  ):
      """
      API for face landmark.
  
      Args:
          images (list(numpy.ndarray)): images data, shape of each is [H, W, C].
          paths (list[str]): The paths of images.
          batch_size (int): batch size.
          use_gpu (bool): Whether to use gpu.
          output_dir (str): The path to store output images.
          visualization (bool): Whether to save image or not.
  
      Returns:
          res (list[dict()]): The key points of face landmark and save path of images.
      """
      if use_gpu:
          try:
              _places = os.environ["CUDA_VISIBLE_DEVICES"]
              int(_places[0])
          except:
              raise RuntimeError(
                  "Environment Variable CUDA_VISIBLE_DEVICES is not set correctly. If you wanna use gpu, please set CUDA_VISIBLE_DEVICES as cuda_device_id."
              )
  
      # get all data
      all_data = []
      for yield_data in reader(
          self.face_detector, images, paths, use_gpu
      ):
          all_data.append(yield_data)
  
      total_num = len(all_data)
      loop_num = int(np.ceil(total_num / batch_size))
  
      res = []
      for iter_id in range(loop_num):
          batch_data = []
          handle_id = iter_id * batch_size
          for image_id in range(batch_size):
              try:
                  batch_data.append(all_data[handle_id + image_id])
              except:
                  pass
          # feed batch image
          batch_image = np.array(
              [data["face"] for data in batch_data]
          ).astype("float32")
          predictor = (
              self.gpu_predictor if use_gpu else self.cpu_predictor
          )
          input_names = predictor.get_input_names()
          input_handle = predictor.get_input_handle(input_names[0])
          input_handle.copy_from_cpu(batch_image)
  
          predictor.run()
          output_names = predictor.get_output_names()
          output_handle = predictor.get_output_handle(output_names[0])
          points = output_handle.copy_to_cpu()
  
          for idx, sample in enumerate(batch_data):
              sample["points"] = points[idx].reshape(68, -1)
          res += batch_data
  
      res = postprocess(res, output_dir, visualization)
      return res
  
imports: from __future__ import absolute_import
  from __future__ import division
  import argparse
  import ast
  import os
  import numpy
  import paddle
  import paddle.jit
  import paddle.static
  from .data_feed import reader
  from .processor import base64_to_cv2
  from .processor import postprocess
  from paddle.inference import Config
  from paddle.inference import create_predictor
  import paddlehub
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import runnable
  from paddlehub.module.module import serving
label_desc: Use image node_id 5 for calling the FaceLandmarkLocalization obj's underlying member method code with example usage: obj.keypoint_detection(images, paths, batch_size, use_gpu, output_dir, visualization) and returns: res