# Intersection over Union

This is one method of determining if the YOLO algorithm (or any other bounding box generating algorithm) is doing well.

Consider the image below. The red box is the actual bounding box and the blue one is the bounding box generated by an algorithm.

![](https://3668624528-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-0RGo4dZhdwCIHrC1%2F-M5-0TEuN77zAmTpQjIr%2F-M5-0WUJQTsz7KHvnvDv%2FIntersection%20over%20Union.JPG?generation=1586990829445420\&alt=media)

We calculate the IoU (Intersection over Union) as $$\frac{size \,of \,intersection}{size \,of \,union}$$ and an algorithm is generally said to be doing well enough if IoU >= 0.5.
