Sunil Sarolkar
commited on
Commit
·
cc2286b
1
Parent(s):
65c0b8a
testing
Browse files
app.py
CHANGED
|
@@ -418,6 +418,12 @@ elif app_mode =='Run on Test Videos':
|
|
| 418 |
|
| 419 |
window_size=20
|
| 420 |
current_test_df=testing_df[mask]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 421 |
X_test_filtered,y_test_filtered = create_timeseries_data(current_test_df,feature_columns_new,label_columns,window_size=window_size)
|
| 422 |
# y_filtered_encoded=to_categorical(y_test_filtered, num_classes=len(df['Expression_encoded'].unique()))
|
| 423 |
X_test_filtered=np.array(X_test_filtered)
|
|
@@ -479,6 +485,10 @@ elif app_mode =='Run on Test Videos':
|
|
| 479 |
repo_type="dataset"
|
| 480 |
)
|
| 481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 482 |
vid = cv2.VideoCapture(vid_file)
|
| 483 |
|
| 484 |
ffprobe_result = ffprobe(vid_file)
|
|
|
|
| 418 |
|
| 419 |
window_size=20
|
| 420 |
current_test_df=testing_df[mask]
|
| 421 |
+
|
| 422 |
+
if current_test_df.empty:
|
| 423 |
+
st.error("⚠️ No matching rows in testing_df for this selection.")
|
| 424 |
+
st.stop()
|
| 425 |
+
else:
|
| 426 |
+
st.success(f"✅ Loaded {current_test_df.shape[0]} frames for this selection.")
|
| 427 |
X_test_filtered,y_test_filtered = create_timeseries_data(current_test_df,feature_columns_new,label_columns,window_size=window_size)
|
| 428 |
# y_filtered_encoded=to_categorical(y_test_filtered, num_classes=len(df['Expression_encoded'].unique()))
|
| 429 |
X_test_filtered=np.array(X_test_filtered)
|
|
|
|
| 485 |
repo_type="dataset"
|
| 486 |
)
|
| 487 |
|
| 488 |
+
if not os.path.exists(vid_file):
|
| 489 |
+
st.error(f"⚠️ Video file not found: {f'test/{category}/{cls}/{filename}'}")
|
| 490 |
+
st.stop()
|
| 491 |
+
|
| 492 |
vid = cv2.VideoCapture(vid_file)
|
| 493 |
|
| 494 |
ffprobe_result = ffprobe(vid_file)
|