Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Benedikt Mersch <[email protected]>
  • Loading branch information
karthikbolla and benemer authored May 20, 2024
1 parent 828c5e6 commit f1b7182
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions python/kiss_icp/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,11 @@ def _run_evaluation(self):
# Run timing metrics evaluation, always
def _get_fps():
total_time_s = sum(self.times) * 1e-9
if total_time_s == 0:
return 0
else:
return float(len(self.times) / total_time_s)
return float(len(self.times) / total_time_s) if total_time_s > 0 else 0

fps = _get_fps()
if fps == 0:
avg_fps = 0
avg_ms = 0
else:
avg_fps = int(np.ceil(fps))
avg_ms = int(np.ceil(1e3 / fps))
avg_fps = int(np.floor(fps))
avg_ms = int(np.ceil(1e3 / fps)) if fps > 0 else 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)

Expand Down

0 comments on commit f1b7182

Please sign in to comment.