Orangefish commited on
Commit
06e1892
1 Parent(s): 2157f2c

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +44 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+ # coding: utf-8
3
+
4
+ # In[ ]:
5
+
6
+
7
+ import gradio as gr
8
+ from PIL import Image
9
+ import hopsworks
10
+
11
+ project = hopsworks.login()
12
+ fs = project.get_feature_store()
13
+
14
+ dataset_api = project.get_dataset_api()
15
+
16
+ dataset_api.download("Resources/images/pred_passenger.png", overwrite=True)
17
+ dataset_api.download("Resources/images/actual_passenger.png", overwrite=True)
18
+ dataset_api.download("Resources/images/df_recent.png", overwrite=True)
19
+ dataset_api.download("Resources/images/confusion_matrix.png", overwrite=True)
20
+
21
+ with gr.Blocks() as demo:
22
+ with gr.Row():
23
+ with gr.Column():
24
+ gr.Label("Today's Predicted Image")
25
+ input_img = gr.Image("pred_passenger.png", elem_id="predicted-img")
26
+ with gr.Column():
27
+ gr.Label("Today's Actual Image")
28
+ input_img = gr.Image("actual_passenger.png", elem_id="actual-img")
29
+ with gr.Row():
30
+ with gr.Column():
31
+ gr.Label("Recent Prediction History")
32
+ input_img = gr.Image("df_recent.png", elem_id="recent-predictions")
33
+ with gr.Column():
34
+ gr.Label("Confusion Maxtrix with Historical Prediction Performance")
35
+ input_img = gr.Image("confusion_matrix.png", elem_id="confusion-matrix")
36
+
37
+ demo.launch()
38
+
39
+
40
+ # In[ ]:
41
+
42
+
43
+
44
+
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ hopsworks
2
+ joblib
3
+ scikit-learn