reab5555 commited on
Commit
33ea198
·
verified ·
1 Parent(s): edb037a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -54,10 +54,16 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
54
  return [error_message] + [None] * 16
55
 
56
  def on_button_click(video, threshold, fps):
 
 
 
 
57
  results = process_and_show_completion(video, threshold, fps)
 
 
58
 
59
  return {
60
- execution_time: gr.update(visible=True, value=results[0]),
61
  results_tab: gr.update(visible=True),
62
  description_tab: gr.update(visible=False),
63
  results_text: results[1],
@@ -81,6 +87,7 @@ def on_button_click(video, threshold, fps):
81
  video_display_voice: video
82
  }
83
 
 
84
  with gr.Blocks() as iface:
85
  gr.Markdown("""
86
  # Multimodal Behavioral Anomalies Detection
 
54
  return [error_message] + [None] * 16
55
 
56
  def on_button_click(video, threshold, fps):
57
+ # Display execution time immediately
58
+ yield {execution_time: gr.update(visible=True, value=0)}
59
+
60
+ start_time = time.time()
61
  results = process_and_show_completion(video, threshold, fps)
62
+ end_time = time.time()
63
+ exec_time = end_time - start_time
64
 
65
  return {
66
+ execution_time: gr.update(visible=True, value=exec_time),
67
  results_tab: gr.update(visible=True),
68
  description_tab: gr.update(visible=False),
69
  results_text: results[1],
 
87
  video_display_voice: video
88
  }
89
 
90
+
91
  with gr.Blocks() as iface:
92
  gr.Markdown("""
93
  # Multimodal Behavioral Anomalies Detection