Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,13 +15,12 @@ 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, \
|
| 21 |
mse_plot_embeddings, mse_histogram_embeddings, \
|
| 22 |
mse_plot_posture, mse_histogram_posture, \
|
| 23 |
mse_heatmap_embeddings, mse_heatmap_posture, \
|
| 24 |
-
mse_voice, mse_plot_voice, mse_histogram_voice, mse_heatmap_voice, \
|
| 25 |
face_samples_frequent, \
|
| 26 |
anomaly_faces_embeddings, anomaly_frames_posture_images, \
|
| 27 |
aligned_faces_folder, frames_folder, \
|
|
@@ -52,14 +51,14 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
|
|
| 52 |
print(error_message)
|
| 53 |
import traceback
|
| 54 |
traceback.print_exc()
|
| 55 |
-
return [error_message] + [None] *
|
| 56 |
|
| 57 |
with gr.Blocks() as iface:
|
| 58 |
gr.Markdown("""
|
| 59 |
# Multimodal Behavioral Anomalies Detection
|
| 60 |
|
| 61 |
-
This tool detects anomalies in facial expressions
|
| 62 |
-
It extracts faces
|
| 63 |
""")
|
| 64 |
|
| 65 |
with gr.Row():
|
|
@@ -87,11 +86,6 @@ with gr.Blocks() as iface:
|
|
| 87 |
mse_posture_heatmap = gr.Plot(label="MSE Heatmap: Body Posture")
|
| 88 |
anomaly_frames_posture = gr.Gallery(label="Anomaly Frames (Body Posture)", columns=6, rows=2, height="auto")
|
| 89 |
|
| 90 |
-
with gr.Tab("Voice"):
|
| 91 |
-
mse_voice_plot = gr.Plot(label="MSE: Voice")
|
| 92 |
-
mse_voice_hist = gr.Plot(label="MSE Distribution: Voice")
|
| 93 |
-
mse_voice_heatmap = gr.Plot(label="MSE Heatmap: Voice")
|
| 94 |
-
|
| 95 |
with gr.Tab("Video with Heatmap"):
|
| 96 |
heatmap_video = gr.Video(label="Video with Anomaly Heatmap")
|
| 97 |
|
|
|
|
| 15 |
|
| 16 |
if isinstance(results[0], str) and results[0].startswith("Error"):
|
| 17 |
print(f"Error occurred: {results[0]}")
|
| 18 |
+
return [results[0]] + [None] * 17
|
| 19 |
|
| 20 |
exec_time, results_summary, df, mse_embeddings, mse_posture, \
|
| 21 |
mse_plot_embeddings, mse_histogram_embeddings, \
|
| 22 |
mse_plot_posture, mse_histogram_posture, \
|
| 23 |
mse_heatmap_embeddings, mse_heatmap_posture, \
|
|
|
|
| 24 |
face_samples_frequent, \
|
| 25 |
anomaly_faces_embeddings, anomaly_frames_posture_images, \
|
| 26 |
aligned_faces_folder, frames_folder, \
|
|
|
|
| 51 |
print(error_message)
|
| 52 |
import traceback
|
| 53 |
traceback.print_exc()
|
| 54 |
+
return [error_message] + [None] * 17
|
| 55 |
|
| 56 |
with gr.Blocks() as iface:
|
| 57 |
gr.Markdown("""
|
| 58 |
# Multimodal Behavioral Anomalies Detection
|
| 59 |
|
| 60 |
+
This tool detects anomalies in facial expressions and body language over the timeline of a video.
|
| 61 |
+
It extracts faces and postures from video frames, and analyzes them to identify anomalies using time series analysis and a variational autoencoder (VAE) approach.
|
| 62 |
""")
|
| 63 |
|
| 64 |
with gr.Row():
|
|
|
|
| 86 |
mse_posture_heatmap = gr.Plot(label="MSE Heatmap: Body Posture")
|
| 87 |
anomaly_frames_posture = gr.Gallery(label="Anomaly Frames (Body Posture)", columns=6, rows=2, height="auto")
|
| 88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
with gr.Tab("Video with Heatmap"):
|
| 90 |
heatmap_video = gr.Video(label="Video with Anomaly Heatmap")
|
| 91 |
|