File size: 729 Bytes
2979765
 
 
 
 
 
 
e847a79
2726570
2979765
37ab172
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
import os

os.system("wget https://github.com/nyx-ai/stylegan2-flax-tpu/releases/download/v0.1/cookie-256.pkl")
os.mkdir("generated_images")

def inference(seeds,truncation_psi):
    os.system("python generate_images.py --checkpoint cookie-256.pkl --seeds "+str(int(seeds))+" --truncation_psi "+str(truncation_psi)+" --out_path generated_images/")
    return "generated_images/"+str(int(seeds))+".png"

title="stylegan2-flax-tpu"
description="# Gradio demo for [nyx-ai/stylegan2-flax-tpu](https://github.com/nyx-ai/stylegan2-flax-tpu). Demo uses the pretrained model for cookies"
gr.Interface(inference,["number",gr.Slider(step=0.1,value=0.7,maximum=2.0)],"image",title=title,description=description).launch()