change video clear function returns
Browse files
app.py
CHANGED
@@ -234,12 +234,8 @@ def getStartEndPoints(mask):
|
|
234 |
|
235 |
return x1, y1, x2, y2
|
236 |
|
237 |
-
def reset_frame_components(
|
238 |
-
|
239 |
-
original_image = gr.Image(interactive=False)
|
240 |
-
masked_image = gr.Image(interactive=False)
|
241 |
-
|
242 |
-
return first_frame, original_image, masked_image
|
243 |
|
244 |
|
245 |
with gr.Blocks() as demo:
|
@@ -269,7 +265,7 @@ with gr.Blocks() as demo:
|
|
269 |
|
270 |
in_video.change(fn=get_first_frame, inputs=[
|
271 |
in_video], outputs=[first_frame])
|
272 |
-
in_video.clear(fn=reset_frame_components,
|
273 |
approve_mask.click(lambda x: [x['image'], x['mask']], first_frame, [
|
274 |
original_image, masked_image])
|
275 |
track_mask.click(fn=track_and_mask, inputs=[
|
|
|
234 |
|
235 |
return x1, y1, x2, y2
|
236 |
|
237 |
+
def reset_frame_components():
|
238 |
+
return None,None,None
|
|
|
|
|
|
|
|
|
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_frame_components, outputs=[first_frame, original_image, masked_image])
|
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=[
|