There are more AWS SDK examples available in the AWS Doc SDK Examples
Use DeleteFaces
with an AWS SDK or CLI
The following code examples show how to use DeleteFaces
.
For more information, see Deleting faces from a collection.
- AWS SDK for .NET
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository
. using System; using System.Collections.Generic; using System.Threading.Tasks; using Amazon.Rekognition; using Amazon.Rekognition.Model; /// <summary> /// Uses the Amazon Rekognition Service to delete one or more faces from /// a Rekognition collection. /// </summary> public class DeleteFaces { public static async Task Main() { string collectionId = "MyCollection"; var faces = new List<string> { "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }; var rekognitionClient = new AmazonRekognitionClient(); var deleteFacesRequest = new DeleteFacesRequest() { CollectionId = collectionId, FaceIds = faces, }; DeleteFacesResponse deleteFacesResponse = await rekognitionClient.DeleteFacesAsync(deleteFacesRequest); deleteFacesResponse.DeletedFaces.ForEach(face => { Console.WriteLine($"FaceID: {face}"); }); } }
-
For API details, see DeleteFaces in AWS SDK for .NET API Reference.
-