Update visualization.py
Browse files- visualization.py +5 -1
visualization.py
CHANGED
@@ -221,6 +221,10 @@ def create_video_with_heatmap(video_path, mse_heatmap_embeddings_img, mse_heatma
|
|
221 |
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
222 |
out = cv2.VideoWriter(output_path, fourcc, desired_fps, (width, height + 400))
|
223 |
|
|
|
|
|
|
|
|
|
224 |
for frame_count in range(0, total_frames):
|
225 |
cap.set(cv2.CAP_PROP_POS_FRAMES, frame_count)
|
226 |
ret, frame = cap.read()
|
@@ -241,4 +245,4 @@ def create_video_with_heatmap(video_path, mse_heatmap_embeddings_img, mse_heatma
|
|
241 |
out.release()
|
242 |
plt.close('all')
|
243 |
|
244 |
-
return output_path
|
|
|
221 |
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
222 |
out = cv2.VideoWriter(output_path, fourcc, desired_fps, (width, height + 400))
|
223 |
|
224 |
+
# Resize heatmap images to match the width of the video frames
|
225 |
+
mse_heatmap_embeddings_img = cv2.resize(mse_heatmap_embeddings_img, (width, 200))
|
226 |
+
mse_heatmap_posture_img = cv2.resize(mse_heatmap_posture_img, (width, 200))
|
227 |
+
|
228 |
for frame_count in range(0, total_frames):
|
229 |
cap.set(cv2.CAP_PROP_POS_FRAMES, frame_count)
|
230 |
ret, frame = cap.read()
|
|
|
245 |
out.release()
|
246 |
plt.close('all')
|
247 |
|
248 |
+
return output_path
|