Spaces:
Runtime error
Runtime error
Commit
·
a1d5893
1
Parent(s):
29eb6fa
variablesynthetic
Browse files
app.py
CHANGED
@@ -2,7 +2,22 @@ import gradio as gr
|
|
2 |
from PIL import Image
|
3 |
import hopsworks
|
4 |
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
with gr.Blocks() as demo:
|
7 |
project = hopsworks.login()
|
8 |
fs = project.get_feature_store()
|
@@ -10,39 +25,39 @@ with gr.Blocks() as demo:
|
|
10 |
dataset_api = project.get_dataset_api()
|
11 |
|
12 |
print('Downloading...')
|
13 |
-
dataset_api.download("Resources/images/
|
14 |
dataset_api.download(
|
15 |
-
"Resources/images/
|
16 |
dataset_api.download(
|
17 |
-
"Resources/images/
|
18 |
-
dataset_api.download("Resources/images/
|
19 |
-
dataset_api.download("Resources/images/
|
20 |
|
21 |
with gr.Column():
|
22 |
gr.Label("Today's passenger")
|
23 |
-
input_img = gr.Image("
|
24 |
elem_id="passenger-img").style(
|
25 |
height='100', rounded=False)
|
26 |
with gr.Row():
|
27 |
with gr.Column():
|
28 |
gr.Label("Today's predicted survival")
|
29 |
input_img = gr.Image(
|
30 |
-
"
|
31 |
height='100', rounded=False)
|
32 |
with gr.Column():
|
33 |
gr.Label("Today's actual survival")
|
34 |
input_img = gr.Image(
|
35 |
-
"
|
36 |
height='100', rounded=False)
|
37 |
with gr.Row():
|
38 |
with gr.Column():
|
39 |
gr.Label("Recent Prediction History")
|
40 |
input_img = gr.Image(
|
41 |
-
"
|
42 |
with gr.Column():
|
43 |
gr.Label(
|
44 |
"Confusion Maxtrix with Historical Prediction Performance")
|
45 |
-
input_img = gr.Image("
|
46 |
elem_id="confusion-matrix")
|
47 |
|
48 |
demo.launch()
|
|
|
2 |
from PIL import Image
|
3 |
import hopsworks
|
4 |
|
5 |
+
|
6 |
+
SYNTHETIC = False
|
7 |
+
|
8 |
+
latestSurvivorImage = 'latest_survivor_pred.png'
|
9 |
+
latestSurvivorPred = 'latest_survivor_label_pred.png'
|
10 |
+
latestSurvivorLabel = 'latest_survivor_label_actual.png'
|
11 |
+
recentHistory = 'df_recent_titanic.png'
|
12 |
+
confusionMatrix = 'confusion_matrix.png'
|
13 |
+
|
14 |
+
if SYNTHETIC:
|
15 |
+
latestSurvivorImage += '_synthetic'
|
16 |
+
latestSurvivorPred += '_synthetic'
|
17 |
+
latestSurvivorLabel += '_synthetic'
|
18 |
+
recentHistory += '_synthetic'
|
19 |
+
confusionMatrix += '_synthetic'
|
20 |
+
|
21 |
with gr.Blocks() as demo:
|
22 |
project = hopsworks.login()
|
23 |
fs = project.get_feature_store()
|
|
|
25 |
dataset_api = project.get_dataset_api()
|
26 |
|
27 |
print('Downloading...')
|
28 |
+
dataset_api.download(f"Resources/images/{latestSurvivorImage}")
|
29 |
dataset_api.download(
|
30 |
+
f"Resources/images/{latestSurvivorPred}")
|
31 |
dataset_api.download(
|
32 |
+
f"Resources/images/{latestSurvivorLabel}")
|
33 |
+
dataset_api.download(f"Resources/images/{recentHistory}")
|
34 |
+
dataset_api.download(f"Resources/images/{confusionMatrix}")
|
35 |
|
36 |
with gr.Column():
|
37 |
gr.Label("Today's passenger")
|
38 |
+
input_img = gr.Image(f"{latestSurvivorImage}",
|
39 |
elem_id="passenger-img").style(
|
40 |
height='100', rounded=False)
|
41 |
with gr.Row():
|
42 |
with gr.Column():
|
43 |
gr.Label("Today's predicted survival")
|
44 |
input_img = gr.Image(
|
45 |
+
f"{latestSurvivorPred}", elem_id="predicted-img").style(
|
46 |
height='100', rounded=False)
|
47 |
with gr.Column():
|
48 |
gr.Label("Today's actual survival")
|
49 |
input_img = gr.Image(
|
50 |
+
f"{latestSurvivorLabel}", elem_id="actual-img").style(
|
51 |
height='100', rounded=False)
|
52 |
with gr.Row():
|
53 |
with gr.Column():
|
54 |
gr.Label("Recent Prediction History")
|
55 |
input_img = gr.Image(
|
56 |
+
f"{recentHistory}", elem_id="recent-predictions")
|
57 |
with gr.Column():
|
58 |
gr.Label(
|
59 |
"Confusion Maxtrix with Historical Prediction Performance")
|
60 |
+
input_img = gr.Image(f"{confusionMatrix}",
|
61 |
elem_id="confusion-matrix")
|
62 |
|
63 |
demo.launch()
|