FindFaces
✖
FindFaces
Details and Options




- FindFaces is also known as face detection.
- Face detection is a common computer vision technique that returns detected faces as a list of bounding boxes, each given as a Rectangle object.
- Coordinates {x,y} are assumed to be in the standard image coordinate system.
- The property prop can be any of the following:
-
"BoundingBox" bounding boxes returned as Rectangle objects "BoundingBoxArea" pixel area of each face "Confidence" strength of the detected face "Image" subimages containing each face "Position" the position of each face given as {x,y} feature any feature available in FacialFeatures {prop1,prop2,…} a list of properties - The criterion crit can be any of the following:
-
{min,max} faces of size min through max in pixels {Scaled[amin],Scaled[amax]} faces of relative size amin to amax f faces that satisfy f - When a pure function f is used, facial features such as age and gender can be accessed using #Age and #Gender. A face is returned if f returns True.
- For the complete list of facial features, see the reference page for FacialFeatures.
- The following options can be given:
-
AcceptanceThreshold Automatic detection acceptance threshold MaxFeatures All number of faces to return MaxOverlapFraction Automatic maximum allowed overlap fraction Method Automatic method to use Padding "Fixed" padding scheme to use at image boundaries PaddingSize 0 amount of padding around each detected face PerformanceGoal $PerformanceGoal what to optimize in the detection SortedBy Automatic function to use for sorting the result TargetDevice "CPU" the target device to use - With PaddingSize->x, each detected face is padded by x pixels on each side. Using PaddingSize->Scaled[s], each face is padded by a fraction s of its bounding box.
- If available, faces are padded with image content. At the boundaries, the setting of Padding is used.
- By default, detected faces are sorted based on their strength. Use SortedBy->f to specify a different sorting function. The function f can access available properties using the pattern #prop.
- Possible settings for Method include:
-
"Haar" cascade detector based on Haar features "LocalBinaryPatterns" cascade detector based on LBP features "SingleShotDetector" neural network detector based on SSD architecture {method1,method2,…} aggregates the result of all methodi - For multichannel images, the "Haar" and "LocalBinaryPatterns" methods operate on grayscale intensities.
- FindFaces uses machine learning. Its methods, training sets and biases included therein may change and yield varied results in different versions of the Wolfram Language.
- FindFaces may download resources that will be stored in your local object store at $LocalBase, and that can be listed using LocalObjects[] and removed using ResourceRemove.

Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Find coordinates of faces in an image:

https://wolfram.com/xid/0enx7cr74-r3gf5g

Extract subimages that include faces:

https://wolfram.com/xid/0enx7cr74-5yvmlg

Detect and highlight a face in an image:

https://wolfram.com/xid/0enx7cr74-gismwb


https://wolfram.com/xid/0enx7cr74-7a4i3i

Scope (9)Survey of the scope of standard use cases
Data (2)

https://wolfram.com/xid/0enx7cr74-9se77f


https://wolfram.com/xid/0enx7cr74-gxu40r

Find faces in frames of a video:

https://wolfram.com/xid/0enx7cr74-wf2b8b

Highlight detected faces on the video:

https://wolfram.com/xid/0enx7cr74-un3wli

Properties (4)
Compute the face bounding box:

https://wolfram.com/xid/0enx7cr74-rab0hg


https://wolfram.com/xid/0enx7cr74-5ddwdn

Extract the portion of the image corresponding to the bounding box:

https://wolfram.com/xid/0enx7cr74-48d7ww


https://wolfram.com/xid/0enx7cr74-eu9age

Extract features available in FacialFeatures:

https://wolfram.com/xid/0enx7cr74-pmnn9c

Criteria (3)
Use a computable property as a test argument:

https://wolfram.com/xid/0enx7cr74-zfqut7


https://wolfram.com/xid/0enx7cr74-qvxw24

Some test results can be used as shortcuts for the whole test:

https://wolfram.com/xid/0enx7cr74-ys9mqn


https://wolfram.com/xid/0enx7cr74-05dafx

Specify a maximum face size in pixels:

https://wolfram.com/xid/0enx7cr74-21txhx


https://wolfram.com/xid/0enx7cr74-7m16kb

Specify a minimum face size in pixels:

https://wolfram.com/xid/0enx7cr74-vfn9ib


https://wolfram.com/xid/0enx7cr74-2xqh9h

Use Scaled to specify the face size relative to the image dimensions:

https://wolfram.com/xid/0enx7cr74-2dfqta


https://wolfram.com/xid/0enx7cr74-75qxxc

Options (10)Common values & functionality for each option
AcceptanceThreshold (1)
By default, all the detected faces are returned:

https://wolfram.com/xid/0enx7cr74-2l0fg6

Use AcceptanceThresholdt to return only detections with strength greater than t:

https://wolfram.com/xid/0enx7cr74-ece3sb

Use AcceptanceThreshold0 to return all the detected faces:

