akhaliq HF staff commited on
Commit
cd8868f
β€’
1 Parent(s): e91aa8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -56,10 +56,11 @@ def inference(img):
56
  ax.text(x, y, "{} {:.0f}%".format(classes_to_labels[classes[idx] - 1], confidences[idx]*100), bbox=dict(facecolor='white', alpha=0.5))
57
  plt.axis('off')
58
  plt.draw()
59
- return plt
 
60
 
61
  inputs = gr.inputs.Image(type='file', label="Original Image")
62
- outputs = gr.outputs.Image(type="plot", label="Output Image")
63
 
64
  title = "Single Shot MultiBox Detector model for object detection"
65
  description = "Gradio demo for Single Shot MultiBox Detector model for object detection by Nvidia. To use it upload an image or click an example images images. Read more at the links below"
 
56
  ax.text(x, y, "{} {:.0f}%".format(classes_to_labels[classes[idx] - 1], confidences[idx]*100), bbox=dict(facecolor='white', alpha=0.5))
57
  plt.axis('off')
58
  plt.draw()
59
+ plt.savefig("test.png",bbox_inches='tight')
60
+ return "test.png"
61
 
62
  inputs = gr.inputs.Image(type='file', label="Original Image")
63
+ outputs = gr.outputs.Image(type="file", label="Output Image")
64
 
65
  title = "Single Shot MultiBox Detector model for object detection"
66
  description = "Gradio demo for Single Shot MultiBox Detector model for object detection by Nvidia. To use it upload an image or click an example images images. Read more at the links below"