freealise commited on
Commit
f1de1eb
·
verified ·
1 Parent(s): 1615ef1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -15
app.py CHANGED
@@ -459,6 +459,7 @@ async()=>{
459
  var intv = setInterval(function(){
460
  if (document.getElementById("output_video").getElementsByTagName("video")) {
461
  document.getElementById("model3d").src = document.getElementById("model3d").src.split("?")[0] + "?url=" + document.getElementById("output_video").getElementsByTagName("video")[0].src;
 
462
  clearInterval(intv);
463
  }
464
  }, 40);
@@ -589,19 +590,6 @@ if (document.getElementById("image_edit") && document.getElementById("image_edit
589
  }
590
  }, 40);
591
 
592
- function fullscreen() {
593
- if (document.getElementById("model3d").style.position != 'fixed') {
594
- document.getElementById("model3d").style.position = 'fixed';
595
- document.getElementById("model3d").style.width = window.innerWidth + 'px';
596
- document.getElementById("model3d").style.height = window.innerHeight + 'px';
597
- } else {
598
- document.getElementById("model3d").style.position = 'relative';
599
- document.getElementById("model3d").style.width = '100%';
600
- document.getElementById("model3d").style.height = '320px';
601
- }
602
- }
603
- window.fullscreen = fullscreen;
604
-
605
  }
606
  """
607
 
@@ -749,8 +737,8 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
749
  ]"""
750
  coords = gr.Textbox(elem_id="coords", value=example_coords, label="Coordinates", interactive=False)
751
  render = gr.Button("Render")
752
- model3d = gr.HTML(value="""
753
- <iframe id='model3d' src='https://freeali.se/freealise/transparent_video/' onload='this.contentDocument.body.onclick=fullscreen();' style='position:relative;width:100%;height:320px;'></iframe>
754
  """)
755
  input_json.input(show_json, inputs=[input_json], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, coords])
756
 
 
459
  var intv = setInterval(function(){
460
  if (document.getElementById("output_video").getElementsByTagName("video")) {
461
  document.getElementById("model3d").src = document.getElementById("model3d").src.split("?")[0] + "?url=" + document.getElementById("output_video").getElementsByTagName("video")[0].src;
462
+ document.getElementById("newtab").href = document.getElementById("model3d").src;
463
  clearInterval(intv);
464
  }
465
  }, 40);
 
590
  }
591
  }, 40);
592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  }
594
  """
595
 
 
737
  ]"""
738
  coords = gr.Textbox(elem_id="coords", value=example_coords, label="Coordinates", interactive=False)
739
  render = gr.Button("Render")
740
+ model3d = gr.HTML(value="""<a id='newtab' href='#' target='_blank'>Open in new tab</a><br/>
741
+ <iframe id='model3d' src='https://freeali.se/freealise/transparent_video/' width='100%' height='320'></iframe>
742
  """)
743
  input_json.input(show_json, inputs=[input_json], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, coords])
744