提交 3478ee9b 编写于 作者: C chenjian

add type declaration

上级 a9a41455
...@@ -44,24 +44,24 @@ class Lapstyle_stars: ...@@ -44,24 +44,24 @@ class Lapstyle_stars:
self.network = LapStylePredictor(weight_path=self.pretrained_model) self.network = LapStylePredictor(weight_path=self.pretrained_model)
def style_transfer(self, def style_transfer(self,
images=None, images: list = None,
paths=None, paths: list = None,
output_dir='./transfer_result/', output_dir: str = './transfer_result/',
use_gpu=False, use_gpu: bool = False,
visualization=True): visualization: bool = True):
''' '''
Transfer a image to stars style. Transfer a image to stars style.
images (list[dict]): data of images, each element is a dict: images (list[dict]): data of images, each element is a dict:
- content (numpy.ndarray): input image,shape is \[H, W, C\],BGR format;<br/> - content (numpy.ndarray): input image,shape is \[H, W, C\],BGR format;<br/>
- style (numpy.ndarray) : style image,shape is \[H, W, C\],BGR format;<br/> - style (numpy.ndarray) : style image,shape is \[H, W, C\],BGR format;<br/>
paths (list[str]): paths to images, eacg element is a dict: paths (list[dict]): paths to images, eacg element is a dict:
- content (str): path to input image;<br/> - content (str): path to input image;<br/>
- style (str) : path to style image;<br/> - style (str) : path to style image;<br/>
output_dir: the dir to save the results output_dir (str): the dir to save the results
use_gpu: if True, use gpu to perform the computation, otherwise cpu. use_gpu (bool): if True, use gpu to perform the computation, otherwise cpu.
visualization: if True, save results in output_dir. visualization (bool): if True, save results in output_dir.
''' '''
results = [] results = []
paddle.disable_static() paddle.disable_static()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册