File size: 1,024 Bytes
7a9d89d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
os.system("hub install openpose_body_estimation==1.0.0")
import gradio as gr
import paddlehub as hub
import numpy as np

model = hub.Module(name='openpose_body_estimation')
def inference(image):
    result = model.predict(image.name)
    return Image.fromarray(np.uint8(result[0])[:,:,::-1]).convert('RGB')
    
title = "UGATIT-selfie2anime"
description = "Gradio demo for UGATIT-selfie2anime. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1907.10830' target='_blank'>U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation</a> | <a href='https://github.com/taki0112/UGATIT' target='_blank'>Github Repo</a></p>"

iface = gr.Interface(inference, inputs=gr.inputs.Image(type="file"), outputs=gr.outputs.Image(type="pil"),enable_queue=True,title=title,article=article,description=description)
iface.launch()