freealise commited on
Commit
c400da7
1 Parent(s): f33c1cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -21,6 +21,7 @@ from depth_anything.util.transform import Resize, NormalizeImage, PrepareForNet
21
  from moviepy.editor import *
22
 
23
  frame_selected = 0
 
24
  locations = []
25
  mesh = []
26
 
@@ -303,11 +304,17 @@ def loadurl(url):
303
 
304
  def select_frame(v, f, evt: gr.SelectData):
305
  global frame_selected
 
 
306
  if evt.index != frame_selected:
307
  frame_selected = evt.index
 
 
 
 
 
308
  #print(v)
309
- print(f[frame_selected][0])
310
- return gr.Gallery(selected_index=evt.index, preview=True), f[frame_selected][0], frame_selected
311
 
312
 
313
  css = """
 
21
  from moviepy.editor import *
22
 
23
  frame_selected = 0
24
+ masks = []
25
  locations = []
26
  mesh = []
27
 
 
304
 
305
  def select_frame(v, f, evt: gr.SelectData):
306
  global frame_selected
307
+ masks[frame_selected] = v
308
+
309
  if evt.index != frame_selected:
310
  frame_selected = evt.index
311
+
312
+ if masks[frame_selected]:
313
+ v = masks[frame_selected]
314
+ else:
315
+ v = f[frame_selected][0]
316
  #print(v)
317
+ return gr.Gallery(selected_index=evt.index, preview=True), v, frame_selected
 
318
 
319
 
320
  css = """