mrzaeem102 commited on
Commit
8f7c658
·
verified ·
1 Parent(s): 1cabb9d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -0
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import joblib
3
+
4
+ model = joblib.load("iris_model.pkl")
5
+
6
+ classes = ["Setosa", "Versicolor", "Virginica"]
7
+
8
+ def predict_flower(sl, sw, pl, pw):
9
+ prediction = model.predict([[sl, sw, pl, pw]])
10
+ return classes[prediction[0]]
11
+
12
+ demo = gr.Interface(
13
+ fn=predict_flower,
14
+ inputs=[
15
+ gr.Number(label="Sepal Length (cm)"),
16
+ gr.Number(label="Sepal Width (cm)"),
17
+ gr.Number(label="Petal Length (cm)"),
18
+ gr.Number(label="Petal Width (cm)")
19
+ ],
20
+ outputs=gr.Textbox(label="Predicted Species"),
21
+ title="🌸 Iris Flower Classification AI",
22
+ description="Enter flower measurements to predict the Iris species using Machine Learning."
23
+ )
24
+
25
+ demo.launch()