Spaces:
Runtime error
Runtime error
eeshawn
commited on
Commit
•
35b7b7a
1
Parent(s):
03320ec
update app.py
Browse files
app.py
CHANGED
@@ -59,8 +59,10 @@ with gr.Blocks() as demo:
|
|
59 |
)
|
60 |
with gr.Row():
|
61 |
with gr.Column():
|
62 |
-
|
63 |
-
|
|
|
|
|
64 |
with gr.Row():
|
65 |
clear_form = gr.Button("Reset")
|
66 |
submit = gr.Button("Predict")
|
@@ -75,11 +77,11 @@ with gr.Blocks() as demo:
|
|
75 |
"""
|
76 |
)
|
77 |
|
78 |
-
callback.setup([
|
79 |
|
80 |
-
|
81 |
-
submit.click(fn=seal_detection, inputs=[
|
82 |
-
flag.click(lambda *args: callback.flag(args), [
|
83 |
|
84 |
if __name__ == "__main__":
|
85 |
demo.queue(api_open=False, max_size=10)
|
|
|
59 |
)
|
60 |
with gr.Row():
|
61 |
with gr.Column():
|
62 |
+
inputs = [
|
63 |
+
gr.Image(source="upload", type="pil", label="Image Upload", interactive=True),
|
64 |
+
gr.Slider(minimum=0.05, maximum=1.0, value=0.5, step=0.05, label="Confidence Threshold"),
|
65 |
+
]
|
66 |
with gr.Row():
|
67 |
clear_form = gr.Button("Reset")
|
68 |
submit = gr.Button("Predict")
|
|
|
77 |
"""
|
78 |
)
|
79 |
|
80 |
+
callback.setup([inputs, outputs], "flagged_data")
|
81 |
|
82 |
+
clear_form.click(fn=clear, inputs=None, outputs=[inputs], show_progress=False)
|
83 |
+
submit.click(fn=seal_detection, inputs=[inputs], outputs=outputs)
|
84 |
+
flag.click(lambda *args: callback.flag(args), [inputs, outputs], None, preprocess=False, show_progress=False)
|
85 |
|
86 |
if __name__ == "__main__":
|
87 |
demo.queue(api_open=False, max_size=10)
|