5
5
import pandas as pd
6
6
import re
7
7
8
- from dataframes import compute_time_range , trim_into_interval , repair_dropped_frames
8
+ from dataframes import compute_time_range , trim_into_interval
9
+ from dataframes import repair_dropped_frames , compute_time_step
10
+
11
+ from video import extract_frames
9
12
10
13
11
14
THRESHOLD_NS = 10 * 1000 * 1000
@@ -56,6 +59,7 @@ def scan_session_dir(input_dir: Path) -> Tuple[List[str], List[pd.DataFrame], Li
56
59
57
60
return clientIDs , df_list , mp4_list
58
61
62
+
59
63
#
60
64
#
61
65
#
@@ -76,10 +80,11 @@ def main(input_dir: Path, output_dir: Path):
76
80
print (f"For client ID { cID } : { len (df )} frames for file { mp4 } " )
77
81
78
82
#
79
- # Repair CSVs (TODO - Mina)
83
+ # Repair CSVs
80
84
repaired_df_list : List [pd .DataFrame ] = []
81
85
for cID , df in zip (clientIDs , df_list ):
82
- repaired_df = repair_dropped_frames (df )
86
+ time_step = compute_time_step (df )
87
+ repaired_df = repair_dropped_frames (df = df , time_step = time_step )
83
88
repaired_df_list .append (repaired_df )
84
89
85
90
assert len (clientIDs ) == len (df_list ) == len (mp4_list ) == len (repaired_df_list )
@@ -90,7 +95,7 @@ def main(input_dir: Path, output_dir: Path):
90
95
min_common , max_common = compute_time_range (repaired_df_list )
91
96
92
97
#
93
- # Trim CSVs (TODO)
98
+ # Trim CSVs
94
99
# Trim the data frames to the time range
95
100
trimmed_dataframes = trim_into_interval (repaired_df_list , min_common , max_common , THRESHOLD_NS )
96
101
@@ -109,7 +114,7 @@ def main(input_dir: Path, output_dir: Path):
109
114
#
110
115
# Extract the frames from the original videos
111
116
# and rename the file names to the timestamps (DONE)
112
- # extract (input_dir, output_dir)
117
+ # extract_frames (input_dir, output_dir)
113
118
114
119
#
115
120
# Reconstruct videos (TODO)
0 commit comments