Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
123 |
-
frame_pil = Image.fromarray(
|
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((
|
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
|