SebastianoMeneghin commited on
Commit
8abdd8f
·
1 Parent(s): 4e6f65f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -0
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from PIL import Image
3
+ import hopsworks
4
+
5
+ hopsworks_iris_api_key = "bP6PFOAzbXllM89C.l9gzwKTyxct786c3V1gwIQEvbQfZnSELxp7UM4RdBhw0eTaqkdl1Ld2a4A32UmR9"
6
+ project = hopsworks.login(api_key_value = hopsworks_iris_api_key)
7
+ fs = project.get_feature_store()
8
+
9
+ dataset_api = project.get_dataset_api()
10
+
11
+ dataset_api.download("Resources/images/latest_iris.png")
12
+ dataset_api.download("Resources/images/actual_iris.png")
13
+ dataset_api.download("Resources/images/df_recent.png")
14
+ dataset_api.download("Resources/images/confusion_matrix.png")
15
+
16
+ with gr.Blocks() as demo:
17
+ with gr.Row():
18
+ with gr.Column():
19
+ gr.Label("Today's Predicted Image")
20
+ input_img = gr.Image("latest_iris.png", elem_id="predicted-img")
21
+ with gr.Column():
22
+ gr.Label("Today's Actual Image")
23
+ input_img = gr.Image("actual_iris.png", elem_id="actual-img")
24
+ with gr.Row():
25
+ with gr.Column():
26
+ gr.Label("Recent Prediction History")
27
+ input_img = gr.Image("df_recent.png", elem_id="recent-predictions")
28
+ with gr.Column():
29
+ gr.Label("Confusion Maxtrix with Historical Prediction Performance")
30
+ input_img = gr.Image("confusion_matrix.png", elem_id="confusion-matrix")
31
+
32
+ demo.launch()