Module Name | attgan_celeba |
---|---|
Category | image generation |
Network | AttGAN |
Dataset | Celeba |
Fine-tuning supported or not | No |
Module Size | 167MB |
Latest update date | 2021-02-26 |
Data indicators | - |
-
- AttGAN is a Generative Adversarial Network, which uses classification loss and reconstruction loss to train the network. The PaddleHub Module is trained one Celeba dataset and currently supports attributes of "Bald", "Bangs", "Black_Hair", "Blond_Hair", "Brown_Hair", "Bushy_Eyebrows", "Eyeglasses", "Gender", "Mouth_Slightly_Open", "Mustache", "No_Beard", "Pale_Skin", "Aged".
-
-
paddlepaddle >= 1.5.2
-
paddlehub >= 1.0.0 | How to install PaddleHub
-
-
-
$ hub install attgan_celeba==1.0.0
-
In case of any problems during installation, please refer to:Windows_Quickstart | Linux_Quickstart | Mac_Quickstart.
-
-
-
$ hub run attgan_celeba --image "/PATH/TO/IMAGE" --style "target_attribute"
-
Parameters
-
image: Input image path.
-
style: Specify the attributes to be converted. The options are "Bald", "Bangs", "Black_Hair", "Blond_Hair", "Brown_Hair", "Bushy_Eyebrows", "Eyeglasses", "Gender", "Mouth_Slightly_Open", "Mustache", "No_Beard", "Pale_Skin", "Aged". You can choose one of the options.
-
-
If you want to call the Hub module through the command line, please refer to: PaddleHub Command Line Instruction
-
-
-
import paddlehub as hub attgan = hub.Module(name="attgan_celeba") test_img_path = ["/PATH/TO/IMAGE"] trans_attr = ["Bangs"] # set input dict input_dict = {"image": test_img_path, "style": trans_attr} # execute predict and print the result results = attgan.generate(data=input_dict) print(results)
-
-
-
def generate(data)
-
Style transfer API.
-
Parameter
- data(list[dict]): Each element in the list is dict and each field is:
- image (list[str]): Each element in the list is the path of the image to be converted.
- style (list[str]): Each element in the list is a string, fill in the face attributes to be converted.
- data(list[dict]): Each element in the list is dict and each field is:
-
Return
- res (list[str]): Save path of the result.
-
-
-
1.0.0
First release