Search in sources :

Example 1 with DeleteFacesRequest

use of software.amazon.awssdk.services.rekognition.model.DeleteFacesRequest in project aws-doc-sdk-examples by awsdocs.

the class DeleteFacesFromCollection method deleteFacesCollection.

// snippet-start:[rekognition.java2.delete_faces_collection.main]
public static void deleteFacesCollection(RekognitionClient rekClient, String collectionId, String faceId) {
    try {
        DeleteFacesRequest deleteFacesRequest = DeleteFacesRequest.builder().collectionId(collectionId).faceIds(faceId).build();
        rekClient.deleteFaces(deleteFacesRequest);
        System.out.println("The face was deleted from the collection.");
    } catch (RekognitionException e) {
        System.out.println(e.getMessage());
        System.exit(1);
    }
}
Also used : DeleteFacesRequest(software.amazon.awssdk.services.rekognition.model.DeleteFacesRequest) RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException)

Aggregations

DeleteFacesRequest (software.amazon.awssdk.services.rekognition.model.DeleteFacesRequest)1 RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1