Spaces:
Runtime error
Runtime error
yrodriguezmd
commited on
Commit
•
2f47c68
1
Parent(s):
f4a121f
Update app.py
Browse files
app.py
CHANGED
@@ -38,6 +38,14 @@ img_size = checkpoint_and_model["img_size"]
|
|
38 |
valid_tfms = tfms.A.Adapter(
|
39 |
[*tfms.A.resize_and_pad(img_size), tfms.A.Normalize()])
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
def show_preds_gradio(input_image, display_label, display_bbox, detection_threshold):
|
42 |
|
43 |
if detection_threshold == 0:
|
@@ -61,7 +69,8 @@ detection_threshold_slider = gr.inputs.Slider(
|
|
61 |
outputs = gr.outputs.Image(type="pil")
|
62 |
|
63 |
gr_interface = gr.Interface(fn=show_preds_gradio, inputs=["image", display_chkbox_label, display_chkbox_box, detection_threshold_slider],
|
64 |
-
outputs=outputs, title='Surgical Instrument Detection and Identification Tool'
|
|
|
65 |
|
66 |
|
67 |
gr_interface.launch(inline=False, share=True, debug=True)
|
|
|
38 |
valid_tfms = tfms.A.Adapter(
|
39 |
[*tfms.A.resize_and_pad(img_size), tfms.A.Normalize()])
|
40 |
|
41 |
+
# examples
|
42 |
+
for root, dirs, files in os.walk(r'sample_images/'):
|
43 |
+
for filename in files:
|
44 |
+
print(filename)
|
45 |
+
|
46 |
+
examples = ["sample_images/"+file for file in files]
|
47 |
+
|
48 |
+
|
49 |
def show_preds_gradio(input_image, display_label, display_bbox, detection_threshold):
|
50 |
|
51 |
if detection_threshold == 0:
|
|
|
69 |
outputs = gr.outputs.Image(type="pil")
|
70 |
|
71 |
gr_interface = gr.Interface(fn=show_preds_gradio, inputs=["image", display_chkbox_label, display_chkbox_box, detection_threshold_slider],
|
72 |
+
outputs=outputs, title='Surgical Instrument Detection and Identification Tool', # , article=article,
|
73 |
+
examples=examples) ##
|
74 |
|
75 |
|
76 |
gr_interface.launch(inline=False, share=True, debug=True)
|