from asyncio import constants import gradio as gr import requests import os from base64 import b64decode from PIL import Image import io import numpy as np def generate_image(seed,psi): iface = gr.Interface.load("spaces/hysts/StyleGAN-Human") print("calling interface",seed,psi) img=iface(seed,psi) return img #img=iface.fns[0].fn(seed,psi) #wrong format, gah! convert to numpy array #header, encoded = img.split(",", 1) #data = b64decode(encoded) #image = Image.open(io.BytesIO(data)) #image_np = np.array(image) #return image_np def generate_model(img): print("about to die") iface = gr.Interface.load("spaces/radames/PIFu-Clothed-Human-Digitization") print("calling interface") #model,file=iface.fns[0].fn(img) model,file=iface(img) #print("got result",result) return model,file demo = gr.Blocks() with demo: gr.Markdown("