File size: 1,251 Bytes
8bc6b47
 
 
 
fd00367
8bc6b47
 
 
 
 
 
ac1366c
fe34371
8bc6b47
 
 
 
 
e44703d
8bc6b47
a630925
8bc6b47
fe34371
 
8bc6b47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
import gradio as gr
from PIL import Image

os.system("git clone https://github.com/AK391/projected_gan.git")

os.chdir("projected_gan")

os.mkdir("outputs")


def inference(seeds):
  os.system("python gen_images.py --outdir=./outputs/ --seeds="+str(int(seeds))+" --network=https://s3.eu-central-1.amazonaws.com/avg-projects/projected_gan/models/pokemon.pkl")
  seeds = int(seeds)
  image = Image.open(f"./outputs/seed{seeds:04d}.png")
  return image

title = "Projected GAN"
description = "Gradio demo for Projected GANs Converge Faster, Pokemon. To use it, add seed, or click one of the examples to load them. Read more at the links below."

article = "<p style='text-align: center'><a href='http://www.cvlibs.net/publications/Sauer2021NEURIPS.pdf' target='_blank'>Projected GANs Converge Faster</a> | <a href='https://github.com/autonomousvision/projected_gan' target='_blank'>Github Repo</p><center><img src='https://visitor-badge.glitch.me/badge?page_id=akhaliq_projected_gan' alt='visitor badge'></center>"

gr.Interface(inference,gr.inputs.Slider(label="Seed",minimum=0, maximum=1000, step=1, default=0),"pil",title=title,description=description,article=article, examples=[
    [42]
    ]).launch(enable_queue=True,cache_examples=True)