Creating IoU values from Faster R-CNN output

Hi,
I am a beginner and currently reading Modern Computer Vision with PyTorch and am using their code at: Link. I am training a Faster R-CNN on a dataset with multiple colored cones in an image. There are five classes overall. I have read the Pytorch Object Detection Finetuning Tutorial several times, but still do not understand how to incorporate the IoU Link.

My main issue is trying to get an IoU value on my final output of each image containing each predicted box to let me know how well my predictions are. While I am getting a class score, I feel like this does not really tell me anything. I have read several tutorials on how to create IoU but am unsure how to implement this or obtain this from the code above (Modern Computer Vision).

I am currently getting bounding box values (xmin, ymin, xmax, xmin), labels for each prediction, and scores. Can I use these values to proceed to get the IoU? If so how? Any advice would be much appreciated on how to retrieve IoU values from this code.

Thank you