Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,14 @@ def predict_image(image):
|
|
| 37 |
return label
|
| 38 |
|
| 39 |
# Gradio interface
|
| 40 |
-
with gr.
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
return label
|
| 38 |
|
| 39 |
# Gradio interface
|
| 40 |
+
with gr.Blocks() as demo:
|
| 41 |
+
gr.Markdown("### Image Classification with MobileNetV2")
|
| 42 |
+
|
| 43 |
+
with gr.Row():
|
| 44 |
+
image_input = gr.Image(type="bytes", label="Upload Image")
|
| 45 |
+
result_output = gr.Textbox(label="Predicted Label")
|
| 46 |
+
|
| 47 |
+
# Endpoint for inference
|
| 48 |
+
gr.Interface(fn=predict_image, inputs=image_input, outputs=result_output, api_name="/predict_image")
|
| 49 |
+
|
| 50 |
+
demo.launch(debug=True)
|