Spaces:
Build error
Build error
add app
Browse files
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
os.system("wget https://github.com/nyx-ai/stylegan2-flax-tpu/releases/download/v0.1/cookie-256.pkl")
|
| 5 |
+
os.mkdir("generated_images")
|
| 6 |
+
|
| 7 |
+
def inference(seeds,truncation_psi):
|
| 8 |
+
os.system("python generate_images.py --checkpoint cookie-256.pkl --seeds"+ seeds+ "--truncation_psi "+ truncation_psi+" --out_path generated_images/")
|
| 9 |
+
return "generated_images/"+seeds+".png"
|
| 10 |
+
|
| 11 |
+
gr.Interface(inference,["number",gr.Slider(step=0.1)],"image").launch()
|