Update video_processing.py
Browse files- video_processing.py +6 -10
video_processing.py
CHANGED
@@ -163,20 +163,16 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
163 |
|
164 |
progress(0.85, "Performing anomaly detection")
|
165 |
embedding_columns = [col for col in df.columns if col.startswith('Raw_Embedding_')]
|
166 |
-
|
167 |
X_embeddings = df[embedding_columns].values
|
168 |
-
|
|
|
|
|
|
|
169 |
try:
|
170 |
-
X_posture = np.array([posture_scores_by_frame.get(frame, None) for frame in df['Frame']])
|
171 |
-
X_posture = X_posture[X_posture != None].reshape(-1, 1)
|
172 |
-
|
173 |
if len(X_posture) == 0:
|
174 |
raise ValueError("No valid posture data found")
|
175 |
-
|
176 |
-
aligned_voice_embeddings = align_voice_embeddings(voice_embeddings, frame_count, original_fps, audio_duration)
|
177 |
-
|
178 |
-
X_voice = np.array([emb for emb in aligned_voice_embeddings])
|
179 |
-
|
180 |
mse_embeddings, mse_posture, mse_voice = anomaly_detection(X_embeddings, X_posture, X_voice)
|
181 |
|
182 |
progress(0.9, "Generating graphs")
|
|
|
163 |
|
164 |
progress(0.85, "Performing anomaly detection")
|
165 |
embedding_columns = [col for col in df.columns if col.startswith('Raw_Embedding_')]
|
166 |
+
|
167 |
X_embeddings = df[embedding_columns].values
|
168 |
+
X_posture = np.array([posture_scores_by_frame.get(frame, None) for frame in df['Frame']])
|
169 |
+
X_posture = X_posture[X_posture != None].reshape(-1, 1)
|
170 |
+
X_voice = np.array(aligned_voice_embeddings)
|
171 |
+
|
172 |
try:
|
|
|
|
|
|
|
173 |
if len(X_posture) == 0:
|
174 |
raise ValueError("No valid posture data found")
|
175 |
+
|
|
|
|
|
|
|
|
|
176 |
mse_embeddings, mse_posture, mse_voice = anomaly_detection(X_embeddings, X_posture, X_voice)
|
177 |
|
178 |
progress(0.9, "Generating graphs")
|