docstr: Transfer a image to stars style.
  
  images (list[dict]): data of images, 每一个元素都为一个 dict，有关键字 content, style, 相应取值为：
    - content (numpy.ndarray): 待转换的图片，shape 为 \[H, W, C\]，BGR格式；<br/>
    - style (numpy.ndarray) : 妆容图像，shape为 \[H, W, C\]，BGR格式；<br/>
  paths (list[str]): paths to images, 每一个元素都为一个dict, 有关键字 content, style, 相应取值为：
    - content (str): 待转换的图片的路径；<br/>
    - style (str) : 妆容图像的路径；<br/>
  
  output_dir: the dir to save the results
  use_gpu: if True, use gpu to perform the computation, otherwise cpu.
  visualization: if True, save results in output_dir.
docstr_tok: ["Transfer","a","image","to","stars","style",".","images","(","list","[","dict","]",")",":","data","of","images",",","\u6bcf\u4e00\u4e2a\u5143\u7d20\u90fd\u4e3a\u4e00\u4e2a","dict\uff0c\u6709\u5173\u952e\u5b57","content",",","style",",","\u76f8\u5e94\u53d6\u503c\u4e3a\uff1a","-","content","(","numpy.ndarray",")",":","\u5f85\u8f6c\u6362\u7684\u56fe\u7247\uff0cshape","\u4e3a","\\","[","H",",","W",",","C\\","]","\uff0cBGR\u683c\u5f0f\uff1b","<","br\/",">","-","style","(","numpy.ndarray",")",":","\u5986\u5bb9\u56fe\u50cf\uff0cshape\u4e3a","\\","[","H",",","W",",","C\\","]","\uff0cBGR\u683c\u5f0f\uff1b","<","br\/",">","paths","(","list","[","str","]",")",":","paths","to","images",",","\u6bcf\u4e00\u4e2a\u5143\u7d20\u90fd\u4e3a\u4e00\u4e2adict",",","\u6709\u5173\u952e\u5b57","content",",","style",",","\u76f8\u5e94\u53d6\u503c\u4e3a\uff1a","-","content","(","str",")",":","\u5f85\u8f6c\u6362\u7684\u56fe\u7247\u7684\u8def\u5f84\uff1b","<","br\/",">","-","style","(","str",")",":","\u5986\u5bb9\u56fe\u50cf\u7684\u8def\u5f84\uff1b","<","br\/",">","output_dir",":","the","dir","to","save","the","results","use_gpu",":","if","True",",","use","gpu","to","perform","the","computation",",","otherwise","cpu",".","visualization",":","if","True",",","save","results","in","output_dir","."]
code: def makeup_transfer(
      self,
      images=None,
      paths=None,
      output_dir="./transfer_result/",
      use_gpu=False,
      visualization=True,
  ):
      """
      Transfer a image to stars style.
  
      images (list[dict]): data of images, 每一个元素都为一个 dict，有关键字 content, style, 相应取值为：
        - content (numpy.ndarray): 待转换的图片，shape 为 \[H, W, C\]，BGR格式；<br/>
        - style (numpy.ndarray) : 妆容图像，shape为 \[H, W, C\]，BGR格式；<br/>
      paths (list[str]): paths to images, 每一个元素都为一个dict, 有关键字 content, style, 相应取值为：
        - content (str): 待转换的图片的路径；<br/>
        - style (str) : 妆容图像的路径；<br/>
  
      output_dir: the dir to save the results
      use_gpu: if True, use gpu to perform the computation, otherwise cpu.
      visualization: if True, save results in output_dir.
      """
      results = []
      paddle.disable_static()
      place = "gpu:0" if use_gpu else "cpu"
      place = paddle.set_device(place)
      if images == None and paths == None:
          print(
              "No image provided. Please input an image or a image path."
          )
          return
  
      if images != None:
          for image_dict in images:
              content_img = image_dict["content"][:, :, ::-1]
              style_img = image_dict["style"][:, :, ::-1]
              results.append(self.network.run(content_img, style_img))
  
      if paths != None:
          for path_dict in paths:
              content_img = cv2.imread(path_dict["content"])[:, :, ::-1]
              style_img = cv2.imread(path_dict["style"])[:, :, ::-1]
              results.append(self.network.run(content_img, style_img))
  
      if visualization == True:
          if not os.path.exists(output_dir):
              os.makedirs(output_dir, exist_ok=True)
          for i, out in enumerate(results):
              cv2.imwrite(
                  os.path.join(output_dir, "output_{}.png".format(i)),
                  out[:, :, ::-1],
              )
  
      return results
  
imports: import argparse
  import copy
  import os
  import cv2
  import numpy
  import paddle
  from ppgan.utils.config import get_config
  from skimage.io import imread
  from skimage.transform import rescale
  from skimage.transform import resize
  import paddlehub
  from .model import PSGANPredictor
  from .util import base64_to_cv2
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import runnable
  from paddlehub.module.module import serving
label_desc: Use image node_id 2 for calling the psgan obj's underlying member method code with example usage: obj.makeup_transfer(images, paths, output_dir, use_gpu, visualization) and returns: results