This code is originally from: 
https://github.com/pytorch/vision/tree/main/torchvision/models/detection

We made small adaptions in order for the detector to work on probabilities of the bounding boxes, as they are predicted by the pretrained classifier.