ImageContainsQ[image,category]
returns True if an instance of the specified category is detected in image.
ImageContainsQ[image,{category1,category2,…}]
returns True if at least one instance of each of the categoryi is detected in image.
ImageContainsQ[image,category1|category2|…]
returns True if image contains an instance of at least one of categoryi.
ImageContainsQ[video,…]
returns a time series of Boolean values for every frame of video.
ImageContainsQ
ImageContainsQ[image,category]
returns True if an instance of the specified category is detected in image.
ImageContainsQ[image,{category1,category2,…}]
returns True if at least one instance of each of the categoryi is detected in image.
ImageContainsQ[image,category1|category2|…]
returns True if image contains an instance of at least one of categoryi.
ImageContainsQ[video,…]
returns a time series of Boolean values for every frame of video.
Details and Options
- ImageContainsQ tries to find subimages of image that may be an instance of a given category.
- Possible forms for category include:
-
"concept" named concept, as used in "Concept" entities "word" English word, as used in WordData wordspec word sense specification, as used in WordData Entity[…] any appropriate entity category1|category2|… any of the categoryi - The following options can be given:
-
AcceptanceThreshold Automatic identification acceptance threshold MaxOverlapFraction Automatic maximum bounding box overlap TargetDevice "CPU" the target device on which to compute - ImageContainsQ uses machine learning. Its methods, training sets and biases included therein may change and yield varied results in different versions of the Wolfram Language.
- ImageContainsQ may download resources that will be stored in your local object store at $LocalBase, and can be listed using LocalObjects[] and removed using ResourceRemove.
Examples
open all close allBasic Examples (2)
Check whether an image contains a specific category of objects:
i = [image];This image contains at least a bird:
ImageContainsQ[i, Entity["Concept", "Bird::56ny3"]]The image does not contain dogs:
ImageContainsQ[i, Entity["Concept", "CanisFamiliaris::597qc"]]Test for the simultaneous presence of multiple categories:
ImageContainsQ[[image], {Entity["Species", "Infraspecies:CanisLupusFamiliaris"], Entity["Species", "Species:FelisCatus"]}]Scope (5)
Data (2)
Test whether an image contains an instance of a particular object:
i = [image];ImageContainsQ[i, Entity["Concept", "Auto::p735c"]]ImageContainsQ[i, Entity["Concept", "Person::93r37"]]Test which frames in a video contain an instance of an object:
ImageContainsQ[\!\(\*VideoBox[""]\), Entity["Concept", "Auto::p735c"]]Counts[Values[%]]Categories (3)
Test of whether an image contains an instance of a particular object:
ImageContainsQ[[image], Entity["Species", "Family:Elephantidae"]]ImageContainsQ[[image], Entity["Species", "Species:GiraffaCamelopardalis"]]Test of whether an image contains an instance of all the specified objects:
ImageContainsQ[[image], {Entity["Species", "Family:Elephantidae"], Entity["Species", "Species:EquusZebra"]}]ImageContainsQ[[image], {Entity["Species", "Family:Elephantidae"], Entity["Species", "Species:GiraffaCamelopardalis"]}]Test of whether an image contains an instance of any of the specified objects:
ImageContainsQ[[image], Entity["Species", "Family:Elephantidae"] | Entity["Species", "Species:GiraffaCamelopardalis"]]Options (2)
AcceptanceThreshold (1)
Using the default AcceptanceThreshold, an object may not be identified:
ImageContainsQ[i = [image], Entity["Concept", "Fork::9hxp6"]]Specify a higher threshold to return results with higher confidence:
ImageContainsQ[i, Entity["Concept", "Fork::9hxp6"], AcceptanceThreshold -> .99]TargetDevice (1)
By default, the function is evaluated on CPU:
i = [image];ImageContainsQ[i, Entity["Concept", "Spoon::4v83p"]]//AbsoluteTimingUse the TargetDevice option to specify a different device:
ImageContainsQ[i, Entity["Concept", "Spoon::4v83p"], TargetDevice -> "GPU"]//AbsoluteTimingRelated Guides
Text
Wolfram Research (2019), ImageContainsQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageContainsQ.html (updated 2025).
CMS
Wolfram Language. 2019. "ImageContainsQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/ImageContainsQ.html.
APA
Wolfram Language. (2019). ImageContainsQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageContainsQ.html
BibTeX
@misc{reference.wolfram_2026_imagecontainsq, author="Wolfram Research", title="{ImageContainsQ}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ImageContainsQ.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_imagecontainsq, organization={Wolfram Research}, title={ImageContainsQ}, year={2025}, url={https://reference.wolfram.com/language/ref/ImageContainsQ.html}, note=[Accessed: 12-June-2026]}