freealise commited on
Commit
bfb2083
1 Parent(s): 777862c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -319,6 +319,10 @@ def select_frame(v, evt: gr.SelectData):
319
  #print(v)
320
  return v, frame_selected
321
 
 
 
 
 
322
 
323
  css = """
324
  #img-display-container {
@@ -365,7 +369,8 @@ with gr.Blocks(css=css) as demo:
365
  input_url = gr.Textbox(value="./examples/streetview.mp4", label="URL")
366
  input_video = gr.Video(label="Input Video", format="mp4")
367
  input_url.change(fn=loadurl, inputs=[input_url], outputs=[input_video])
368
- output_frame = gr.Gallery(label="Frames", type='numpy', preview=True, rows=2, columns=6)
 
369
  output_mask = gr.ImageEditor(interactive=True, transforms=(None,), eraser=gr.Eraser(), brush=gr.Brush(colors=['black', 'darkgray', 'gray', 'lightgray', 'white']), layers=True)
370
  submit = gr.Button("Submit")
371
  with gr.Column():
@@ -537,7 +542,7 @@ with gr.Blocks(css=css) as demo:
537
  break;
538
  case \"i\":
539
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.y *= 256/255;
540
- this.value = \"i ↕ ,\";
541
  break;
542
  case \",\":
543
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.y /= 256/255;
 
319
  #print(v)
320
  return v, frame_selected
321
 
322
+ def align_rows(evt: gr.EventData):
323
+ global masks
324
+ return gr.Gallery(columns=int(len(masks)))
325
+
326
 
327
  css = """
328
  #img-display-container {
 
369
  input_url = gr.Textbox(value="./examples/streetview.mp4", label="URL")
370
  input_video = gr.Video(label="Input Video", format="mp4")
371
  input_url.change(fn=loadurl, inputs=[input_url], outputs=[input_video])
372
+ output_frame = gr.Gallery(label="Frames", type='numpy', preview=True, columns=6)
373
+ output_frame.change(fn=align_rows, inputs=None, outputs=[output_frame])
374
  output_mask = gr.ImageEditor(interactive=True, transforms=(None,), eraser=gr.Eraser(), brush=gr.Brush(colors=['black', 'darkgray', 'gray', 'lightgray', 'white']), layers=True)
375
  submit = gr.Button("Submit")
376
  with gr.Column():
 
542
  break;
543
  case \"i\":
544
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.y *= 256/255;
545
+ this.value = \"i ↕ ,\";
546
  break;
547
  case \",\":
548
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.y /= 256/255;