Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -53,8 +53,8 @@ enable_queue=True
|
|
53 |
examples = [['sample_images/3.jpg'],['sample_images/15.jpg'],['sample_images/9.jpg']]
|
54 |
#examples = [["sample_images/"+file] for file in files]
|
55 |
|
56 |
-
def show_preds(input_image, display_label, display_bbox, detection_threshold):
|
57 |
-
|
58 |
if detection_threshold==0: detection_threshold=0.5
|
59 |
|
60 |
img = PIL.Image.fromarray(input_image, 'RGB')
|
@@ -78,7 +78,9 @@ detection_threshold_slider = gr.inputs.Slider(minimum=0, maximum=1, step=0.1, de
|
|
78 |
outputs = gr.outputs.Image(type="pil")
|
79 |
|
80 |
# Option 1: Get an image from local drive
|
81 |
-
gr_interface = gr.Interface(fn=show_preds, inputs=["image", display_chkbox_label, display_chkbox_box, detection_threshold_slider], outputs=outputs, title='IceApp - Fridge Object', article=article, examples=examples)
|
|
|
|
|
82 |
|
83 |
# # Option 2: Grab an image from a webcam
|
84 |
# gr_interface = gr.Interface(fn=show_preds, inputs=["webcam", display_chkbox_label, display_chkbox_box, detection_threshold_slider], outputs=outputs, title='IceApp - COCO', live=False)
|
|
|
53 |
examples = [['sample_images/3.jpg'],['sample_images/15.jpg'],['sample_images/9.jpg']]
|
54 |
#examples = [["sample_images/"+file] for file in files]
|
55 |
|
56 |
+
#def show_preds(input_image, display_label, display_bbox, detection_threshold):
|
57 |
+
def show_preds(input_image):
|
58 |
if detection_threshold==0: detection_threshold=0.5
|
59 |
|
60 |
img = PIL.Image.fromarray(input_image, 'RGB')
|
|
|
78 |
outputs = gr.outputs.Image(type="pil")
|
79 |
|
80 |
# Option 1: Get an image from local drive
|
81 |
+
#gr_interface = gr.Interface(fn=show_preds, inputs=["image", display_chkbox_label, display_chkbox_box, detection_threshold_slider], outputs=outputs, title='IceApp - Fridge Object', article=article, examples=examples)
|
82 |
+
# Option 1: Get an image from local drive
|
83 |
+
gr_interface = gr.Interface(fn=show_preds, inputs=["image"], outputs=outputs, title='IceApp - Fridge Object', article=article, examples=examples)
|
84 |
|
85 |
# # Option 2: Grab an image from a webcam
|
86 |
# gr_interface = gr.Interface(fn=show_preds, inputs=["webcam", display_chkbox_label, display_chkbox_box, detection_threshold_slider], outputs=outputs, title='IceApp - COCO', live=False)
|