A bounding box is a rectangle that locates a detected object within an image or video. Object detection uses boxes alongside object labels and confidence scores. section 4.2
A detection result commonly provides:
- scores: confidence values for detected objects section 4.2.1
- labels: indices mapped through model.config.id2label section 4.2.1
- boxes: coordinates used to draw rectangles on the original image section 4.2.1
Draw detections with DETR
Process an image with facebook/detr-resnet-50, post-process predictions with the image target size and a 0.9 threshold, then draw each returned box with ImageDraw.rectangle(). Add the mapped label near the rectangle. section 4.2.1 section 6.2.1
Figure 4.9 The bounding box for each detected object is drawn on the original image.
View an annotated image with a bounding box drawn around every detected object. section 4.2.1







