FaceDetection

Runs face detection on the file(s) associated with an IDOL document FlowFile, and adds information about any detected faces to the IDOL document.

After detecting a face, the processor can run face recognition and clothing analysis. Clothing analysis returns a region containing the clothing on a person's upper body, and a region containing the clothing on a person's lower body. It also analyzes the color of the clothing in each of these regions.

Properties

Name Default Value Description
IDOL License Service   An IdolLicenseServiceImpl that provides a way to communicate with an IDOL License Server.
Media Service   A MediaServiceImpl that manages media analysis resources.
Video Sample Interval 100 The interval between video frames that are selected to be analyzed, in milliseconds.
Any Orientation false A Boolean value that specifies whether to detect faces in any orientation, rather than just upright.
Clothing false A Boolean value that specifies whether to run clothing analysis.
Portrait Faces Only false A Boolean value that specifies whether to detect faces looking at the camera (true), or looking in any direction (false).
Minimum Face Size 48 The minimum size of a face. NiFi Ingest does not attempt to detect faces that are smaller than the specified size. Increasing the minimum size can increase processing speed.
Minimum Face Size Unit pixels The units for "Minimum Face Size". You can use pixels or a percentage of the smallest image dimension (width or height).
Recognition Results 0 The maximum number of recognition results to return per face.
Recognition Threshold 50 The minimum confidence score required to recognize a face.
Database File   The path of a file that contains a face recognition database. Set this property to use a database that you exported from Media Server, using the action ExportFaceDatabase.
Shared Database   The name of the database to use for face recognition. Set this property to use a database that is stored in the external database specified by the Media Service (see the "Media Service" property).
Aligned Face Image Height   When set to a non-zero value, for example "300", the processor saves a JPEG image of the detected face. The image is rotated so that the face is upright and is cropped around the person's head.
Image Output Format   When set, the processor saves the full image or best video frame for each detected face, in the specified format (BMP, GIF, JPEG, PDF, PNG, PPM, TIFF or WEBP).
Video Clip Quality   When set to "low", "medium", or "high", the processor saves a video clip of the detected face at the specified quality level.
Video Clip Height 300 The height of the video clip that is generated when you set Video Clip Quality, in pixels.

Relationships

Name Description
success Processing was successful.
failure Processing failed.

Example Output

The following examples show the metadata that is added to an IDOL document by face detection.

The XML contains a face element for each detected face.

  • The region element describes the region in which the face was detected.

    The left, top, width, and height attributes provide the position and size of the region in pixels (left specifies the distance from the left side of the image to the left side of the region, and top specifies the distance from the top of the image to the top of the region).

    When you analyze an image or document the page attribute specifies the page on which the face was detected. When you analyze a video and a face is tracked across multiple frames, there can be multiple region elements with start and duration attributes that provide video timestamps, in seconds.

    The region element includes the following further elements:

    • angle - describes the orientation of the face in the image or video, for example if the face is upright the angle is 0 and if the face is upside-down the angle is 180.
    • verticalAngle - indicates how far the person is looking up or down.
    • viewAngle - indicates how far the person is looking to the left or right.
    • eye - describes the position and radius of the person's eyes.
  • The identity element describes the identity and confidence score for a recognized face. There can be multiple identities for each detected face, depending on the value you choose for the Recognition Results property.
  • The clothing element is present if you run clothing analysis. This element can contain information about clothing worn on the upper body (the upper element) and the lower body (the lower element). The upper and lower elements contain further elements:

    • color - describes the color of the clothing (as a name, and as RGB values), and the proportion of the clothing that is the specified color (as a percentage).
    • region - the location of the clothing in the image or video frame. Results from a video can include multiple regions, each with a start time and duration (in seconds) for which the region is valid.
  • The bestRegion element represents the best video frame in which the face was visible. It includes the region element for that frame, but can also include:

    • alignedFile - The path of the image that was generated when you set the property Aligned Face Image Height.
    • imageFile - The path of the image that was generated when you set the property Image Output Format.
  • The videoFile element contains the path of the video file that is generated when you set the property Video Clip Quality.