reab5555 commited on
Commit
2d26eaf
·
verified ·
1 Parent(s): 42597fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -427,7 +427,13 @@ def process_video(video_path, num_anomalies, num_components, desired_fps, batch_
427
  results += f"\n\nTop {num_anomalies} {emotion.capitalize()} Scores:\n"
428
  results += "\n".join([f"{df[emotion].iloc[i]:.4f} at {df['Timecode'].iloc[i]}" for i in top_indices])
429
 
430
- return results, face_sample, anomaly_plot_all, anomaly_plot_comp, *emotion_plots
 
 
 
 
 
 
431
 
432
  # Gradio interface
433
  iface = gr.Interface(
@@ -440,8 +446,8 @@ iface = gr.Interface(
440
  gr.Slider(minimum=1, maximum=64, step=1, value=16, label="Batch Size")
441
  ],
442
  outputs=[
443
- gr.Image(type="filepath", label="Random Face Sample of Most Frequent Person"),
444
  gr.Textbox(label="Anomaly Detection Results"),
 
445
  gr.Plot(label="Anomaly Scores (All Features)"),
446
  gr.Plot(label="Anomaly Scores (Components Only)"),
447
  gr.Plot(label="Fear Anomalies"),
 
427
  results += f"\n\nTop {num_anomalies} {emotion.capitalize()} Scores:\n"
428
  results += "\n".join([f"{df[emotion].iloc[i]:.4f} at {df['Timecode'].iloc[i]}" for i in top_indices])
429
 
430
+ return (
431
+ results, # Text results to a Textbox
432
+ face_sample, # Random face sample image
433
+ anomaly_plot_all,
434
+ anomaly_plot_comp,
435
+ *emotion_plots
436
+ )
437
 
438
  # Gradio interface
439
  iface = gr.Interface(
 
446
  gr.Slider(minimum=1, maximum=64, step=1, value=16, label="Batch Size")
447
  ],
448
  outputs=[
 
449
  gr.Textbox(label="Anomaly Detection Results"),
450
+ gr.Image(type="filepath", label="Random Face Sample of Most Frequent Person"),
451
  gr.Plot(label="Anomaly Scores (All Features)"),
452
  gr.Plot(label="Anomaly Scores (Components Only)"),
453
  gr.Plot(label="Fear Anomalies"),