What is Bounding Box
Bounding Box - The rectangle that marks where an object sits in an image or page
A bounding box is the smallest axis-aligned rectangle that encloses an object in an image, a video frame or a document page. It is stored as two corners (x1, y1, x2, y2) or as one corner plus width and height, in pixels or as fractions of the image size. Object detectors, face detectors and document layout models all return bounding boxes, and search systems use them to crop, highlight or filter what was found.
Formats
- Corners: (x_min, y_min, x_max, y_max), used by Pascal VOC and most detection libraries
- COCO: (x, y, width, height) from the top-left corner
- YOLO: (x_center, y_center, width, height), each divided by the image size so values run from 0 to 1
- Rotated boxes add an angle, used for text lines and aerial images
- Converting between formats is the most common source of boxes that land in the wrong place
Intersection over Union (IoU)
IoU measures how well a predicted box matches a labeled one: the area where they overlap divided by the area they cover together. A predicted box of 100 × 100 pixels shifted 20 pixels right of an identical labeled box overlaps 80 × 100 = 8,000 pixels out of a union of 12,000, so IoU = 0.67. Detection benchmarks count a prediction as correct above a threshold, commonly 0.5; see mean average precision.
Bounding Boxes in Mixpeek
- The face identity extractor stores a `bbox` (x1, y1, x2, y2, width, height) and a detection score with every face it finds in images and video
- The document extractor stores a `bbox` for every layout block of a PDF page (paragraph, table, figure, form) and can render a thumbnail cropped to it
- Search results carry these boxes, so an application can highlight the matched face or passage instead of showing the whole frame or page
Common Pitfalls
- Mixing coordinate formats or origins between a model and the code that draws the boxes
- Forgetting to rescale boxes after resizing or cropping an image
- Using axis-aligned boxes for long rotated objects, which then cover mostly background
- Reporting detection accuracy without the IoU threshold it was measured at
Put multimodal search to work
Connect a bucket and Mixpeek runs the whole multimodal search pipeline for you: extraction, indexing, and search over your own objects. No models to wire up, nothing to host.
Start with ManagedAlready have vectors?
Keep your embeddings on your own cloud and run dense, sparse, and BM25 search directly on object storage. From $25/mo.
Start with MVS