DisassociateFaces で を使用する AWS SDK または CLI - Amazon Rekognition

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

DisassociateFaces で を使用する AWS SDK または CLI

以下のコード例は、DisassociateFaces の使用方法を示しています。

CLI
AWS CLI
aws rekognition disassociate-faces --face-ids list-of-face-ids --user-id user-id --collection-id collection-name --region region-name
  • API 詳細については、DisassociateFaces「」の「」を参照してください 。AWS CLI コマンドリファレンス

Python
SDK for Python (Boto3)
from botocore.exceptions import ClientError import boto3 import logging logger = logging.getLogger(__name__) session = boto3.Session(profile_name='profile-name') client = session.client('rekognition') def disassociate_faces(collection_id, user_id, face_ids): """ Disassociate stored faces within collection to the given user :param collection_id: The ID of the collection where user and faces are stored. :param user_id: The ID of the user that we want to disassociate faces from :param face_ids: The list of face IDs to be disassociated from the given user :return: response of AssociateFaces API """ logger.info(f'Disssociating faces from user: {user_id}, {face_ids}') try: response = client.disassociate_faces( CollectionId=collection_id, UserId=user_id, FaceIds=face_ids ) print(f'- disassociated {len(response["DisassociatedFaces"])} faces') except ClientError: logger.exception("Failed to disassociate faces from the given user") raise else: print(response) return response def main(): face_ids = ["faceId1", "faceId2"] collection_id = "collection-id" user_id = "user-id" disassociate_faces(collection_id, user_id, face_ids) if __name__ == "__main__": main()
  • API 詳細については、DisassociateFaces「」の「」を参照してください 。AWS SDK for Python (Boto3) APIリファレンス

の完全なリストについては、 AWS SDK デベロッパーガイドとコード例については、「」を参照してくださいでの Rekognition の使用 AWS SDK。このトピックには、開始方法に関する情報と以前のSDKバージョンの詳細も含まれています。