freealise commited on
Commit
d1fd699
1 Parent(s): 12e0d9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -346,9 +346,6 @@ css = """
346
  #img-display-output {
347
  max-height: 80vh;
348
  }
349
- * {
350
- user-select:none;
351
- }
352
  """
353
 
354
  title = "# Depth Anything Video Demo"
@@ -635,7 +632,9 @@ with gr.Blocks(css=css) as demo:
635
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = document.getElementById(\"exposure\").value;
636
 
637
  document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].style.filter = \"blur(\" + BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].material.pointSize/2.0*Math.sqrt(2.0) + \"px)\";
638
- try {
 
 
639
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata.gizmoManager) {
640
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.gizmoManager = new BABYLON.GizmoManager(BABYLON.Engine.LastCreatedScene, 16);
641
 
@@ -662,7 +661,7 @@ try {
662
  }
663
  }
664
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.gizmoManager.attachToMesh(BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1]);
665
- } catch(e) {alert(e)}
666
  '>reset camera</a>""")
667
  contrast = gr.HTML(value="""<label for='contrast'>Contrast</label><input id='contrast' type='range' style='width:256px;height:1em;' value='2.0' min='0' max='2' step='0.001' oninput='
668
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
 
346
  #img-display-output {
347
  max-height: 80vh;
348
  }
 
 
 
349
  """
350
 
351
  title = "# Depth Anything Video Demo"
 
632
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = document.getElementById(\"exposure\").value;
633
 
634
  document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].style.filter = \"blur(\" + BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].material.pointSize/2.0*Math.sqrt(2.0) + \"px)\";
635
+ document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].oncontextmenu = function(e){e.preventDefault();}
636
+ document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].ondrag = function(e){e.preventDefault();}
637
+
638
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata.gizmoManager) {
639
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.gizmoManager = new BABYLON.GizmoManager(BABYLON.Engine.LastCreatedScene, 16);
640
 
 
661
  }
662
  }
663
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.gizmoManager.attachToMesh(BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1]);
664
+
665
  '>reset camera</a>""")
666
  contrast = gr.HTML(value="""<label for='contrast'>Contrast</label><input id='contrast' type='range' style='width:256px;height:1em;' value='2.0' min='0' max='2' step='0.001' oninput='
667
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {