Module Name | Photo2Cartoon |
---|---|
Category | image generation |
Network | U-GAT-IT |
Dataset | cartoon_data |
Fine-tuning supported or not | No |
Module Size | 205MB |
Latest update date | 2021-02-26 |
Data indicators | - |
-
- This module encapsulates project photo2cartoon.
-
-
paddlepaddle >= 2.0.0
-
paddlehub >= 2.0.0 | How to install PaddleHub
-
-
-
$ hub install Photo2Cartoon
- In case of any problems during installation, please refer to: Windows_Quickstart | Linux_Quickstart | Mac_Quickstart
-
-
-
import paddlehub as hub import cv2 model = hub.Module(name="Photo2Cartoon") result = model.Cartoon_GEN(images=[cv2.imread('/PATH/TO/IMAGE')]) # or # result = model.Cartoon_GEN(paths=['/PATH/TO/IMAGE'])
-
-
-
def Cartoon_GEN(images=None, paths=None, batch_size=1, output_dir='output', visualization=False, use_gpu=False):
-
Cartoon style generation API.
-
Parameters
- images (list[numpy.ndarray]): image data, ndarray.shape is in the format [H, W, C], BGR;
- paths (list[str]): image path;
- output_dir (str): save path of images;
- batch_size (int): the size of batch;
- visualization (bool): Whether to save the results as picture files;
- use_gpu (bool): use GPU or not; set the CUDA_VISIBLE_DEVICES environment variable first if you are using GPU
NOTE: choose one parameter to provide data from paths and images
-
Return
- res (list[numpy.ndarray]): result list,ndarray.shape is [H, W, C]
-
-
-
1.0.0
First release
-
$ hub install Photo2Cartoon==1.0.0
-