Skip to content

Commit

Permalink
Merge branch 'PRBonn:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh1002 authored Jul 11, 2024
2 parents 8952ca0 + 5d42087 commit 43b7509
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions python/kiss_icp/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,14 @@ def _run_evaluation(self):
# Run timing metrics evaluation, always
def _get_fps():
total_time_s = sum(self.times) * 1e-9
return float(len(self.times) / total_time_s)

avg_fps = int(np.ceil(_get_fps()))
avg_ms = int(np.ceil(1e3 * (1 / _get_fps())))
self.results.append(desc="Average Frequency", units="Hz", value=avg_fps, trunc=True)
self.results.append(desc="Average Runtime", units="ms", value=avg_ms, trunc=True)
return float(len(self.times) / total_time_s) if total_time_s > 0 else 0

fps = _get_fps()
avg_fps = int(np.floor(fps))
avg_ms = int(np.ceil(1e3 / fps)) if fps > 0 else 0
if avg_fps > 0:
self.results.append(desc="Average Frequency", units="Hz", value=avg_fps, trunc=True)
self.results.append(desc="Average Runtime", units="ms", value=avg_ms, trunc=True)

def _write_log(self):
if not self.results.empty():
Expand Down

0 comments on commit 43b7509

Please sign in to comment.