Skip to content

Commit b5992d2

Browse files
committed
Removed useless conversion into datetime. Removes also console warnings.
1 parent 0bcc30a commit b5992d2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

PythonTools/PostProcessVideos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def post_process(input_dir: Path, output_dir: Path, threshold_ns: int = DEFAULT_
4242
time_step = compute_time_step(df)
4343
repaired_df = repair_dropped_frames(df=df, time_step=time_step)
4444
repaired_df_list.append(repaired_df)
45+
print(f"Client ID {cID} repaired from {len(df)} to {len(repaired_df)} frames")
4546

4647
assert len(clientIDs) == len(df_list) == len(mp4_list) == len(repaired_df_list)
4748

PythonTools/dataframes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def compute_time_step(video_timestamps: pd.DataFrame) -> float:
1515
video_timestamps (pd.DataFrame): A pandas DataFrame containing timestamps of a video.
1616
1717
Returns:
18-
float: The time step of the video time stamps.
18+
float: The time step of the video time stamps, in nanoseconds.
1919
"""
2020

2121
first_col_name = video_timestamps.columns[0]
@@ -30,7 +30,7 @@ def repair_dropped_frames(df: pd.DataFrame, time_step: float) -> pd.DataFrame:
3030
first_col_name = df.columns[0]
3131

3232
# Forces the type of the timestamps to int64
33-
df[first_col_name] = pd.to_datetime(df[first_col_name]).astype(np.int64)
33+
df[first_col_name] = df[first_col_name].astype(np.int64)
3434
# Retrieves the timestamps into a Series
3535
timestamps = df[first_col_name]
3636
# Will accumulate the repaired rows
@@ -63,7 +63,7 @@ def repair_dropped_frames(df: pd.DataFrame, time_step: float) -> pd.DataFrame:
6363
columns = ['timestamp', 'generated']
6464
output_df = pd.DataFrame(repaired_rows, columns=columns)
6565
# Forces the output timestamp type to int 64
66-
output_df['timestamp'] = pd.to_datetime(output_df['timestamp']).astype(np.int64)
66+
# output_df['timestamp'] = pd.to_datetime(output_df['timestamp']).astype(np.int64)
6767

6868
return output_df
6969

0 commit comments

Comments
 (0)