reab5555 commited on
Commit
645ec80
·
verified ·
1 Parent(s): c243adb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -15,7 +15,7 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
15
 
16
  if isinstance(results[0], str) and results[0].startswith("Error"):
17
  print(f"Error occurred: {results[0]}")
18
- return [results[0]] + [None] * 26
19
 
20
  exec_time, results_summary, df, mse_embeddings, mse_posture, mse_voice, \
21
  mse_plot_embeddings, mse_plot_posture, mse_plot_voice, \
@@ -24,7 +24,7 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
24
  face_samples_frequent, \
25
  anomaly_faces_embeddings, anomaly_frames_posture_images, \
26
  aligned_faces_folder, frames_folder, \
27
- stacked_heatmap, correlation_heatmap = results
28
 
29
  anomaly_faces_embeddings_pil = [Image.fromarray(face) for face in anomaly_faces_embeddings] if anomaly_faces_embeddings is not None else []
30
  anomaly_frames_posture_pil = [Image.fromarray(frame) for frame in anomaly_frames_posture_images] if anomaly_frames_posture_images is not None else []
@@ -41,7 +41,7 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
41
  face_samples_frequent,
42
  aligned_faces_folder, frames_folder,
43
  mse_embeddings, mse_posture, mse_voice,
44
- stacked_heatmap, correlation_heatmap
45
  ]
46
 
47
  return output
@@ -51,7 +51,7 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
51
  print(error_message)
52
  import traceback
53
  traceback.print_exc()
54
- return [error_message] + [None] * 26
55
 
56
  def show_results(outputs):
57
  return gr.Group(visible=True)
@@ -99,7 +99,6 @@ with gr.Blocks() as iface:
99
 
100
  with gr.TabItem("Combined"):
101
  stacked_heatmap_plot = gr.Plot(label="Combined MSE Heatmaps")
102
- correlation_heatmap_plot = gr.Plot(label="Correlation Heatmap")
103
 
104
  with gr.Row():
105
  with gr.Group(visible=True) as results_group2:
@@ -220,7 +219,7 @@ with gr.Blocks() as iface:
220
  face_samples_most_frequent,
221
  aligned_faces_folder_store, frames_folder_store,
222
  mse_heatmap_embeddings_store, mse_heatmap_posture_store, mse_heatmap_voice_store,
223
- stacked_heatmap_plot, correlation_heatmap_plot
224
  ]
225
  ).then(
226
  show_results,
 
15
 
16
  if isinstance(results[0], str) and results[0].startswith("Error"):
17
  print(f"Error occurred: {results[0]}")
18
+ return [results[0]] + [None] * 25
19
 
20
  exec_time, results_summary, df, mse_embeddings, mse_posture, mse_voice, \
21
  mse_plot_embeddings, mse_plot_posture, mse_plot_voice, \
 
24
  face_samples_frequent, \
25
  anomaly_faces_embeddings, anomaly_frames_posture_images, \
26
  aligned_faces_folder, frames_folder, \
27
+ stacked_heatmap = results
28
 
29
  anomaly_faces_embeddings_pil = [Image.fromarray(face) for face in anomaly_faces_embeddings] if anomaly_faces_embeddings is not None else []
30
  anomaly_frames_posture_pil = [Image.fromarray(frame) for frame in anomaly_frames_posture_images] if anomaly_frames_posture_images is not None else []
 
41
  face_samples_frequent,
42
  aligned_faces_folder, frames_folder,
43
  mse_embeddings, mse_posture, mse_voice,
44
+ stacked_heatmap
45
  ]
46
 
47
  return output
 
51
  print(error_message)
52
  import traceback
53
  traceback.print_exc()
54
+ return [error_message] + [None] * 25
55
 
56
  def show_results(outputs):
57
  return gr.Group(visible=True)
 
99
 
100
  with gr.TabItem("Combined"):
101
  stacked_heatmap_plot = gr.Plot(label="Combined MSE Heatmaps")
 
102
 
103
  with gr.Row():
104
  with gr.Group(visible=True) as results_group2:
 
219
  face_samples_most_frequent,
220
  aligned_faces_folder_store, frames_folder_store,
221
  mse_heatmap_embeddings_store, mse_heatmap_posture_store, mse_heatmap_voice_store,
222
+ stacked_heatmap_plot
223
  ]
224
  ).then(
225
  show_results,