CZerion's picture
Update app.py
2f711c6 verified
raw
history blame
625 Bytes
import gradio as gr
from crop_health_monitor.inference.inference import load_disease_pipeline, diagnose
# load your published model or local checkpoint
pipe = load_disease_pipeline("CZerion/crop_health_monitor")
iface = gr.Interface(
fn=lambda img: diagnose(img, pipe),
inputs=gr.Image(type="pil", label="Upload Leaf Image"),
outputs=[
gr.Textbox(label="Disease Predictions (Top 3)"),
gr.Textbox(label="Care Advice")
],
title="Plant Disease Monitor",
description="Upload a crop leaf photo to detect diseases using a fine-tuned model."
)
if __name__ == "__main__":
iface.launch()