Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.2.0
metadata
title: Iris Detector
emoji: 🌸
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
🌸 Iris Detector
A simple Gradio Space that predicts iris species using a K-Nearest Neighbors classifier (k=5).
Features
- 4 numeric inputs: sepal length, sepal width, petal length, petal width
- Predicts one of 3 classes:
setosa,versicolor,virginica - Shows probability distribution
- Exposes API endpoint
/run/predictfor programmatic access
API Usage
Endpoint:
POST https://huggingface.co/spaces/tofighi/iris-detector/run/predict
Request Body Example:
{
"data": [[5.1, 3.5, 1.4, 0.2]]
}
Response Example:
{
"data": [
{
"predicted_class": "setosa",
"probabilities": {
"setosa": 1.0,
"versicolor": 0.0,
"virginica": 0.0
}
}
]
}
Python Example:
import requests
url = "https://huggingface.co/spaces/tofighi/iris-detector/run/predict"
payload = {"data": [[5.1, 3.5, 1.4, 0.2]]}
resp = requests.post(url, json=payload)
print(resp.json())