Update app.py
Browse files
app.py
CHANGED
@@ -54,10 +54,10 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
|
|
54 |
return [error_message] + [None] * 27
|
55 |
|
56 |
def show_results(outputs):
|
57 |
-
return gr.Group(visible=True)
|
58 |
|
59 |
with gr.Blocks() as iface:
|
60 |
-
gr.Markdown("""
|
61 |
# Multimodal Behavioral Anomalies Detection
|
62 |
|
63 |
This tool detects anomalies in facial expressions, body language, and voice over the timeline of a video.
|
@@ -65,13 +65,16 @@ with gr.Blocks() as iface:
|
|
65 |
""")
|
66 |
|
67 |
with gr.Row():
|
68 |
-
video_input = gr.Video()
|
69 |
|
70 |
anomaly_threshold = gr.Slider(minimum=1, maximum=5, step=0.1, value=3, label="Anomaly Detection Threshold (Standard deviation)")
|
71 |
fps_slider = gr.Slider(minimum=5, maximum=20, step=1, value=10, label="Frames Per Second (FPS)")
|
72 |
process_btn = gr.Button("Detect Anomalies")
|
73 |
progress_bar = gr.Progress()
|
74 |
-
|
|
|
|
|
|
|
75 |
|
76 |
with gr.Group(visible=False) as results_group:
|
77 |
with gr.Tabs():
|
@@ -95,7 +98,7 @@ with gr.Blocks() as iface:
|
|
95 |
mse_voice_heatmap = gr.Plot(label="MSE Heatmap: Voice")
|
96 |
|
97 |
with gr.TabItem("Combined"):
|
98 |
-
heatmap_video = gr.Video(label="Video with Anomaly Heatmap")
|
99 |
combined_mse_plot = gr.Plot(label="Combined MSE Plot")
|
100 |
correlation_heatmap_plot = gr.Plot(label="Correlation Heatmap")
|
101 |
|
@@ -127,7 +130,7 @@ with gr.Blocks() as iface:
|
|
127 |
).then(
|
128 |
show_results,
|
129 |
inputs=None,
|
130 |
-
outputs=results_group
|
131 |
)
|
132 |
|
133 |
if __name__ == "__main__":
|
|
|
54 |
return [error_message] + [None] * 27
|
55 |
|
56 |
def show_results(outputs):
|
57 |
+
return gr.Group(visible=True), gr.Group(visible=True), gr.Markdown(visible=False)
|
58 |
|
59 |
with gr.Blocks() as iface:
|
60 |
+
description = gr.Markdown("""
|
61 |
# Multimodal Behavioral Anomalies Detection
|
62 |
|
63 |
This tool detects anomalies in facial expressions, body language, and voice over the timeline of a video.
|
|
|
65 |
""")
|
66 |
|
67 |
with gr.Row():
|
68 |
+
video_input = gr.Video(label="Input Video")
|
69 |
|
70 |
anomaly_threshold = gr.Slider(minimum=1, maximum=5, step=0.1, value=3, label="Anomaly Detection Threshold (Standard deviation)")
|
71 |
fps_slider = gr.Slider(minimum=5, maximum=20, step=1, value=10, label="Frames Per Second (FPS)")
|
72 |
process_btn = gr.Button("Detect Anomalies")
|
73 |
progress_bar = gr.Progress()
|
74 |
+
|
75 |
+
execution_time_group = gr.Group(visible=False)
|
76 |
+
with execution_time_group:
|
77 |
+
execution_time = gr.Number(label="Execution Time (seconds)")
|
78 |
|
79 |
with gr.Group(visible=False) as results_group:
|
80 |
with gr.Tabs():
|
|
|
98 |
mse_voice_heatmap = gr.Plot(label="MSE Heatmap: Voice")
|
99 |
|
100 |
with gr.TabItem("Combined"):
|
101 |
+
heatmap_video = gr.Video(label="Video with Anomaly Heatmap", visible=False)
|
102 |
combined_mse_plot = gr.Plot(label="Combined MSE Plot")
|
103 |
correlation_heatmap_plot = gr.Plot(label="Correlation Heatmap")
|
104 |
|
|
|
130 |
).then(
|
131 |
show_results,
|
132 |
inputs=None,
|
133 |
+
outputs=[results_group, execution_time_group, description]
|
134 |
)
|
135 |
|
136 |
if __name__ == "__main__":
|