import gradio as gr import os import sys os.system("mkdir pose2pose") os.system("cd pose2pose") os.system("mkdir -p datasets/DeepFashion") os.system("mkdir -p output/DeepFashion/ckpt/pretrained") os.system("git clone https://github.com/prasunroy/pose-transfer.git") os.system("cd pose-transfer") os.system("pip install -r requirements.txt") sys.path.append("pose-transfer") import torch from api import Pose2Pose from PIL import Image p2p = Pose2Pose(pretrained=True) def infer(con_im,ref_im): condition = Image.open(con_im) reference = Image.open(ref_im) generated = p2p.transfer_as(condition, reference) #generated.show() return generated def transf(inp): return inp with gr.Blocks() as app: gr.Markdown("