Skip to content

RekognitionClient#

Index > Rekognition > RekognitionClient

Auto-generated documentation for Rekognition type annotations stubs module mypy-boto3-rekognition.

RekognitionClient#

Type annotations and code completion for boto3.client("rekognition"). boto3 documentation

# RekognitionClient usage example

from boto3.session import Session
from mypy_boto3_rekognition.client import RekognitionClient

def get_rekognition_client() -> RekognitionClient:
    return Session().client("rekognition")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("rekognition").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("rekognition")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.ClientError,
    client.exceptions.ConflictException,
    client.exceptions.HumanLoopQuotaExceededException,
    client.exceptions.IdempotentParameterMismatchException,
    client.exceptions.ImageTooLargeException,
    client.exceptions.InternalServerError,
    client.exceptions.InvalidImageFormatException,
    client.exceptions.InvalidManifestException,
    client.exceptions.InvalidPaginationTokenException,
    client.exceptions.InvalidParameterException,
    client.exceptions.InvalidPolicyRevisionIdException,
    client.exceptions.InvalidS3ObjectException,
    client.exceptions.LimitExceededException,
    client.exceptions.MalformedPolicyDocumentException,
    client.exceptions.ProvisionedThroughputExceededException,
    client.exceptions.ResourceAlreadyExistsException,
    client.exceptions.ResourceInUseException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ResourceNotReadyException,
    client.exceptions.ServiceQuotaExceededException,
    client.exceptions.SessionNotFoundException,
    client.exceptions.ThrottlingException,
    client.exceptions.VideoTooLargeException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_rekognition.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

associate_faces#

Associates one or more faces with an existing UserID.

Type annotations and code completion for boto3.client("rekognition").associate_faces method. boto3 documentation

# associate_faces method definition

def associate_faces(
    self,
    *,
    CollectionId: str,
    UserId: str,
    FaceIds: Sequence[str],
    UserMatchThreshold: float = ...,
    ClientRequestToken: str = ...,
) -> AssociateFacesResponseTypeDef:  # (1)
    ...
  1. See AssociateFacesResponseTypeDef
# associate_faces method usage example with argument unpacking

kwargs: AssociateFacesRequestRequestTypeDef = {  # (1)
    "CollectionId": ...,
    "UserId": ...,
    "FaceIds": ...,
}

parent.associate_faces(**kwargs)
  1. See AssociateFacesRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("rekognition").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("rekognition").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

compare_faces#

Compares a face in the source input image with each of the 100 largest faces detected in the target input image.

Type annotations and code completion for boto3.client("rekognition").compare_faces method. boto3 documentation

# compare_faces method definition

def compare_faces(
    self,
    *,
    SourceImage: ImageTypeDef,  # (1)
    TargetImage: ImageTypeDef,  # (1)
    SimilarityThreshold: float = ...,
    QualityFilter: QualityFilterType = ...,  # (3)
) -> CompareFacesResponseTypeDef:  # (4)
    ...
  1. See ImageTypeDef
  2. See ImageTypeDef
  3. See QualityFilterType
  4. See CompareFacesResponseTypeDef
# compare_faces method usage example with argument unpacking

kwargs: CompareFacesRequestRequestTypeDef = {  # (1)
    "SourceImage": ...,
    "TargetImage": ...,
}

parent.compare_faces(**kwargs)
  1. See CompareFacesRequestRequestTypeDef

copy_project_version#

.

Type annotations and code completion for boto3.client("rekognition").copy_project_version method. boto3 documentation

# copy_project_version method definition

def copy_project_version(
    self,
    *,
    SourceProjectArn: str,
    SourceProjectVersionArn: str,
    DestinationProjectArn: str,
    VersionName: str,
    OutputConfig: OutputConfigTypeDef,  # (1)
    Tags: Mapping[str, str] = ...,
    KmsKeyId: str = ...,
) -> CopyProjectVersionResponseTypeDef:  # (2)
    ...
  1. See OutputConfigTypeDef
  2. See CopyProjectVersionResponseTypeDef
# copy_project_version method usage example with argument unpacking

kwargs: CopyProjectVersionRequestRequestTypeDef = {  # (1)
    "SourceProjectArn": ...,
    "SourceProjectVersionArn": ...,
    "DestinationProjectArn": ...,
    "VersionName": ...,
    "OutputConfig": ...,
}

parent.copy_project_version(**kwargs)
  1. See CopyProjectVersionRequestRequestTypeDef

create_collection#

Creates a collection in an AWS Region.

Type annotations and code completion for boto3.client("rekognition").create_collection method. boto3 documentation

# create_collection method definition

def create_collection(
    self,
    *,
    CollectionId: str,
    Tags: Mapping[str, str] = ...,
) -> CreateCollectionResponseTypeDef:  # (1)
    ...
  1. See CreateCollectionResponseTypeDef
# create_collection method usage example with argument unpacking

kwargs: CreateCollectionRequestRequestTypeDef = {  # (1)
    "CollectionId": ...,
}

parent.create_collection(**kwargs)
  1. See CreateCollectionRequestRequestTypeDef

create_dataset#

.

Type annotations and code completion for boto3.client("rekognition").create_dataset method. boto3 documentation

# create_dataset method definition

def create_dataset(
    self,
    *,
    DatasetType: DatasetTypeType,  # (1)
    ProjectArn: str,
    DatasetSource: DatasetSourceTypeDef = ...,  # (2)
) -> CreateDatasetResponseTypeDef:  # (3)
    ...
  1. See DatasetTypeType
  2. See DatasetSourceTypeDef
  3. See CreateDatasetResponseTypeDef
# create_dataset method usage example with argument unpacking

kwargs: CreateDatasetRequestRequestTypeDef = {  # (1)
    "DatasetType": ...,
    "ProjectArn": ...,
}

parent.create_dataset(**kwargs)
  1. See CreateDatasetRequestRequestTypeDef

create_face_liveness_session#

This API operation initiates a Face Liveness session.

Type annotations and code completion for boto3.client("rekognition").create_face_liveness_session method. boto3 documentation

# create_face_liveness_session method definition

def create_face_liveness_session(
    self,
    *,
    KmsKeyId: str = ...,
    Settings: CreateFaceLivenessSessionRequestSettingsTypeDef = ...,  # (1)
    ClientRequestToken: str = ...,
) -> CreateFaceLivenessSessionResponseTypeDef:  # (2)
    ...
  1. See CreateFaceLivenessSessionRequestSettingsTypeDef
  2. See CreateFaceLivenessSessionResponseTypeDef
# create_face_liveness_session method usage example with argument unpacking

kwargs: CreateFaceLivenessSessionRequestRequestTypeDef = {  # (1)
    "KmsKeyId": ...,
}

parent.create_face_liveness_session(**kwargs)
  1. See