Skip to content

Commit

Permalink
Fix TPs analog to commit 94544b5 (nutonomy#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
holger-motional authored Feb 21, 2019
1 parent 4e7d179 commit 9e53e7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python-sdk/nuscenes/eval/nuscenes_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,14 @@ def cummean(x):

for metric_name in {key: [] for key in self.metric_names}:
# If no box was predicted for this class, no raw metrics exist and we set secondary metrics to 1.
# Likewise if all predicted boxes are false positives.
metric_vals = raw_metrics[metric_name]
if len(metric_vals) == 0:
if len(metric_vals) == 0 or all(np.isnan(metric_vals)):
tp_metrics[metric_name] = 1
continue

# Normalize and clip metric errors.
metric_bound = self.metric_bounds[metric_name]
assert np.nanmin(metric_vals) >= 0
metric_vals = np.array(metric_vals) / metric_bound # Normalize.
metric_vals = np.minimum(1, metric_vals) # Clip.

Expand Down

0 comments on commit 9e53e7d

Please sign in to comment.