freealise commited on
Commit
016503f
1 Parent(s): 157a937

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -119,9 +119,8 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
119
  if not ret:
120
  break
121
 
122
- rgb_frame = cv2.cvtColor(raw_frame, cv2.COLOR_BGR2RGB)
123
- frame_pil = Image.fromarray(rgb_frame.astype(np.uint8))
124
- frame = rgb_frame / 255.0
125
  frame = transform({'image': frame})['image']
126
 
127
  frame = torch.from_numpy(frame).unsqueeze(0).to(DEVICE)
@@ -147,7 +146,7 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
147
  depth_color[mask>0] = (0,0,0)
148
 
149
  rgba_frame = cv2.cvtColor(raw_frame, cv2.COLOR_RGB2RGBA)
150
- cv2.mixChannels((depth_color,), (rgba_frame,), (0,3,))
151
  blur_frame = rgba_frame.copy()
152
  i = 240
153
  l = 0
 
119
  if not ret:
120
  break
121
 
122
+ frame = cv2.cvtColor(raw_frame, cv2.COLOR_BGR2RGB) / 255.0
123
+ frame_pil = Image.fromarray((frame * 255).astype(np.uint8))
 
124
  frame = transform({'image': frame})['image']
125
 
126
  frame = torch.from_numpy(frame).unsqueeze(0).to(DEVICE)
 
146
  depth_color[mask>0] = (0,0,0)
147
 
148
  rgba_frame = cv2.cvtColor(raw_frame, cv2.COLOR_RGB2RGBA)
149
+ cv2.mixChannels((depth_gray,), (rgba_frame,), (0,3,))
150
  blur_frame = rgba_frame.copy()
151
  i = 240
152
  l = 0