From a2990ba0cc362b4799e7a41d89b6bf1008501545 Mon Sep 17 00:00:00 2001 From: chenjian Date: Mon, 14 Mar 2022 11:52:10 +0800 Subject: [PATCH] fix --- .../image/image_processing/prnet/module.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/image/image_processing/prnet/module.py b/modules/image/image_processing/prnet/module.py index a35c81e9..8f074541 100644 --- a/modules/image/image_processing/prnet/module.py +++ b/modules/image/image_processing/prnet/module.py @@ -39,25 +39,25 @@ class PRNet: self.network = PRN(is_dlib=True, prefix=self.directory) def face_swap(self, - images=None, - paths=None, - mode=0, - output_dir='./swapping_result/', - use_gpu=False, - visualization=True): + images: list = None, + paths: list = None, + mode: int = 0, + output_dir: str = './swapping_result/', + use_gpu: bool = False, + visualization: bool = True): ''' Denoise a raw image in the low-light scene. - images (list[dict]): data of images, 每一个元素都为一个 dict,有关键字 source, ref, 相应取值为: - - source (numpy.ndarray): 待转换的图片,shape 为 \[H, W, C\],BGR格式;
- - ref (numpy.ndarray) : 参考图像,shape为 \[H, W, C\],BGR格式;
- paths (list[str]): paths to images, 每一个元素都为一个dict, 有关键字 source, ref, 相应取值为: - - source (str): 待转换的图片的路径;
- - ref (str) : 参考图像的路径;
- mode: option, 0 for change part of texture, 1 for change whole face - 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. + images (list[dict]): data of images, each element is a dict: + - source (numpy.ndarray): input image,shape is \[H, W, C\],BGR format;
+ - ref (numpy.ndarray) : style image,shape is \[H, W, C\],BGR format;
+ paths (list[dict]): paths to images, eacg element is a dict: + - source (str): path to input image;
+ - ref (str) : path to reference image;
+ mode (int): option, 0 for change part of texture, 1 for change whole face + 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() -- GitLab