({{, (RefLink[ImageBoundingBoxes, paclet:ref/ImageBoundingBoxes])[image]
gives an association of lists of bounding boxes for each identified category of objects in image.}, {, (RefLink[ImageBoundingBoxes, paclet:ref/ImageBoundingBoxes])[image,category] 
gives a list of bounding boxes for subimages identified as an instance of the specified category.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ImageBoundingBoxes, paclet:ref/ImageBoundingBoxes]) attempts to find instances of an object category present in an image and returns a list of bounding boxes per category given as (RefLink[Rectangle, paclet:ref/Rectangle]) objects.

Coordinates are assumed to be in the standard image coordinate system.

Possible forms for category include:

The following options can be given:

(RefLink[ImageBoundingBoxes, paclet:ref/ImageBoundingBoxes]) uses machine learning, and its training set and methods may change in different versions of the Wolfram Language, yielding different results.

(RefLink[ImageBoundingBoxes, paclet:ref/ImageBoundingBoxes]) may download resources that will be stored in your local object store at (RefLink[$LocalBase, paclet:ref/$LocalBase]), and can be listed using (RefLink[LocalObjects, paclet:ref/LocalObjects])[] and removed using (RefLink[ResourceRemove, paclet:ref/ResourceRemove]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (8)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Find the bounding boxes around identified birds in an image:

i=;

ImageBoundingBoxes[i,(Entity["birds", Entity["Species","Class:Aves"], "Entity[\"Species\", \"Class:Aves\"]", "species specification"])]

Highlight the identified bounding boxes:

HighlightImage[i,%]

OpenersExampleSection1(Spacer1)Scope  (2)

Find a list of bounding boxes for each identified category of objects in an image:

ImageBoundingBoxes[]

Find a list of bounding boxes for the specified object category:

ImageBoundingBoxes[,(Entity["elephants", Entity["Species","Family:Elephantidae"], "Entity[\"Species\", \"Family:Elephantidae\"]", "species specification"])]

OpenersExampleSection2(Spacer1)Options  (4)

OpenersExampleSubsection0(Spacer1)AcceptanceThreshold  (1)

Objects with low probability are not returned:

i=;

ImageBoundingBoxes[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"])]

Allowing a lower probability may result in more objects being recognized:

ImageBoundingBoxes[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"]),AcceptanceThreshold->.2]

HighlightImage[i,{Red,%,Blue,%%}]

OpenersExampleSubsection1(Spacer1)MaxFeatures  (1)

By default, all the detected objects are returned:

i=;

ImageBoundingBoxes[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"])]

Specify a maximum number of results:

ImageBoundingBoxes[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"]),MaxFeatures->2]

OpenersExampleSubsection2(Spacer1)MaxOverlapFraction  (1)

The detected bounding boxes may overlap each other:

i=;

ImageBoundingBoxes[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"])]

HighlightImage[i,%]

Find only non-intersecting objects:

ImageBoundingBoxes[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"]),MaxOverlapFraction->0]

HighlightImage[i,%]

OpenersExampleSubsection3(Spacer1)TargetDevice  (1)

By default, the function is evaluated on CPU:

i=;

ImageBoundingBoxes[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"])]

Use the (RefLink[TargetDevice, paclet:ref/TargetDevice]) option to specify a different device:

ImageBoundingBoxes[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"]),TargetDevice->"GPU"]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

(RefLink[ImageBoundingBoxes, paclet:ref/ImageBoundingBoxes]) is equivalent to (RefLink[ImageCases, paclet:ref/ImageCases])[image, (RefLink[All, paclet:ref/All]) -> "BoundingBox"]:

ImageBoundingBoxes[]

ImageCases[,All->"BoundingBox"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ImagePosition, paclet:ref/ImagePosition])  ▪  (RefLink[ImageCases, paclet:ref/ImageCases])  ▪  (RefLink[HighlightImage, paclet:ref/HighlightImage])  ▪  (RefLink[ImageContainsQ, paclet:ref/ImageContainsQ])  ▪  (RefLink[ImageIdentify, paclet:ref/ImageIdentify])  ▪  (RefLink[BoundingRegion, paclet:ref/BoundingRegion])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Computer Vision, paclet:guide/ComputerVision])}})}})