pierrelf commited on
Commit
b0dbd3f
·
1 Parent(s): 43234a6

Add image downloads and Gradio interface

Browse files
Files changed (2) hide show
  1. app.py +27 -4
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,7 +1,30 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/images/latest_wine.png")
10
+ dataset_api.download("Resources/images/actual_wine.png")
11
+ # dataset_api.download("Resources/images/df_recent.png")
12
+ # dataset_api.download("Resources/images/confusion_matrix.png")
13
+
14
+ with gr.Blocks() as demo:
15
+ with gr.Row():
16
+ with gr.Column():
17
+ gr.Label("Today's Predicted Wine")
18
+ input_img = gr.Image("latest_win.png", elem_id="predicted-img")
19
+ with gr.Column():
20
+ gr.Label("Today's Actual Wine")
21
+ input_img = gr.Image("actual_wine.png", elem_id="actual-img")
22
+ # with gr.Row():
23
+ # with gr.Column():
24
+ # gr.Label("Recent Prediction History")
25
+ # input_img = gr.Image("df_recent.png", elem_id="recent-predictions")
26
+ # with gr.Column():
27
+ # gr.Label("Confusion Maxtrix with Historical Prediction Performance")
28
+ # input_img = gr.Image("confusion_matrix.png", elem_id="confusion-matrix")
29
+
30
+ demo.launch()
requirements.txt CHANGED
@@ -0,0 +1 @@
 
 
1
+ gradio