aliabd HF staff commited on
Commit
5e47e19
1 Parent(s): d3d2403

Upload with huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +5 -5
  2. app.py +32 -0
README.md CHANGED
@@ -1,12 +1,12 @@
 
1
  ---
2
- title: Fake Gan No Input
3
- emoji: 📈
4
  colorFrom: indigo
5
- colorTo: purple
6
  sdk: gradio
7
  sdk_version: 3.3.1
 
8
  app_file: app.py
9
  pinned: false
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+
2
  ---
3
+ title: fake_gan_no_input
4
+ emoji: 🔥
5
  colorFrom: indigo
6
+ colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.3.1
9
+
10
  app_file: app.py
11
  pinned: false
12
  ---
 
 
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This demo needs to be run from the repo folder.
2
+ # python demo/fake_gan/run.py
3
+ import random
4
+ import time
5
+
6
+ import gradio as gr
7
+
8
+
9
+ def fake_gan():
10
+ time.sleep(1)
11
+ image = random.choice(
12
+ [
13
+ "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=387&q=80",
14
+ "https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=386&q=80",
15
+ "https://images.unsplash.com/photo-1542909168-82c3e7fdca5c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8aHVtYW4lMjBmYWNlfGVufDB8fDB8fA%3D%3D&w=1000&q=80",
16
+ "https://images.unsplash.com/photo-1546456073-92b9f0a8d413?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=387&q=80",
17
+ "https://images.unsplash.com/photo-1601412436009-d964bd02edbc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=464&q=80",
18
+ ]
19
+ )
20
+ return image
21
+
22
+
23
+ demo = gr.Interface(
24
+ fn=fake_gan,
25
+ inputs=None,
26
+ outputs=gr.Image(label="Generated Image"),
27
+ title="FD-GAN",
28
+ description="This is a fake demo of a GAN. In reality, the images are randomly chosen from Unsplash.",
29
+ )
30
+
31
+ if __name__ == "__main__":
32
+ demo.launch()