Rekognition / Client / delete_faces

delete_faces#

Rekognition.Client.delete_faces(**kwargs)#

Deletes faces from a collection. You specify a collection ID and an array of face IDs to remove from the collection.

This operation requires permissions to perform the rekognition:DeleteFaces action.

See also: AWS API Documentation

Request Syntax

response = client.delete_faces(
    CollectionId='string',
    FaceIds=[
        'string',
    ]
)
Parameters:
  • CollectionId (string) –

    [REQUIRED]

    Collection from which to remove the specific faces.

  • FaceIds (list) –

    [REQUIRED]

    An array of face IDs to delete.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'DeletedFaces': [
        'string',
    ]
}

Response Structure

  • (dict) –

    • DeletedFaces (list) –

      An array of strings (face IDs) of the faces that were deleted.

      • (string) –

Exceptions

  • Rekognition.Client.exceptions.InvalidParameterException

  • Rekognition.Client.exceptions.AccessDeniedException

  • Rekognition.Client.exceptions.InternalServerError

  • Rekognition.Client.exceptions.ThrottlingException

  • Rekognition.Client.exceptions.ProvisionedThroughputExceededException

  • Rekognition.Client.exceptions.ResourceNotFoundException

Examples

This operation deletes one or more faces from a Rekognition collection.

response = client.delete_faces(
    CollectionId='myphotos',
    FaceIds=[
        'ff43d742-0c13-5d16-a3e8-03d3f58e980b',
    ],
)

print(response)

Expected Output:

{
    'DeletedFaces': [
        'ff43d742-0c13-5d16-a3e8-03d3f58e980b',
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}