Spaces:
Runtime error
Runtime error
eeshawn
commited on
Commit
·
f0e2a22
1
Parent(s):
f2f0c96
update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def clear():
|
|
35 |
conf_update = gr.Slider.update(value=0.5)
|
36 |
return image_update, conf_update, image_update
|
37 |
|
38 |
-
callback = gr.
|
39 |
|
40 |
with gr.Blocks() as demo:
|
41 |
gr.Markdown("# Naruto Hand Seal Detection with YOLOv8")
|
@@ -77,11 +77,11 @@ with gr.Blocks() as demo:
|
|
77 |
"""
|
78 |
)
|
79 |
|
80 |
-
callback.setup([image, slider, outputs], "
|
81 |
|
82 |
clear_form.click(fn=clear, inputs=None, outputs=[image[0], slider[0], outputs], show_progress=False)
|
83 |
submit.click(fn=seal_detection, inputs=[image[0], slider[0]], outputs=outputs)
|
84 |
-
flag.click(lambda *args: callback.flag(
|
85 |
|
86 |
if __name__ == "__main__":
|
87 |
demo.queue(api_open=False, max_size=10)
|
|
|
35 |
conf_update = gr.Slider.update(value=0.5)
|
36 |
return image_update, conf_update, image_update
|
37 |
|
38 |
+
callback = gr.HuggingFaceDatasetJSONSaver(hf_token=HF_TOKEN, dataset_name="crowdsourced_hand_seals", private=True)
|
39 |
|
40 |
with gr.Blocks() as demo:
|
41 |
gr.Markdown("# Naruto Hand Seal Detection with YOLOv8")
|
|
|
77 |
"""
|
78 |
)
|
79 |
|
80 |
+
callback.setup([image, slider, outputs], "crowdsourced_hand_seals")
|
81 |
|
82 |
clear_form.click(fn=clear, inputs=None, outputs=[image[0], slider[0], outputs], show_progress=False)
|
83 |
submit.click(fn=seal_detection, inputs=[image[0], slider[0]], outputs=outputs)
|
84 |
+
flag.click(lambda *args: callback.flag([image[0], slider[0], outputs]), inputs=[image[0], slider[0], outputs], outputs=None, preprocess=False)
|
85 |
|
86 |
if __name__ == "__main__":
|
87 |
demo.queue(api_open=False, max_size=10)
|