SevenhuijsenM commited on
Commit
8038473
·
1 Parent(s): 55b2237

Changed the app gui and paths

Browse files
Files changed (1) hide show
  1. app.py +43 -0
app.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from PIL import Image
3
+ import hopsworks
4
+
5
+ #login to hopswork
6
+ project = hopsworks.login()
7
+ fs = project.get_feature_store()
8
+
9
+ #get the dataset api
10
+ dataset_api = project.get_dataset_api()
11
+
12
+ #downloads form dataset the predicted wine, the actual wine, the recent file and the confusion matrix
13
+ dataset_api.download("Resources/texts/prediction.txt", overwrite=True)
14
+ dataset_api.download("Resources/texts/label.txt", overwrite=True)
15
+ dataset_api.download("Resources/images/wine/df_recent.png", overwrite=True)
16
+ dataset_api.download("Resources/images/wine/confusion_matrix.png", overwrite=True)
17
+
18
+ with gr.Blocks() as demo:
19
+ with gr.Row():
20
+ with gr.Column():
21
+ gr.Label("Today's Predicted quality")
22
+ f = open("prediction.txt", "r")
23
+ string = f.readline()
24
+ f.close()
25
+ input_img = gr.Textbox(string , elem_id="predicted-quality")
26
+
27
+ with gr.Column():
28
+ gr.Label("Today's Actual quality")
29
+ f = open("label.txt", "r")
30
+ string = f.readline()
31
+ f.close()
32
+ input_img = gr.Textbox(string, elem_id="actual-quality")
33
+
34
+ with gr.Row():
35
+
36
+ with gr.Column():
37
+ gr.Label("Recent Prediction History")
38
+ input_img = gr.Image("df_recent.png", elem_id="recent-predictions")
39
+ with gr.Column():
40
+ gr.Label("Confusion Maxtrix with Historical Prediction Performance")
41
+ input_img = gr.Image("confusion_matrix.png", elem_id="confusion-matrix")
42
+
43
+ demo.launch()