Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
308542a
1
Parent(s):
2600e5b
Update app
Browse files
app.py
CHANGED
|
@@ -379,7 +379,6 @@ def load_rgb_masked_frames(input_frames, kp_dict, stride=1, window_frames=25, wi
|
|
| 379 |
|
| 380 |
img = input_frames[i]
|
| 381 |
face = frame_kp_dict["face"]
|
| 382 |
-
# print(face.shape)
|
| 383 |
|
| 384 |
if face is None:
|
| 385 |
img = cv2.resize(img, (width, height))
|
|
@@ -399,7 +398,6 @@ def load_rgb_masked_frames(input_frames, kp_dict, stride=1, window_frames=25, wi
|
|
| 399 |
if masked_img.shape[0] != width or masked_img.shape[1] != height:
|
| 400 |
masked_img = cv2.resize(masked_img, (width, height))
|
| 401 |
|
| 402 |
-
print(masked_img.shape)
|
| 403 |
input_frames_masked.append(masked_img)
|
| 404 |
|
| 405 |
orig_masked_frames = np.array(input_frames_masked)
|
|
@@ -719,6 +717,7 @@ def process_video(video_path, num_avg_frames, apply_preprocess):
|
|
| 719 |
rgb_frames, num_frames, orig_masked_frames, status = load_rgb_masked_frames(frames, kp_dict, window_frames=25, width=480, height=270)
|
| 720 |
if status != "success":
|
| 721 |
return status, None
|
|
|
|
| 722 |
|
| 723 |
# Convert frames to tensor
|
| 724 |
rgb_frames = np.transpose(rgb_frames, (4, 0, 1, 2, 3))
|
|
|
|
| 379 |
|
| 380 |
img = input_frames[i]
|
| 381 |
face = frame_kp_dict["face"]
|
|
|
|
| 382 |
|
| 383 |
if face is None:
|
| 384 |
img = cv2.resize(img, (width, height))
|
|
|
|
| 398 |
if masked_img.shape[0] != width or masked_img.shape[1] != height:
|
| 399 |
masked_img = cv2.resize(masked_img, (width, height))
|
| 400 |
|
|
|
|
| 401 |
input_frames_masked.append(masked_img)
|
| 402 |
|
| 403 |
orig_masked_frames = np.array(input_frames_masked)
|
|
|
|
| 717 |
rgb_frames, num_frames, orig_masked_frames, status = load_rgb_masked_frames(frames, kp_dict, window_frames=25, width=480, height=270)
|
| 718 |
if status != "success":
|
| 719 |
return status, None
|
| 720 |
+
print("Successfully loaded the RGB frames")
|
| 721 |
|
| 722 |
# Convert frames to tensor
|
| 723 |
rgb_frames = np.transpose(rgb_frames, (4, 0, 1, 2, 3))
|