vykanand commited on
Commit
e5e2e79
Β·
verified Β·
1 Parent(s): 5dda5d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -37,7 +37,14 @@ def predict_image(image):
37
  return label
38
 
39
  # Gradio interface
40
- with gr.Interface(fn=predict_image,
41
- inputs=gr.inputs.Image(type="bytes"),
42
- outputs=gr.outputs.Textbox()) as demo:
43
- demo.launch(debug=True)
 
 
 
 
 
 
 
 
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)