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 CreateFaceLivenessSessionRequestRequestTypeDef

create_project#

Creates a new Amazon Rekognition project.

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

# create_project method definition

def create_project(
    self,
    *,
    ProjectName: str,
    Feature: CustomizationFeatureType = ...,  # (1)
    AutoUpdate: ProjectAutoUpdateType = ...,  # (2)
) -> CreateProjectResponseTypeDef:  # (3)
    ...
  1. See CustomizationFeatureType
  2. See ProjectAutoUpdateType
  3. See CreateProjectResponseTypeDef
# create_project method usage example with argument unpacking

kwargs: CreateProjectRequestRequestTypeDef = {  # (1)
    "ProjectName": ...,
}

parent.create_project(**kwargs)
  1. See CreateProjectRequestRequestTypeDef

create_project_version#

Creates a new version of Amazon Rekognition project (like a Custom Labels model or a custom adapter) and begins training.

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

# create_project_version method definition

def create_project_version(
    self,
    *,
    ProjectArn: str,
    VersionName: str,
    OutputConfig: OutputConfigTypeDef,  # (1)
    TrainingData: TrainingDataTypeDef = ...,  # (2)
    TestingData: TestingDataTypeDef = ...,  # (3)
    Tags: Mapping[str, str] = ...,
    KmsKeyId: str = ...,
    VersionDescription: str = ...,
    FeatureConfig: CustomizationFeatureConfigTypeDef = ...,  # (4)
) -> CreateProjectVersionResponseTypeDef:  # (5)
    ...
  1. See OutputConfigTypeDef
  2. See TrainingDataTypeDef
  3. See TestingDataTypeDef
  4. See CustomizationFeatureConfigTypeDef
  5. See CreateProjectVersionResponseTypeDef
# create_project_version method usage example with argument unpacking

kwargs: CreateProjectVersionRequestRequestTypeDef = {  # (1)
    "ProjectArn": ...,
    "VersionName": ...,
    "OutputConfig": ...,
}

parent.create_project_version(**kwargs)
  1. See CreateProjectVersionRequestRequestTypeDef

create_stream_processor#

Creates an Amazon Rekognition stream processor that you can use to detect and recognize faces or to detect labels in a streaming video.

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

# create_stream_processor method definition

def create_stream_processor(
    self,
    *,
    Input: StreamProcessorInputTypeDef,  # (1)
    Output: StreamProcessorOutputTypeDef,  # (2)
    Name: str,
    Settings: StreamProcessorSettingsTypeDef,  # (3)
    RoleArn: str,
    Tags: Mapping[str, str] = ...,
    NotificationChannel: StreamProcessorNotificationChannelTypeDef = ...,  # (4)
    KmsKeyId: str = ...,
    RegionsOfInterest: Sequence[RegionOfInterestTypeDef] = ...,  # (5)
    DataSharingPreference: StreamProcessorDataSharingPreferenceTypeDef = ...,  # (6)
) -> CreateStreamProcessorResponseTypeDef:  # (7)
    ...
  1. See StreamProcessorInputTypeDef
  2. See StreamProcessorOutputTypeDef
  3. See StreamProcessorSettingsTypeDef
  4. See StreamProcessorNotificationChannelTypeDef
  5. See RegionOfInterestTypeDef
  6. See StreamProcessorDataSharingPreferenceTypeDef
  7. See CreateStreamProcessorResponseTypeDef
# create_stream_processor method usage example with argument unpacking

kwargs: CreateStreamProcessorRequestRequestTypeDef = {  # (1)
    "Input": ...,
    "Output": ...,
    "Name": ...,
    "Settings": ...,
    "RoleArn": ...,
}

parent.create_stream_processor(**kwargs)
  1. See CreateStreamProcessorRequestRequestTypeDef

create_user#

Creates a new User within a collection specified by CollectionId.

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

# create_user method definition

def create_user(
    self,
    *,
    CollectionId: str,
    UserId: str,
    ClientRequestToken: str = ...,
) -> Dict[str, Any]:
    ...
# create_user method usage example with argument unpacking

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

parent.create_user(**kwargs)
  1. See CreateUserRequestRequestTypeDef

delete_collection#

Deletes the specified collection.

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

# delete_collection method definition

def delete_collection(
    self,
    *,
    CollectionId: str,
) -> DeleteCollectionResponseTypeDef:  # (1)
    ...
  1. See DeleteCollectionResponseTypeDef
# delete_collection method usage example with argument unpacking

kwargs: DeleteCollectionRequestRequestTypeDef = {  # (1)
    "CollectionId":