Upload 3 files
Browse files- README.md +5 -5
- app.py +21 -39
- requirements.txt +0 -3
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
---
|
| 2 |
-
title: Iris
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 3.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Iris Monitoring
|
| 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
|
app.py
CHANGED
|
@@ -1,49 +1,31 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
-
import requests
|
| 4 |
import hopsworks
|
| 5 |
-
import joblib
|
| 6 |
-
import pandas as pd
|
| 7 |
|
| 8 |
project = hopsworks.login()
|
| 9 |
fs = project.get_feature_store()
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
print("Model downloaded")
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
return img
|
| 34 |
-
|
| 35 |
-
demo = gr.Interface(
|
| 36 |
-
fn=iris,
|
| 37 |
-
title="Iris Flower Predictive Analytics",
|
| 38 |
-
description="Experiment with sepal/petal lengths/widths to predict which flower it is.",
|
| 39 |
-
allow_flagging="never",
|
| 40 |
-
inputs=[
|
| 41 |
-
gr.inputs.Number(default=2.0, label="sepal length (cm)"),
|
| 42 |
-
gr.inputs.Number(default=1.0, label="sepal width (cm)"),
|
| 43 |
-
gr.inputs.Number(default=2.0, label="petal length (cm)"),
|
| 44 |
-
gr.inputs.Number(default=1.0, label="petal width (cm)"),
|
| 45 |
-
],
|
| 46 |
-
outputs=gr.Image(type="pil"))
|
| 47 |
-
|
| 48 |
-
demo.launch(debug=True)
|
| 49 |
|
|
|
|
|
|
| 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_iris.png")
|
| 11 |
+
dataset_api.download("Resources/images/actual_iris.png")
|
| 12 |
+
dataset_api.download("Resources/images/df_recent.png")
|
| 13 |
+
dataset_api.download("Resources/images/confusion_matrix.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_iris.png", elem_id="predicted-img")
|
| 20 |
+
with gr.Column():
|
| 21 |
+
gr.Label("Today's Actual Image")
|
| 22 |
+
input_img = gr.Image("actual_iris.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.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.png", elem_id="confusion-matrix")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
demo.launch()
|
requirements.txt
CHANGED
|
@@ -1,4 +1 @@
|
|
| 1 |
-
httpx==0.24.1
|
| 2 |
hopsworks
|
| 3 |
-
joblib
|
| 4 |
-
scikit-learn==1.1.1
|
|
|
|
|
|
|
| 1 |
hopsworks
|
|
|
|
|
|