Update app.py
Browse files
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] *
|
19 |
|
20 |
exec_time, results_summary, df, mse_embeddings, mse_posture, mse_voice, \
|
21 |
mse_plot_embeddings, mse_plot_posture, mse_plot_voice, \
|
@@ -24,19 +24,13 @@ 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 |
-
heatmap_video_path = 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 []
|
31 |
|
32 |
face_samples_frequent = [Image.open(path) for path in face_samples_frequent] if face_samples_frequent is not None else []
|
33 |
|
34 |
-
# Generate the correlation heatmap
|
35 |
-
correlation_heatmap = plot_correlation_heatmap(mse_embeddings, mse_posture, mse_voice)
|
36 |
-
|
37 |
-
# Generate the 3D scatter plot
|
38 |
-
scatter_plot_3d = plot_3d_scatter(mse_embeddings, mse_posture, mse_voice)
|
39 |
-
|
40 |
output = [
|
41 |
exec_time, results_summary,
|
42 |
df, mse_embeddings, mse_posture, mse_voice,
|
@@ -139,4 +133,4 @@ with gr.Blocks() as iface:
|
|
139 |
)
|
140 |
|
141 |
if __name__ == "__main__":
|
142 |
-
iface.launch()
|
|
|
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 # Update the tuple size to match the number of outputs
|
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 |
+
heatmap_video_path, correlation_heatmap, scatter_plot_3d = 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 []
|
31 |
|
32 |
face_samples_frequent = [Image.open(path) for path in face_samples_frequent] if face_samples_frequent is not None else []
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
output = [
|
35 |
exec_time, results_summary,
|
36 |
df, mse_embeddings, mse_posture, mse_voice,
|
|
|
133 |
)
|
134 |
|
135 |
if __name__ == "__main__":
|
136 |
+
iface.launch()
|