@@ -66,17 +66,9 @@ def extract(input_dir, output_dir):
66
66
# Release the video file
67
67
cap .release ()
68
68
69
-
70
- #
71
69
#
72
70
#
73
- def main (input_dir : Path , output_dir : Path ):
74
-
75
- # input_dir = Path("/Users/tbc/Desktop/videos/")
76
- # output_dir = Path("/Users/tbc/Desktop/output_videos/")
77
-
78
- print (f"Scanning dir { str (input_dir )} ..." )
79
-
71
+ def scan_session_dir (input_dir : Path ) -> Tuple [List [str ], List [pd .DataFrame ], List [str ]]:
80
72
#
81
73
# Find all CSV files in the directory and read it into a data frame
82
74
# Use the following regular expression to check of the client ID is a 16-digit hexadecimal.
@@ -94,8 +86,6 @@ def main(input_dir: Path, output_dir: Path):
94
86
else :
95
87
print ("Discarding " , p .stem )
96
88
97
- n_clients = len (clientIDs )
98
-
99
89
#
100
90
# Accumulates the list of dataframes and mp4 files in the same order of the client IDs.
101
91
df_list : List [pd .DataFrame ] = []
@@ -121,6 +111,19 @@ def main(input_dir: Path, output_dir: Path):
121
111
df_list .append (df )
122
112
mp4_list .append (str (mp4_file ))
123
113
114
+ return clientIDs , df_list , mp4_list
115
+
116
+ #
117
+ #
118
+ #
119
+ def main (input_dir : Path , output_dir : Path ):
120
+
121
+ print (f"Scanning dir { str (input_dir )} ..." )
122
+ clientIDs , df_list , mp4_list = scan_session_dir (input_dir )
123
+
124
+ n_clients = len (clientIDs )
125
+
126
+
124
127
#
125
128
# Print collected info
126
129
for i in range (n_clients ):
0 commit comments