attempts to find human faces in image and returns a list of bounding boxes.


returns the specified property prop for each detected face.


finds faces that satisfy the criterion crit.

Details and Options

  • FindFaces 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
    "Image"subimages containing each face
    "Position"the position of each face given as {x,y}
    "Strength"strength of the detected face
    featureany 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
    ffaces 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:
  • AcceptanceThresholdAutomaticdetection acceptance threshold
    MaxFeaturesAllnumber of faces to return
    MaxOverlapFractionAutomaticmaximum allowed overlap fraction
    MethodAutomaticmethod to use
    PerformanceGoal$PerformanceGoalwhat to optimize in the detection
    SortedByAutomaticfunction to use for sorting the result
  • 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
  • For multichannel images, FindFaces operates on grayscale intensities.
  • FindFaces uses machine learning, and its training set and methods may change in different versions of the Wolfram Language, yielding different results.


open all close all

Basic Examples  (2)

Find coordinates of faces in an image:

Click for copyable input

Extract subimages that include faces:

Click for copyable input

Detect and highlight a face in an image:

Click for copyable input
Click for copyable input

Scope  (7)

Options  (2)

Applications  (2)

Properties & Relations  (2)

Possible Issues  (3)

Introduced in 2012
Updated in 2019