Update app.py
Browse files
app.py
CHANGED
|
@@ -13,13 +13,13 @@ This app allows you to upload a fish image, and it will classify the fish into o
|
|
| 13 |
Upload an image below to get predictions.
|
| 14 |
""")
|
| 15 |
|
| 16 |
-
# Gradio Interface
|
| 17 |
def gradio_interface():
|
| 18 |
# This will load the models and use Gradio's interface to interact
|
| 19 |
gradio_interface = gr.Interface(
|
| 20 |
fn=predict_image, # Function that performs inference
|
| 21 |
-
inputs=gr.
|
| 22 |
-
outputs=gr.
|
| 23 |
live=True,
|
| 24 |
title="Fish Image Classification",
|
| 25 |
description="Classify fish images using AI models (ResNet18, MobileNetV2).",
|
|
@@ -27,5 +27,5 @@ def gradio_interface():
|
|
| 27 |
|
| 28 |
return gradio_interface
|
| 29 |
|
| 30 |
-
# Add the Gradio Interface
|
| 31 |
gradio_interface().launch(inline=True)
|
|
|
|
| 13 |
Upload an image below to get predictions.
|
| 14 |
""")
|
| 15 |
|
| 16 |
+
# Gradio Interface for prediction
|
| 17 |
def gradio_interface():
|
| 18 |
# This will load the models and use Gradio's interface to interact
|
| 19 |
gradio_interface = gr.Interface(
|
| 20 |
fn=predict_image, # Function that performs inference
|
| 21 |
+
inputs=gr.Image(type="pil"), # Image input (gr.Image in Gradio v3.x)
|
| 22 |
+
outputs=gr.JSON(), # Output format (JSON with predictions)
|
| 23 |
live=True,
|
| 24 |
title="Fish Image Classification",
|
| 25 |
description="Classify fish images using AI models (ResNet18, MobileNetV2).",
|
|
|
|
| 27 |
|
| 28 |
return gradio_interface
|
| 29 |
|
| 30 |
+
# Add the Gradio Interface inside the Streamlit app
|
| 31 |
gradio_interface().launch(inline=True)
|