reab5555 commited on
Commit
8e714a3
·
verified ·
1 Parent(s): 447af05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -22,7 +22,7 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
22
  mse_heatmap_embeddings, mse_heatmap_posture, \
23
  face_samples_frequent, face_samples_other, \
24
  anomaly_faces_embeddings, anomaly_frames_posture_images, \
25
- aligned_faces_folder, frames_folder = results
26
 
27
  anomaly_faces_embeddings_pil = [Image.fromarray(face) for face in anomaly_faces_embeddings]
28
  anomaly_frames_posture_pil = [Image.fromarray(frame) for frame in anomaly_frames_posture_images]
@@ -39,7 +39,7 @@ def process_and_show_completion(video_input_path, anomaly_threshold_input, fps,
39
  anomaly_faces_embeddings_pil, anomaly_frames_posture_pil,
40
  face_samples_frequent, face_samples_other,
41
  aligned_faces_folder, frames_folder,
42
- mse_embeddings, mse_posture,
43
  ]
44
 
45
  return output
@@ -86,6 +86,9 @@ with gr.Blocks() as iface:
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("Face Samples"):
90
  face_samples_most_frequent = gr.Gallery(label="Most Frequent Person Samples (Target)", columns=6, rows=2, height="auto")
91
  face_samples_others = gr.Gallery(label="Other Persons Samples", columns=6, rows=1, height="auto")
@@ -119,7 +122,8 @@ with gr.Blocks() as iface:
119
  anomaly_frames_features, anomaly_frames_posture,
120
  face_samples_most_frequent, face_samples_others,
121
  aligned_faces_folder_store, frames_folder_store,
122
- mse_heatmap_embeddings_store, mse_heatmap_posture_store
 
123
  ]
124
  ).then(
125
  lambda: gr.Group(visible=True),
 
22
  mse_heatmap_embeddings, mse_heatmap_posture, \
23
  face_samples_frequent, face_samples_other, \
24
  anomaly_faces_embeddings, anomaly_frames_posture_images, \
25
+ aligned_faces_folder, frames_folder, annotated_video_path = results
26
 
27
  anomaly_faces_embeddings_pil = [Image.fromarray(face) for face in anomaly_faces_embeddings]
28
  anomaly_frames_posture_pil = [Image.fromarray(frame) for frame in anomaly_frames_posture_images]
 
39
  anomaly_faces_embeddings_pil, anomaly_frames_posture_pil,
40
  face_samples_frequent, face_samples_other,
41
  aligned_faces_folder, frames_folder,
42
+ mse_embeddings, mse_posture, annotated_video_path
43
  ]
44
 
45
  return output
 
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("Annotated Video"):
90
+ annotated_video_output = gr.Video(label="Annotated Video")
91
+
92
  with gr.Tab("Face Samples"):
93
  face_samples_most_frequent = gr.Gallery(label="Most Frequent Person Samples (Target)", columns=6, rows=2, height="auto")
94
  face_samples_others = gr.Gallery(label="Other Persons Samples", columns=6, rows=1, height="auto")
 
122
  anomaly_frames_features, anomaly_frames_posture,
123
  face_samples_most_frequent, face_samples_others,
124
  aligned_faces_folder_store, frames_folder_store,
125
+ mse_heatmap_embeddings_store, mse_heatmap_posture_store,
126
+ annotated_video_output
127
  ]
128
  ).then(
129
  lambda: gr.Group(visible=True),