reab5555 commited on
Commit
637aaac
·
verified ·
1 Parent(s): 1ce392f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -18,18 +18,22 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
18
  print(f"Error occurred: {results[0]}")
19
  return [results[0]] + [None] * 27
20
 
21
- exec_time, results_summary, df, mse_embeddings, mse_posture, mse_voice, \
22
- mse_plot_embeddings, mse_plot_posture, mse_plot_voice, \
23
- mse_histogram_embeddings, mse_histogram_posture, mse_histogram_voice, \
24
- mse_heatmap_embeddings, mse_heatmap_posture, mse_heatmap_voice, \
25
- face_samples_frequent, \
26
- anomaly_faces_embeddings, anomaly_frames_posture_images, \
27
- aligned_faces_folder, frames_folder, \
28
- stacked_heatmap, audio_waveform_plot = results
 
 
29
 
 
30
  anomaly_faces_embeddings_pil = [Image.fromarray(face) for face in anomaly_faces_embeddings] if anomaly_faces_embeddings is not None else []
31
  anomaly_frames_posture_pil = [Image.fromarray(frame) for frame in anomaly_frames_posture_images] if anomaly_frames_posture_images is not None else []
32
 
 
33
  face_samples_frequent = [Image.open(path) for path in face_samples_frequent] if face_samples_frequent is not None else []
34
 
35
  output = [
 
18
  print(f"Error occurred: {results[0]}")
19
  return [results[0]] + [None] * 27
20
 
21
+ (
22
+ exec_time, results_summary, df, mse_embeddings, mse_posture, mse_voice,
23
+ mse_plot_embeddings, mse_plot_posture, mse_plot_voice,
24
+ mse_histogram_embeddings, mse_histogram_posture, mse_histogram_voice,
25
+ mse_heatmap_embeddings, mse_heatmap_posture, mse_heatmap_voice,
26
+ audio_waveform_plot, face_samples_frequent,
27
+ anomaly_faces_embeddings, anomaly_frames_posture_images,
28
+ aligned_faces_folder, frames_folder,
29
+ stacked_heatmap
30
+ ) = results
31
 
32
+ # Convert numpy arrays to PIL Images
33
  anomaly_faces_embeddings_pil = [Image.fromarray(face) for face in anomaly_faces_embeddings] if anomaly_faces_embeddings is not None else []
34
  anomaly_frames_posture_pil = [Image.fromarray(frame) for frame in anomaly_frames_posture_images] if anomaly_frames_posture_images is not None else []
35
 
36
+ # Load face samples
37
  face_samples_frequent = [Image.open(path) for path in face_samples_frequent] if face_samples_frequent is not None else []
38
 
39
  output = [