SebastianoMeneghin commited on
Commit
4811067
·
1 Parent(s): 8eb59a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -0
app.py CHANGED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from PIL import Image
3
+ import hopsworks
4
+
5
+ hopsworks_iris_api_key = os.environ["HOPSWORKS_API_LAB1"]
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_wine_quality.png")
12
+ dataset_api.download("Resources/images/actual_wine_quality.png")
13
+ dataset_api.download("Resources/images/df_recent_wine.png")
14
+ dataset_api.download("Resources/images/confusion_matrix_wine.png")
15
+
16
+ with gr.Blocks() as demo:
17
+ with gr.Row():
18
+ with gr.Column():
19
+ gr.Label("Today's Predicted Wine Quality")
20
+ input_img = gr.Image("latest_wine_quality.png", elem_id="predicted-img")
21
+ with gr.Column():
22
+ gr.Label("Today's Actual Wine Image")
23
+ input_img = gr.Image("actual_wine_quality.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_wine.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_wine.png", elem_id="confusion-matrix")
31
+
32
+ demo.launch()