collections
Creates, updates, deletes, gets or lists a collections resource.
Overview
| Name | collections |
| Type | Resource |
| Id | aws.rekognition.collections |
Fields
The following fields are returned by SELECT queries:
- describe_collection
- list_collections
| Name | Datatype | Description |
|---|---|---|
collection_arn | string | The Amazon Resource Name (ARN) of the collection. |
creation_timestamp | string (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_count | integer (int64) | The number of faces that are indexed into the collection. To index faces into a collection, use IndexFaces. |
face_model_version | string | The 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_count | integer (int64) | The number of UserIDs assigned to the specified colleciton. |
| Name | Datatype | Description |
|---|---|---|
collection_id | string | An array of collection IDs. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_collection | select | region | 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. | |
list_collections | select | region | Returns 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_collection | insert | region, CollectionId | 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. | |
delete_collection | delete | region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_collection
- list_collections
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
;
Returns 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.
SELECT
collection_id
FROM aws.rekognition.collections
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_collection
- Manifest
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
;
# Description fields are for documentation purposes
- name: collections
props:
- name: region
value: "{{ region }}"
description: Required parameter for the collections resource.
- name: CollectionId
value: "{{ CollectionId }}"
description: |
ID for the collection that you are creating.
- name: Tags
value: "{{ Tags }}"
description: |
A set of tags (key-value pairs) that you want to attach to the collection.
DELETE examples
- delete_collection
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
;