Skip to content

Commit

Permalink
Catch warnings in detection metric (#1451)
Browse files Browse the repository at this point in the history
  • Loading branch information
matanper committed May 16, 2022
1 parent 5cc5db6 commit 747a4c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions deepchecks/vision/metrics_utils/detection_precision_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ def get_classes_scores_at(self, res: np.ndarray, iou: float = None, area: str =
with warnings.catch_warnings():
warnings.simplefilter(action="ignore", category=RuntimeWarning)
res = np.nanmean(res[:, :, :], axis=0)
if get_mean_val:
return np.nanmean(res[res > -1])
if zeroed_negative:
res = res.clip(min=0)
return res[0][0]
if get_mean_val:
return np.nanmean(res[res > -1])
if zeroed_negative:
res = res.clip(min=0)
return res[0][0]

@abstractmethod
def get_confidences(self, detections) -> List[float]:
Expand Down

0 comments on commit 747a4c0

Please sign in to comment.