Skip to main content

collections

Creates, updates, deletes, gets or lists a collections resource.

Overview

Namecollections
TypeResource
Idaws.rekognition.collections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
collection_arnstringThe Amazon Resource Name (ARN) of the collection.
creation_timestampstring (date-time)The number of milliseconds since the Unix epoch time until the creation of the collection. The Unix epoch time is 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970.
face_countinteger (int64)The number of faces that are indexed into the collection. To index faces into a collection, use IndexFaces.
face_model_versionstringThe version of the face model that's used by the collection for face detection. For more information, see Model versioning in the Amazon Rekognition Developer Guide.
user_countinteger (int64)The number of UserIDs assigned to the specified colleciton.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_collectionselectregionDescribes the specified collection. You can use DescribeCollection to get information, such as the number of faces indexed into a collection and the version of the model used by the collection for face detection. For more information, see Describing a Collection in the Amazon Rekognition Developer Guide.
list_collectionsselectregionReturns list of collection IDs in your account. If the result is truncated, the response also provides a NextToken that you can use in the subsequent request to fetch the next set of collection IDs. For an example, see Listing collections in the Amazon Rekognition Developer Guide. This operation requires permissions to perform the rekognition:ListCollections action.
create_collectioninsertregion, CollectionIdCreates a collection in an AWS Region. You can add faces to the collection using the IndexFaces operation. For example, you might create collections, one for each of your application users. A user can then index faces using the IndexFaces operation and persist results in a specific collection. Then, a user can search the collection for faces in the user-specific container. When you create a collection, it is associated with the latest version of the face model version. Collection names are case-sensitive. This operation requires permissions to perform the rekognition:CreateCollection action. If you want to tag your collection, you also require permission to perform the rekognition:TagResource operation.
delete_collectiondeleteregionDeletes the specified collection. Note that this operation removes all faces in the collection. For an example, see Deleting a collection. This operation requires permissions to perform the rekognition:DeleteCollection action.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Describes the specified collection. You can use DescribeCollection to get information, such as the number of faces indexed into a collection and the version of the model used by the collection for face detection. For more information, see Describing a Collection in the Amazon Rekognition Developer Guide.

SELECT
collection_arn,
creation_timestamp,
face_count,
face_model_version,
user_count
FROM aws.rekognition.collections
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a collection in an AWS Region. You can add faces to the collection using the IndexFaces operation. For example, you might create collections, one for each of your application users. A user can then index faces using the IndexFaces operation and persist results in a specific collection. Then, a user can search the collection for faces in the user-specific container. When you create a collection, it is associated with the latest version of the face model version. Collection names are case-sensitive. This operation requires permissions to perform the rekognition:CreateCollection action. If you want to tag your collection, you also require permission to perform the rekognition:TagResource operation.

INSERT INTO aws.rekognition.collections (
CollectionId,
Tags,
region
)
SELECT
'{{ CollectionId }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
collection_arn,
face_model_version,
status_code
;

DELETE examples

Deletes the specified collection. Note that this operation removes all faces in the collection. For an example, see Deleting a collection. This operation requires permissions to perform the rekognition:DeleteCollection action.

DELETE FROM aws.rekognition.collections
WHERE region = '{{ region }}' --required
;