mrzaeem102's picture
Create app.py
8f7c658 verified
Raw History Blame
701 Bytes
import gradio as gr
import joblib
model = joblib.load("iris_model.pkl")
classes = ["Setosa", "Versicolor", "Virginica"]
def predict_flower(sl, sw, pl, pw):
prediction = model.predict([[sl, sw, pl, pw]])
return classes[prediction[0]]
demo = gr.Interface(
fn=predict_flower,
inputs=[
gr.Number(label="Sepal Length (cm)"),
gr.Number(label="Sepal Width (cm)"),
gr.Number(label="Petal Length (cm)"),
gr.Number(label="Petal Width (cm)")
],
outputs=gr.Textbox(label="Predicted Species"),
title="🌸 Iris Flower Classification AI",
description="Enter flower measurements to predict the Iris species using Machine Learning."
)
demo.launch()