Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| # Load the pre-trained model from Hugging Face | |
| model = gr.load("models/dima806/indian_food_image_detection") | |
| # Create a function to classify images using the loaded model | |
| def classify_image(image): | |
| return model(image) | |
| # Create a Gradio interface with a custom title | |
| iface = gr.Interface( | |
| fn=classify_image, | |
| inputs=gr.Image(type="numpy", label="Upload an image"), | |
| outputs=gr.Label(label="Prediction"), | |
| title="CAPSTONE", | |
| description="Upload an image of Indian food to detect what it is." | |
| ) | |
| # Launch the Gradio interface | |
| iface.launch() | |