Ahmed235 commited on
Commit
bf44b60
1 Parent(s): 45c90b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -32,10 +32,13 @@ def predict_image(image):
32
  return {"prediction": predict_label, "confidence": float(np.max(predictions))}
33
 
34
  # Create the interface
35
- input_interface = gr.Image(shape=(256, 256), image_mode='RGB')
36
- output_interface = gr.outputs.Label(num_top_classes=2)
37
 
38
- iface = gr.Interface(fn=predict_image, inputs=input_interface, outputs=output_interface)
 
 
 
39
 
40
  # Launch the interface
41
- iface.launch()
 
32
  return {"prediction": predict_label, "confidence": float(np.max(predictions))}
33
 
34
  # Create the interface
35
+ input_interface = gr.Image(type ='pil')
36
+ output_interface = "json"
37
 
38
+ iface = gr.Interface(
39
+ fn=predict_image,
40
+ inputs=input_interface,
41
+ outputs=output_interface)
42
 
43
  # Launch the interface
44
+ iface.launch(share=True)