Rekognition / Client / disassociate_faces

disassociate_faces#

Rekognition.Client.disassociate_faces(**kwargs)#

Removes the association between a Face supplied in an array of FaceIds and the User. If the User is not present already, then a ResourceNotFound exception is thrown. If successful, an array of faces that are disassociated from the User is returned. If a given face is already disassociated from the given UserID, it will be ignored and not be returned in the response. If a given face is already associated with a different User or not found in the collection it will be returned as part of UnsuccessfulDisassociations. You can remove 1 - 100 face IDs from a user at one time.

See also: AWS API Documentation

Request Syntax

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

    [REQUIRED]

    The ID of an existing collection containing the UserID.

  • UserId (string) –

    [REQUIRED]

    ID for the existing UserID.

  • ClientRequestToken (string) –

    Idempotent token used to identify the request to DisassociateFaces. If you use the same token with multiple DisassociateFaces requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.

    This field is autopopulated if not provided.

  • FaceIds (list) –

    [REQUIRED]

    An array of face IDs to disassociate from the UserID.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'DisassociatedFaces': [
        {
            'FaceId': 'string'
        },
    ],
    'UnsuccessfulFaceDisassociations': [
        {
            'FaceId': 'string',
            'UserId': 'string',
            'Reasons': [
                'FACE_NOT_FOUND'|'ASSOCIATED_TO_A_DIFFERENT_USER',
            ]
        },
    ],
    'UserStatus': 'ACTIVE'|'UPDATING'|'CREATING'|'CREATED'
}

Response Structure

  • (dict) –

    • DisassociatedFaces (list) –

      An array of DissociatedFace objects containing FaceIds that are successfully disassociated with the UserID is returned. Returned if the DisassociatedFaces action is successful.

      • (dict) –

        Provides face metadata for the faces that are disassociated from a specific UserID.

        • FaceId (string) –

          Unique identifier assigned to the face.

    • UnsuccessfulFaceDisassociations (list) –

      An array of UnsuccessfulDisassociation objects containing FaceIds that are not successfully associated, along with the reasons for the failure to associate. Returned if the DisassociateFaces action is successful.

      • (dict) –

        Contains metadata like FaceId, UserID, and Reasons, for a face that was unsuccessfully disassociated.

        • FaceId (string) –

          A unique identifier assigned to the face.

        • UserId (string) –

          A provided ID for the UserID. Unique within the collection.

        • Reasons (list) –

          The reason why the deletion was unsuccessful.

          • (string) –

    • UserStatus (string) –

      The status of an update made to a User. Reflects if the User has been updated for every requested change.

Exceptions