Fix check_delta_timestamps
This commit is contained in:
parent
7ae8d05326
commit
b8bdbc1c5b
|
@ -298,10 +298,11 @@ def check_delta_timestamps(
|
||||||
"""
|
"""
|
||||||
outside_tolerance = {}
|
outside_tolerance = {}
|
||||||
for key, delta_ts in delta_timestamps.items():
|
for key, delta_ts in delta_timestamps.items():
|
||||||
abs_delta_ts = torch.abs(torch.tensor(delta_ts))
|
within_tolerance = [abs(ts * fps - round(ts * fps)) <= tolerance_s for ts in delta_ts]
|
||||||
within_tolerance = (abs_delta_ts % (1 / fps)) <= tolerance_s
|
if not all(within_tolerance):
|
||||||
if not torch.all(within_tolerance):
|
outside_tolerance[key] = [
|
||||||
outside_tolerance[key] = torch.tensor(delta_ts)[~within_tolerance]
|
ts for ts, is_within in zip(delta_ts, within_tolerance, strict=True) if not is_within
|
||||||
|
]
|
||||||
|
|
||||||
if len(outside_tolerance) > 0:
|
if len(outside_tolerance) > 0:
|
||||||
if raise_value_error:
|
if raise_value_error:
|
||||||
|
|
Loading…
Reference in New Issue