Spaces:
Build error
Build error
Commit
•
d0b2b17
1
Parent(s):
543448a
updating
Browse files
app.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import hopsworks
|
3 |
+
|
4 |
+
project = hopsworks.login()
|
5 |
+
fs = project.get_feature_store()
|
6 |
+
|
7 |
+
dataset_api = project.get_dataset_api()
|
8 |
+
|
9 |
+
dataset_api.download("Resources/predictions/latest_prediction.txt", overwrite=True)
|
10 |
+
dataset_api.download("Resources/predictions/actual_prediction.txt", overwrite=True)
|
11 |
+
dataset_api.download("Resources/images/df_recent.png", overwrite=True)
|
12 |
+
dataset_api.download("Resources/images/confusion_matrix.png", overwrite=True)
|
13 |
+
|
14 |
+
with open("latest_prediction.txt") as file:
|
15 |
+
latest_pred = file.read()
|
16 |
+
with open("actual_prediction.txt") as file:
|
17 |
+
actual_pred = file.read()
|
18 |
+
|
19 |
+
with gr.Blocks() as demo:
|
20 |
+
with gr.Row():
|
21 |
+
with gr.Column():
|
22 |
+
gr.Label("Today's Predicted Person")
|
23 |
+
input_img = gr.Textbox(latest_pred, elem_id="predicted person")
|
24 |
+
with gr.Column():
|
25 |
+
gr.Label("Today's Actual Person")
|
26 |
+
input_img = gr.Textbox(actual_pred, elem_id="actual person")
|
27 |
+
with gr.Row():
|
28 |
+
with gr.Column():
|
29 |
+
gr.Label("Recent Prediction History")
|
30 |
+
input_img = gr.Image("df_recent.png", elem_id="recent-predictions")
|
31 |
+
with gr.Column():
|
32 |
+
gr.Label("Confusion Maxtrix with Historical Prediction Performance")
|
33 |
+
input_img = gr.Image("confusion_matrix.png", elem_id="confusion-matrix")
|
34 |
+
|
35 |
+
demo.launch()
|