Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,19 @@
|
|
|
|
|
|
1 |
import random
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
|
6 |
def fake_gan():
|
7 |
-
fileName = display_cifar_misclassified_data(misclassified_data, classes, inv_normalize, number_of_samples=5)
|
8 |
-
|
9 |
images = [
|
10 |
(random.choice(
|
11 |
[
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
14 |
]
|
15 |
), f"label {i}")
|
16 |
for i in range(3)
|
@@ -18,7 +21,6 @@ def fake_gan():
|
|
18 |
return images
|
19 |
|
20 |
|
21 |
-
|
22 |
with gr.Blocks() as demo:
|
23 |
gallery = gr.Gallery(
|
24 |
label="Generated images", show_label=False, elem_id="gallery"
|
@@ -28,4 +30,6 @@ with gr.Blocks() as demo:
|
|
28 |
btn.click(fake_gan, None, gallery)
|
29 |
|
30 |
if __name__ == "__main__":
|
31 |
-
demo.launch()
|
|
|
|
|
|
1 |
+
# This demo needs to be run from the repo folder.
|
2 |
+
# python demo/fake_gan/run.py
|
3 |
import random
|
4 |
|
5 |
import gradio as gr
|
6 |
|
7 |
|
8 |
def fake_gan():
|
|
|
|
|
9 |
images = [
|
10 |
(random.choice(
|
11 |
[
|
12 |
+
"http://www.marketingtool.online/en/face-generator/img/faces/avatar-1151ce9f4b2043de0d2e3b7826127998.jpg",
|
13 |
+
"http://www.marketingtool.online/en/face-generator/img/faces/avatar-116b5e92936b766b7fdfc242649337f7.jpg",
|
14 |
+
"http://www.marketingtool.online/en/face-generator/img/faces/avatar-1163530ca19b5cebe1b002b8ec67b6fc.jpg",
|
15 |
+
"http://www.marketingtool.online/en/face-generator/img/faces/avatar-1116395d6e6a6581eef8b8038f4c8e55.jpg",
|
16 |
+
"http://www.marketingtool.online/en/face-generator/img/faces/avatar-11319be65db395d0e8e6855d18ddcef0.jpg",
|
17 |
]
|
18 |
), f"label {i}")
|
19 |
for i in range(3)
|
|
|
21 |
return images
|
22 |
|
23 |
|
|
|
24 |
with gr.Blocks() as demo:
|
25 |
gallery = gr.Gallery(
|
26 |
label="Generated images", show_label=False, elem_id="gallery"
|
|
|
30 |
btn.click(fake_gan, None, gallery)
|
31 |
|
32 |
if __name__ == "__main__":
|
33 |
+
demo.launch()
|
34 |
+
|
35 |
+
|