Skip to content

Conversation

gboeer
Copy link

@gboeer gboeer commented Sep 10, 2025

Updated IOU and accuracy calculations to handle division by zero.

Currently, a RuntimeWarning is thrown when performing the category-wise IOU calculation, if the total_area_union or total_area_label for one of the categories is zero.

This can be handled by using the np.divide function, simply returning 0 for all categories where this happens.

Note, that the RuntimeWarning originates from numpy, e.g.:

RuntimeWarning: invalid value encountered in divide iou = total_area_intersect / total_area_union
RuntimeWarning: invalid value encountered in divide acc = total_area_intersect / total_area_label

Updated IOU and accuracy calculations to handle division by zero.

Currently, a RuntimeWarning is thrown when performing the category-wise IOU calculation, if the total_area_union or total_area_label for one of the categories is zero.

This can be handled by using the np.divide function, simply returning 0 for all categories where this happens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant