imanhamid commited on
Commit
fb8e149
·
1 Parent(s): 54e731d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -30,8 +30,9 @@ def show_preds(input_image):
30
  # print(pred)
31
  img = draw_pred(img=img, pred=pred, class_map=class_map, display_label=False, display_bbox=True)
32
  img = PIL.Image.fromarray(img)
 
33
  # print("Output Image: ", img.size, type(img))
34
- return img
35
 
36
  # Populate examples in Gradio interface
37
  examples = [
@@ -43,7 +44,7 @@ examples = [
43
  gr_interface = gr.Interface(
44
  fn=show_preds,
45
  inputs=["image"],
46
- outputs=gr.Image(type="pil"),
47
  title='Selection Scan - Object Detection',
48
  examples=examples)
49
 
 
30
  # print(pred)
31
  img = draw_pred(img=img, pred=pred, class_map=class_map, display_label=False, display_bbox=True)
32
  img = PIL.Image.fromarray(img)
33
+ pred_bbox = pred['bboxes']
34
  # print("Output Image: ", img.size, type(img))
35
+ return img, pred_bbox
36
 
37
  # Populate examples in Gradio interface
38
  examples = [
 
44
  gr_interface = gr.Interface(
45
  fn=show_preds,
46
  inputs=["image"],
47
+ outputs=[gr.Image(type="pil"), gr.Textbox(label="Predicted BBox:")]
48
  title='Selection Scan - Object Detection',
49
  examples=examples)
50