Update visualization.py
Browse files- visualization.py +2 -2
visualization.py
CHANGED
@@ -278,8 +278,8 @@ def create_video_with_heatmap(video_path, df, mse_embeddings, mse_posture, mse_v
|
|
278 |
video = VideoFileClip(video_path)
|
279 |
|
280 |
# Get video properties
|
281 |
-
width, height
|
282 |
-
total_frames
|
283 |
|
284 |
# Ensure all MSE arrays have the same length as total_frames
|
285 |
mse_embeddings = np.interp(np.linspace(0, len(mse_embeddings) - 1, total_frames),
|
|
|
278 |
video = VideoFileClip(video_path)
|
279 |
|
280 |
# Get video properties
|
281 |
+
width, height = video.w, video.h
|
282 |
+
total_frames = int(video.duration * video.fps)
|
283 |
|
284 |
# Ensure all MSE arrays have the same length as total_frames
|
285 |
mse_embeddings = np.interp(np.linspace(0, len(mse_embeddings) - 1, total_frames),
|