Update app.py
Browse files
app.py
CHANGED
|
@@ -153,6 +153,8 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits', blur_data
|
|
| 153 |
#out = cv2.VideoWriter(output_path, fourcc, frame_rate, (output_width, frame_height))
|
| 154 |
|
| 155 |
global comb_frames
|
|
|
|
|
|
|
| 156 |
count = 0
|
| 157 |
n = 0
|
| 158 |
depth_frames = []
|
|
@@ -224,13 +226,13 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits', blur_data
|
|
| 224 |
blur_frame = blur_image(cv2.cvtColor(raw_frame, cv2.COLOR_BGR2BGRA), depth_color, blur_data)
|
| 225 |
|
| 226 |
cv2.imwrite(f"f{count}.png", blur_frame)
|
| 227 |
-
|
| 228 |
|
| 229 |
cv2.imwrite(f"f{count}_.png", blur_frame)
|
| 230 |
backup_frames.append(f"f{count}_.png")
|
| 231 |
|
| 232 |
cv2.imwrite(f"f{count}_dmap.png", depth_color)
|
| 233 |
-
|
| 234 |
|
| 235 |
depth_gray = seg_frame(depth_gray, o, b) + 128
|
| 236 |
#print(depth_gray[depth_gray>128]-128)
|
|
@@ -242,8 +244,8 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits', blur_data
|
|
| 242 |
color_transfer(0)
|
| 243 |
|
| 244 |
j=0
|
| 245 |
-
while j<len(
|
| 246 |
-
comb_frame = np.concatenate((cv2.imread(
|
| 247 |
|
| 248 |
cv2.imwrite(f"f{j}_comb.png", comb_frame)
|
| 249 |
comb_frames.append(f"f{j}_comb.png")
|
|
@@ -258,12 +260,8 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits', blur_data
|
|
| 258 |
|
| 259 |
global gradient
|
| 260 |
global frame_selected
|
| 261 |
-
global
|
| 262 |
-
global frames
|
| 263 |
-
global backups
|
| 264 |
-
frames = orig_frames
|
| 265 |
backups = backup_frames
|
| 266 |
-
depths = depth_frames
|
| 267 |
|
| 268 |
if depth_color.shape[0] == 2048: #height
|
| 269 |
gradient = cv2.imread('./gradient_large.png').astype(np.uint8)
|
|
|
|
| 153 |
#out = cv2.VideoWriter(output_path, fourcc, frame_rate, (output_width, frame_height))
|
| 154 |
|
| 155 |
global comb_frames
|
| 156 |
+
global frames
|
| 157 |
+
global depths
|
| 158 |
count = 0
|
| 159 |
n = 0
|
| 160 |
depth_frames = []
|
|
|
|
| 226 |
blur_frame = blur_image(cv2.cvtColor(raw_frame, cv2.COLOR_BGR2BGRA), depth_color, blur_data)
|
| 227 |
|
| 228 |
cv2.imwrite(f"f{count}.png", blur_frame)
|
| 229 |
+
frames.append(f"f{count}.png")
|
| 230 |
|
| 231 |
cv2.imwrite(f"f{count}_.png", blur_frame)
|
| 232 |
backup_frames.append(f"f{count}_.png")
|
| 233 |
|
| 234 |
cv2.imwrite(f"f{count}_dmap.png", depth_color)
|
| 235 |
+
depths.append(f"f{count}_dmap.png")
|
| 236 |
|
| 237 |
depth_gray = seg_frame(depth_gray, o, b) + 128
|
| 238 |
#print(depth_gray[depth_gray>128]-128)
|
|
|
|
| 244 |
color_transfer(0)
|
| 245 |
|
| 246 |
j=0
|
| 247 |
+
while j<len(frames):
|
| 248 |
+
comb_frame = np.concatenate((cv2.imread(frames[j]), cv2.imread(depths[j])), axis=0)
|
| 249 |
|
| 250 |
cv2.imwrite(f"f{j}_comb.png", comb_frame)
|
| 251 |
comb_frames.append(f"f{j}_comb.png")
|
|
|
|
| 260 |
|
| 261 |
global gradient
|
| 262 |
global frame_selected
|
| 263 |
+
global backups
|
|
|
|
|
|
|
|
|
|
| 264 |
backups = backup_frames
|
|
|
|
| 265 |
|
| 266 |
if depth_color.shape[0] == 2048: #height
|
| 267 |
gradient = cv2.imread('./gradient_large.png').astype(np.uint8)
|