Spaces:
Runtime error
Runtime error
asjdaiu
Browse files
app.py
CHANGED
|
@@ -1,36 +1,31 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import hopsworks
|
| 3 |
from PIL import Image
|
|
|
|
| 4 |
|
| 5 |
project = hopsworks.login()
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
def __init__(self, path, project) -> None:
|
| 9 |
-
self.path = path
|
| 10 |
-
self.image_name = path[path.rfind('/') + 1:]
|
| 11 |
-
self.project = project
|
| 12 |
-
|
| 13 |
-
def __call__(self):
|
| 14 |
-
dataset_api = self.project.get_dataset_api()
|
| 15 |
-
dataset_api.download(self.path, overwrite=True)
|
| 16 |
-
return Image.open(self.image_name)
|
| 17 |
-
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
with gr.Blocks() as demo:
|
| 21 |
with gr.Row():
|
| 22 |
with gr.Column():
|
| 23 |
gr.Label("Today's Predicted Image")
|
| 24 |
-
input_img = gr.Image(
|
| 25 |
with gr.Column():
|
| 26 |
gr.Label("Today's Actual Image")
|
| 27 |
-
input_img = gr.Image(
|
| 28 |
with gr.Row():
|
| 29 |
with gr.Column():
|
| 30 |
gr.Label("Recent Prediction History")
|
| 31 |
-
input_img = gr.Image(
|
| 32 |
with gr.Column():
|
| 33 |
-
gr.Label("Confusion Maxtrix with Historical Prediction Performance")
|
| 34 |
-
input_img = gr.Image(
|
| 35 |
|
| 36 |
-
demo.launch(
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
+
import hopsworks
|
| 4 |
|
| 5 |
project = hopsworks.login()
|
| 6 |
+
fs = project.get_feature_store()
|
| 7 |
|
| 8 |
+
dataset_api = project.get_dataset_api()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
dataset_api.download("Resources/images/latest_wine.png", overwrite=True)
|
| 11 |
+
dataset_api.download("Resources/images/actual_wine.png", overwrite=True)
|
| 12 |
+
dataset_api.download("Resources/images/df_wine_recent.png", overwrite=True)
|
| 13 |
+
dataset_api.download("Resources/images/wine_confusion_matrix.png", overwrite=True)
|
| 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_wine.png", elem_id="predicted-img")
|
| 20 |
with gr.Column():
|
| 21 |
gr.Label("Today's Actual Image")
|
| 22 |
+
input_img = gr.Image("actual_wine.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_wine_recent.png", elem_id="recent-predictions")
|
| 27 |
with gr.Column():
|
| 28 |
+
gr.Label("Confusion Maxtrix with Historical Prediction Performance")
|
| 29 |
+
input_img = gr.Image("wine_confusion_matrix.png", elem_id="confusion-matrix")
|
| 30 |
|
| 31 |
+
demo.launch()
|