reab5555 commited on
Commit
a0bb5ff
·
verified ·
1 Parent(s): 78cd4ce

Update video_processing.py

Browse files
Files changed (1) hide show
  1. video_processing.py +6 -8
video_processing.py CHANGED
@@ -215,21 +215,19 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
215
  progress(0.95, desc="Generating video with heatmap")
216
 
217
  output_folder = "output"
218
- os.makedirs(output_folder, exist_ok=True)
219
  heatmap_video_path = create_video_with_heatmap(
220
  video_path, df, mse_embeddings, mse_posture, mse_voice,
221
  output_folder, original_fps, largest_cluster,
222
  progress=progress
223
  )
224
- print(f"Heatmap video path from create_video_with_heatmap: {heatmap_video_path}")
225
-
226
- if not os.path.exists(heatmap_video_path):
227
- raise FileNotFoundError(f"Heatmap video file not found at {heatmap_video_path}")
228
-
229
-
230
  if progress is not None:
231
  progress(1.0, desc="Video processing complete")
232
-
233
  except Exception as e:
234
  print(f"Error in create_video_with_heatmap: {str(e)}")
235
  import traceback
 
215
  progress(0.95, desc="Generating video with heatmap")
216
 
217
  output_folder = "output"
 
218
  heatmap_video_path = create_video_with_heatmap(
219
  video_path, df, mse_embeddings, mse_posture, mse_voice,
220
  output_folder, original_fps, largest_cluster,
221
  progress=progress
222
  )
223
+
224
+ if heatmap_video_path is None:
225
+ print("Failed to create heatmap video")
226
+ else:
227
+ print(f"Heatmap video path from create_video_with_heatmap: {heatmap_video_path}")
228
+
229
  if progress is not None:
230
  progress(1.0, desc="Video processing complete")
 
231
  except Exception as e:
232
  print(f"Error in create_video_with_heatmap: {str(e)}")
233
  import traceback