Spaces:
Sleeping
Sleeping
try to clear selection after clearing input image
Browse files
app.py
CHANGED
@@ -683,7 +683,19 @@ with gr.Blocks(css=css) as demo:
|
|
683 |
radio = gr.Radio(label='', choices=choices, value="None", container=False, min_width=50, elem_classes="radio")
|
684 |
radio.change(lambda selection, cat=category: update_selections(cat, selection), inputs=[radio], outputs=[])
|
685 |
|
686 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
687 |
|
688 |
demo.launch()
|
689 |
|
|
|
683 |
radio = gr.Radio(label='', choices=choices, value="None", container=False, min_width=50, elem_classes="radio")
|
684 |
radio.change(lambda selection, cat=category: update_selections(cat, selection), inputs=[radio], outputs=[])
|
685 |
|
686 |
+
# function to clear all inputs and restart
|
687 |
+
def clear_all():
|
688 |
+
for i in range(MAX_EXPECTED_FACES):
|
689 |
+
face_images[i].value = None
|
690 |
+
face_checkboxes[i].value = False
|
691 |
+
output_image.value = None
|
692 |
+
for category in STICKER_TO_CATEGORY.values():
|
693 |
+
sticker_selections[category] = None
|
694 |
+
# radio.value = "None"
|
695 |
+
print(sticker_selections)
|
696 |
+
|
697 |
+
|
698 |
+
image_input.clear(fn=clear_all)
|
699 |
|
700 |
demo.launch()
|
701 |
|