freealise commited on
Commit
a52b01a
1 Parent(s): e3943a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -145,9 +145,7 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
145
  # change image to black where we found white
146
  depth_color[mask>0] = (0,0,0)
147
 
148
- rgba_frame = cv2.cvtColor(raw_frame, cv2.COLOR_RGB2RGBA)
149
- cv2.mixChannels([depth_color], [rgba_frame], [0,3])
150
- blur_frame = rgba_frame.copy()
151
  i = 240
152
  l = 0
153
  j = 1
@@ -157,7 +155,7 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
157
  blur_mask = cv2.inRange(depth_color, blur_lo, blur_hi)
158
 
159
  print(f'kernel size {j}')
160
- blur = cv2.GaussianBlur(rgba_frame, (j, j), 0)
161
 
162
  blur_frame[blur_mask>0] = blur[blur_mask>0]
163
  i = i - 16
@@ -355,6 +353,9 @@ with gr.Blocks(css=css) as demo:
355
  result = gr.Model3D(label="3D Mesh", clear_color=[0.5, 0.5, 0.5, 0.0], camera_position=[0, 90, 0])
356
  html = gr.HTML(value="""<label for='zoom'>Zoom</label><input id='zoom' type='range' style='width:256px;height:1em;' min='0.157' max='1.57' step='0.001' oninput='
357
  BABYLON.Engine.LastCreatedScene.getNodes()[1].material.pointSize = Math.ceil(Math.log2(Math.PI/this.value));
 
 
 
358
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
359
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata = {
360
  screenshot: true,
 
145
  # change image to black where we found white
146
  depth_color[mask>0] = (0,0,0)
147
 
148
+ blur_frame = raw_frame.copy()
 
 
149
  i = 240
150
  l = 0
151
  j = 1
 
155
  blur_mask = cv2.inRange(depth_color, blur_lo, blur_hi)
156
 
157
  print(f'kernel size {j}')
158
+ blur = cv2.GaussianBlur(raw_frame, (j, j), 0)
159
 
160
  blur_frame[blur_mask>0] = blur[blur_mask>0]
161
  i = i - 16
 
353
  result = gr.Model3D(label="3D Mesh", clear_color=[0.5, 0.5, 0.5, 0.0], camera_position=[0, 90, 0])
354
  html = gr.HTML(value="""<label for='zoom'>Zoom</label><input id='zoom' type='range' style='width:256px;height:1em;' min='0.157' max='1.57' step='0.001' oninput='
355
  BABYLON.Engine.LastCreatedScene.getNodes()[1].material.pointSize = Math.ceil(Math.log2(Math.PI/this.value));
356
+ BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.contrast = 2.0;
357
+ BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = 0.5;
358
+
359
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
360
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata = {
361
  screenshot: true,