freealise commited on
Commit
1218d88
1 Parent(s): eceb7b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -167,7 +167,7 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
167
  # frame_path = os.path.join(temp_frame_dir, f"frame_{count:05d}.png")
168
  # cv2.imwrite(frame_path, combined_frame)
169
 
170
- cv2.imwrite(f"f{count}.jpg", blur_frame)
171
  orig_frames.append(f"f{count}.jpg")
172
  cv2.imwrite(f"f{count}_dmap.jpg", depth_color)
173
  depth_frames.append(f"f{count}_dmap.jpg")
@@ -357,7 +357,11 @@ with gr.Blocks(css=css) as demo:
357
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.samples = 4;
358
  BABYLON.Engine.LastCreatedScene.activeCamera.fov = this.value;
359
  this.parentNode.childNodes[2].innerText = BABYLON.Engine.LastCreatedScene.activeCamera.fov;
360
- document.getElementsByClassName(\"model3D\")[0].getElementsByTagName(\"canvas\")[0].style.filter = \"blur(\" + BABYLON.Engine.LastCreatedScene.getNodes()[1].material.pointSize/Math.sqrt(2.0) + \"px)\";
 
 
 
 
361
  '/><span>0.8</span>""")
362
  camera = gr.HTML(value="<a href='#' onclick=\"BABYLON.Engine.LastCreatedScene.activeCamera.radius=0;\">reset camera</a>")
363
  contrast = gr.HTML(value="""<label for='contrast'>Contrast</label><input id='contrast' type='range' style='width:256px;height:1em;' min='0' max='2' step='0.001' oninput='
 
167
  # frame_path = os.path.join(temp_frame_dir, f"frame_{count:05d}.png")
168
  # cv2.imwrite(frame_path, combined_frame)
169
 
170
+ cv2.imwrite(f"f{count}.jpg", raw_frame)
171
  orig_frames.append(f"f{count}.jpg")
172
  cv2.imwrite(f"f{count}_dmap.jpg", depth_color)
173
  depth_frames.append(f"f{count}_dmap.jpg")
 
357
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.samples = 4;
358
  BABYLON.Engine.LastCreatedScene.activeCamera.fov = this.value;
359
  this.parentNode.childNodes[2].innerText = BABYLON.Engine.LastCreatedScene.activeCamera.fov;
360
+
361
+ var hb = new BABYLON.BlurPostProcess("Horizontal blur", new BABYLON.Vector2(1.0, 0), 3.0, 1.0, BABYLON.Engine.LastCreatedScene.activeCamera);
362
+ var vb = new BABYLON.BlurPostProcess("Vertical blur", new BABYLON.Vector2(0, 1.0), 3.0, 1.0, BABYLON.Engine.LastCreatedScene.activeCamera);
363
+
364
+ //document.getElementsByClassName(\"model3D\")[0].getElementsByTagName(\"canvas\")[0].style.filter = \"blur(\" + BABYLON.Engine.LastCreatedScene.getNodes()[1].material.pointSize/Math.sqrt(2.0) + \"px)\";
365
  '/><span>0.8</span>""")
366
  camera = gr.HTML(value="<a href='#' onclick=\"BABYLON.Engine.LastCreatedScene.activeCamera.radius=0;\">reset camera</a>")
367
  contrast = gr.HTML(value="""<label for='contrast'>Contrast</label><input id='contrast' type='range' style='width:256px;height:1em;' min='0' max='2' step='0.001' oninput='