import streamlit as st from transformers import pipeline pipe = pipeline("image-classification", model="ombhojane/healthyPlantsModel", backend="pytorch") def predict_disease(image): """Predicts the disease of a plant from an image. Args: image: A NumPy array representing the image. Returns: A string representing the predicted disease. """ prediction = pipe(image) label = prediction[0]["label"] return label def main(): """Creates the Streamlit app.""" st.title("Plant Disease Detection App") # Upload an image image = st.file_uploader("Upload an image of a plant") # Predict the disease if image is not None: disease = predict_disease(image) # Display the prediction st.markdown(f"Predicted disease: {disease}") if __name__ == "__main__": main()