import os os.system("hub install openpose_body_estimation==1.0.0") import gradio as gr import paddlehub as hub import numpy as np from PIL import Image 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 = "OpenPose" 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 = "

U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation | Github Repo

" 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()