https://wolfram.com/xid/0enx7cr74-526n9p

MaxFeatures (1)
By default, all the detected faces are returned:

https://wolfram.com/xid/0enx7cr74-mrg4qb

Use MaxFeaturesn to return only the n strongest detections:

https://wolfram.com/xid/0enx7cr74-bd7w75

MaxOverlapFraction (1)
By default, all the detected faces are returned, regardless of their overlapping:

https://wolfram.com/xid/0enx7cr74-or8h3b

Find only non-overlapping faces:

https://wolfram.com/xid/0enx7cr74-g3gaoo

Allow up to 2 percent of overlap:

https://wolfram.com/xid/0enx7cr74-2r906f

Method (2)
FindFaces automatically picks the detection method:

https://wolfram.com/xid/0enx7cr74-nnkue


https://wolfram.com/xid/0enx7cr74-6zl7bt

Use the combined result from multiple methods:

https://wolfram.com/xid/0enx7cr74-lkf46y

The "LocalBinaryPatterns" method is a cascade classifier that works on a histogram of the gradients (HoG) features. It is a very fast and lightweight multiscale method:

https://wolfram.com/xid/0enx7cr74-vq3ee2

The "Haar" method is a cascade classifier working on Haar features. It is more robust than "LocalBinaryPatterns" but generally slower:

https://wolfram.com/xid/0enx7cr74-6ksjyk

The "SingleShotDetector" method is based on a single neural net evaluation, and it is very stable with respect to variations in pose, illumination, occlusion and subjects. It is slower compared to two other methods:

https://wolfram.com/xid/0enx7cr74-xzeu12

Padding (1)
PaddingSize (2)
FindFaces by default returns a fairly tight crop around each face:

https://wolfram.com/xid/0enx7cr74-qaft97

https://wolfram.com/xid/0enx7cr74-lwj9ta

Specify a padding size to be added around each face:

https://wolfram.com/xid/0enx7cr74-0nfcon

Specify a negative padding to crop more:

https://wolfram.com/xid/0enx7cr74-cd4m37


https://wolfram.com/xid/0enx7cr74-qm3kv

Compare detected faces using different paddings:

https://wolfram.com/xid/0enx7cr74-fa22ko

https://wolfram.com/xid/0enx7cr74-ky1a63

PerformanceGoal (1)
Use PerformanceGoal"Quality" to emphasize the quality of the result:

https://wolfram.com/xid/0enx7cr74-xq68sg

https://wolfram.com/xid/0enx7cr74-x7g1mo

Use PerformanceGoal"Speed" to emphasize the speed of computation:

https://wolfram.com/xid/0enx7cr74-36wjtx

Applications (3)Sample problems that can be solved with this function
Find and highlight detected faces:

https://wolfram.com/xid/0enx7cr74-155hsz

https://wolfram.com/xid/0enx7cr74-25k6ba

Find and blur all detected faces:

https://wolfram.com/xid/0enx7cr74-w7gseq


https://wolfram.com/xid/0enx7cr74-phqjkl

Find the number of faces in each video frame:

https://wolfram.com/xid/0enx7cr74-5te8we

https://wolfram.com/xid/0enx7cr74-4dojby


https://wolfram.com/xid/0enx7cr74-lpcitl

https://wolfram.com/xid/0enx7cr74-e250nu

Properties & Relations (2)Properties of the function, and connections to other functions
Possible Issues (3)Common pitfalls and unexpected behavior
Upright faces are usually better detected:

https://wolfram.com/xid/0enx7cr74-j22gmj

Other faces may be detected when rotating the image:

https://wolfram.com/xid/0enx7cr74-dofwhg

Faces turned away from the camera may not be detected:

https://wolfram.com/xid/0enx7cr74-ujmdbd

Very small or low resolution faces may not be detected:

https://wolfram.com/xid/0enx7cr74-ba992h

https://wolfram.com/xid/0enx7cr74-nj3qjt

Resampling the image may improve the detection:

https://wolfram.com/xid/0enx7cr74-4wkfev

Wolfram Research (2012), FindFaces, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFaces.html (updated 2025).
Text
Wolfram Research (2012), FindFaces, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFaces.html (updated 2025).
Wolfram Research (2012), FindFaces, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFaces.html (updated 2025).
CMS
Wolfram Language. 2012. "FindFaces." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/FindFaces.html.
Wolfram Language. 2012. "FindFaces." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/FindFaces.html.
APA
Wolfram Language. (2012). FindFaces. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindFaces.html
Wolfram Language. (2012). FindFaces. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindFaces.html
BibTeX
@misc{reference.wolfram_2025_findfaces, author="Wolfram Research", title="{FindFaces}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/FindFaces.html}", note=[Accessed: 11-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_findfaces, organization={Wolfram Research}, title={FindFaces}, year={2025}, url={https://reference.wolfram.com/language/ref/FindFaces.html}, note=[Accessed: 11-July-2025
]}