You can use the DescribeCollection operation to get the following information about a collection:
-
The number of faces that are indexed into the collection.
-
The version of the model being used with the collection. For more information, see Understanding model versioning.
-
The Amazon Resource Name (ARN) of the collection.
-
The creation date and time of the collection.
To describe a collection (SDK)
-
If you haven't already:
-
Create or update a user with
AmazonRekognitionFullAccess
permissions. For more information, see Step 1: Set up an AWS account and create a User. -
Install and configure the AWS CLI and the AWS SDKs. For more information, see Step 2: Set up the AWS CLI and AWS SDKs.
-
-
Use the following examples to call the
DescribeCollection
operation.This example describes a collection.
Change the value
collectionId
to the ID of the desired collection.//Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. //PDX-License-Identifier: MIT-0 (For details, see https://github.com/awsdocs/amazon-rekognition-developer-guide/blob/master/LICENSE-SAMPLECODE.) package com.amazonaws.samples; import com.amazonaws.services.rekognition.AmazonRekognition; import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder; import com.amazonaws.services.rekognition.model.DescribeCollectionRequest; import com.amazonaws.services.rekognition.model.DescribeCollectionResult; public class DescribeCollection { public static void main(String[] args) throws Exception { String collectionId = "CollectionID"; AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient(); System.out.println("Describing collection: " + collectionId ); DescribeCollectionRequest request = new DescribeCollectionRequest() .withCollectionId(collectionId); DescribeCollectionResult describeCollectionResult = rekognitionClient.describeCollection(request); System.out.println("Collection Arn : " + describeCollectionResult.getCollectionARN()); System.out.println("Face count : " + describeCollectionResult.getFaceCount().toString()); System.out.println("Face model version : " + describeCollectionResult.getFaceModelVersion()); System.out.println("Created : " + describeCollectionResult.getCreationTimestamp().toString()); } }
DescribeCollection operation
request
The input to DescribeCollection
is the ID of the desired collection,
as shown in the following JSON example.
{
"CollectionId": "MyCollection"
}
DescribeCollection
operation response
The response includes:
-
The number of faces that are indexed into the collection,
FaceCount
. -
The version of the face model being used with the collection,
FaceModelVersion
. For more information, see Understanding model versioning. -
The collection Amazon Resource Name,
CollectionARN
. -
The creation time and date of the collection,
CreationTimestamp
. The value ofCreationTimestamp
is 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. For more information, see Unix Time.
{
"CollectionARN": "arn:aws:rekognition:us-east-1:nnnnnnnnnnnn:collection/MyCollection",
"CreationTimestamp": 1.533422155042E9,
"FaceCount": 200,
"UserCount" : 20,
"FaceModelVersion": "1.0"
}