reset function changed for all state components
Browse files
app.py
CHANGED
@@ -234,8 +234,8 @@ def getStartEndPoints(mask):
|
|
234 |
|
235 |
return x1, y1, x2, y2
|
236 |
|
237 |
-
def
|
238 |
-
return None,None,None
|
239 |
|
240 |
|
241 |
with gr.Blocks() as demo:
|
@@ -265,7 +265,7 @@ with gr.Blocks() as demo:
|
|
265 |
|
266 |
in_video.change(fn=get_first_frame, inputs=[
|
267 |
in_video], outputs=[first_frame])
|
268 |
-
in_video.clear(fn=
|
269 |
approve_mask.click(lambda x: [x['image'], x['mask']], first_frame, [
|
270 |
original_image, masked_image])
|
271 |
track_mask.click(fn=track_and_mask, inputs=[
|
|
|
234 |
|
235 |
return x1, y1, x2, y2
|
236 |
|
237 |
+
def reset_components():
|
238 |
+
return None,None,None, [],[],24,datetime.now().strftime("%d_%m_%Y_%H_%M_%S")
|
239 |
|
240 |
|
241 |
with gr.Blocks() as demo:
|
|
|
265 |
|
266 |
in_video.change(fn=get_first_frame, inputs=[
|
267 |
in_video], outputs=[first_frame])
|
268 |
+
in_video.clear(fn=reset_components, outputs=[first_frame, original_image, masked_image, original_frame_list, mask_list, in_fps, dt_string])
|
269 |
approve_mask.click(lambda x: [x['image'], x['mask']], first_frame, [
|
270 |
original_image, masked_image])
|
271 |
track_mask.click(fn=track_and_mask, inputs=[
|