Spaces:
Build error
Build error
Update app.py
Browse files20 unmodified lines21222324252627282930313233343520 unmodified linespredictions = model.predict(img)predicted_class = np.argmax(predictions[0])confidence = predictions[0][predicted_class]# Get the predicted class and confidence scorereturn class_labels[predicted_class], confidence# Create the Gradio interfaceinterface = gr.Interface(fn=classify_potato_plant,inputs=gr.Image(type="pil"),outputs=[gr.Label(num_top_classes=1), gr.Textbox(label="Confidence Score")])# Launch the app20 unmodified lines21222324252627282930313233343536373839404142434420 unmodified linespredictions = model.predict(img)predicted_class = np.argmax(predictions[0])confidence = predictions[0][predicted_class]model_output = "None"if class_labels[predicted_class] == "Potato__Early_blight":model_output = "Early blight"elif class_labels[predicted_class] == "Potato__Late_blight":model_output = "Late blight"elif class_labels[predicted_class] == "Potate__healthy":model_output = "Healthy"return model_output, confidence# Create the Gradio interfaceinterface = gr.Interface(fn=classify_potato_plant,inputs=gr.Image(type="pil"),outputs=[gr.Label(num_top_classes=1), gr.Textbox(label="Confidence Score")],title="Acres - PPDC",description="Acres PPDC, is our Potato Plant Disease Classification vision model, capable of accurately classifying potato plant disease, based on a single image.")# Launch the app
app.py+12-3