tilos commited on
Commit
885c65a
1 Parent(s): 1067535

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +5 -4
  2. app.py +31 -0
  3. requirements.txt +1 -0
README.md CHANGED
@@ -1,12 +1,13 @@
1
  ---
2
  title: Titanic Monitor
3
- emoji: 🦀
4
- colorFrom: gray
5
- colorTo: red
6
  sdk: gradio
7
- sdk_version: 3.10.1
8
  app_file: app.py
9
  pinned: false
 
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
  title: Titanic Monitor
3
+ emoji: 💻
4
+ colorFrom: blue
5
+ colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 3.8.2
8
  app_file: app.py
9
  pinned: false
10
+ license: apache-2.0
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from PIL import Image
3
+ import hopsworks
4
+
5
+ project = hopsworks.login(api_key_value="CDqcnm3gyfxjyCO8.TZwOClLOwCqDp33vX0P5Q2nsvNNyEhfBMArwNoPjnb9tUSSKq6I8X35HQ5D2tlJ7")
6
+ fs = project.get_feature_store()
7
+
8
+ dataset_api = project.get_dataset_api()
9
+
10
+ dataset_api.download("Resources/images/latest_titanic.png")
11
+ dataset_api.download("Resources/images/actual_titanic.png")
12
+ dataset_api.download("Resources/images/df_recent_titanic.png")
13
+ dataset_api.download("Resources/images/confusion_matrix_titanic.png")
14
+
15
+ with gr.Blocks() as demo:
16
+ with gr.Row():
17
+ with gr.Column():
18
+ gr.Label("Today's Predicted Image")
19
+ input_img = gr.Image("latest_titanic.png", elem_id="predicted-img")
20
+ with gr.Column():
21
+ gr.Label("Today's Actual Image")
22
+ input_img = gr.Image("actual_titanic.png", elem_id="actual-img")
23
+ with gr.Row():
24
+ with gr.Column():
25
+ gr.Label("Recent Prediction History")
26
+ input_img = gr.Image("df_recent_titanic.png", elem_id="recent-predictions")
27
+ with gr.Column():
28
+ gr.Label("Confusion Maxtrix with Historical Prediction Performance")
29
+ input_img = gr.Image("confusion_matrix_titanic.png", elem_id="confusion-matrix")
30
+
31
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ hopsworks