docstr: images (list[numpy.ndarray]): data of images, shape of each is [H, W, C], color space must be BGR(read by cv2).
  paths (list[str]): paths to images
  
  output_dir (str): the dir to save the results
  use_gpu (bool): if True, use gpu to perform the computation, otherwise cpu.
  visualization (bool): if True, save results in output_dir.
docstr_tok: ["images","(","list","[","numpy.ndarray","]",")",":","data","of","images",",","shape","of","each","is","[","H",",","W",",","C","]",",","color","space","must","be","BGR","(","read","by","cv2",")",".","paths","(","list","[","str","]",")",":","paths","to","images","output_dir","(","str",")",":","the","dir","to","save","the","results","use_gpu","(","bool",")",":","if","True",",","use","gpu","to","perform","the","computation",",","otherwise","cpu",".","visualization","(","bool",")",":","if","True",",","save","results","in","output_dir","."]
code: def photo_transfer(
      self,
      images: list = None,
      paths: list = None,
      output_dir: str = "./transfer_result/",
      use_gpu: bool = False,
      visualization: bool = True,
  ):
      """
      images (list[numpy.ndarray]): data of images, shape of each is [H, W, C], color space must be BGR(read by cv2).
      paths (list[str]): paths to images
  
      output_dir (str): the dir to save the results
      use_gpu (bool): if True, use gpu to perform the computation, otherwise cpu.
      visualization (bool): 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 in images:
              image = image[:, :, ::-1]
              out = self.network.run(image)
              results.append(out)
  
      if paths != None:
          for path in paths:
              image = cv2.imread(path)[:, :, ::-1]
              out = self.network.run(image)
              results.append(out)
  
      if visualization == True:
          if not os.path.exists(output_dir):
              os.makedirs(output_dir, exist_ok=True)
          for i, out in enumerate(results):
              if out is not None:
                  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 PhotoPenPredictor
  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 Photopen obj's underlying member method code with example usage: obj.photo_transfer(images, paths, output_dir, use_gpu, visualization) and returns: results