Spaces:
Runtime error
Runtime error
add examples
Browse files
app.py
CHANGED
@@ -49,7 +49,9 @@ examples = ["sample_images/"+file for file in files]
|
|
49 |
article="<p style='text-align: center'><a href='https://dicksonneoh.com/fridge-detector/' target='_blank'>Blog post</a></p>"
|
50 |
enable_queue=True
|
51 |
|
52 |
-
|
|
|
|
|
53 |
|
54 |
def show_preds(input_image, display_label, display_bbox, detection_threshold):
|
55 |
|
@@ -72,7 +74,7 @@ detection_threshold_slider = gr.inputs.Slider(minimum=0, maximum=1, step=0.1, de
|
|
72 |
outputs = gr.outputs.Image(type="pil")
|
73 |
|
74 |
# Option 1: Get an image from local drive
|
75 |
-
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)
|
76 |
|
77 |
# # Option 2: Grab an image from a webcam
|
78 |
# 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)
|
|
|
49 |
article="<p style='text-align: center'><a href='https://dicksonneoh.com/fridge-detector/' target='_blank'>Blog post</a></p>"
|
50 |
enable_queue=True
|
51 |
|
52 |
+
|
53 |
+
#examples = [['sample_images/3.jpg']]
|
54 |
+
examples = [["sample_images/"+file] for file in files]
|
55 |
|
56 |
def show_preds(input_image, display_label, display_bbox, detection_threshold):
|
57 |
|
|
|
74 |
outputs = gr.outputs.Image(type="pil")
|
75 |
|
76 |
# Option 1: Get an image from local drive
|
77 |
+
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)
|
78 |
|
79 |
# # Option 2: Grab an image from a webcam
|
80 |
# 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)
|