use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class SearchFaceMatchingIdCollection method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <collectionId> <sourceImage>\n\n" + "Where:\n" + " collectionId - the id of the collection. \n" + " sourceImage - the path to the image (for example, C:\\AWS\\pic1.png). \n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String collectionId = args[0];
String faceId = args[1];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
System.out.println("Searching for a face in a collections");
searchFacebyId(rekClient, collectionId, faceId);
rekClient.close();
}
use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class VideoDetectFaces method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <bucket> <video> <topicArn> <roleArn>\n\n" + "Where:\n" + " bucket - the name of the bucket in which the video is located (for example, (for example, myBucket). \n\n" + " video - the name of video (for example, people.mp4). \n\n" + " topicArn - the ARN of the Amazon Simple Notification Service (Amazon SNS) topic. \n\n" + " roleArn - the ARN of the AWS Identity and Access Management (IAM) role to use. \n\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String bucket = args[0];
String video = args[1];
String topicArn = args[2];
String roleArn = args[3];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
NotificationChannel channel = NotificationChannel.builder().snsTopicArn(topicArn).roleArn(roleArn).build();
StartFaceDetection(rekClient, channel, bucket, video);
GetFaceResults(rekClient);
System.out.println("This example is done!");
rekClient.close();
}
use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class VideoDetectSegment method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <bucket> <video> <topicArn> <roleArn>\n\n" + "Where:\n" + " bucket - the name of the bucket in which the video is located (for example, (for example, myBucket). \n\n" + " video - the name of video (for example, people.mp4). \n\n" + " topicArn - the ARN of the Amazon Simple Notification Service (Amazon SNS) topic. \n\n" + " roleArn - the ARN of the AWS Identity and Access Management (IAM) role to use. \n\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String bucket = args[0];
String video = args[1];
String topicArn = args[2];
String roleArn = args[3];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
SqsClient sqs = SqsClient.builder().region(Region.US_EAST_1).build();
NotificationChannel channel = NotificationChannel.builder().snsTopicArn(topicArn).roleArn(roleArn).build();
StartSegmentDetection(rekClient, channel, bucket, video);
getSegmentResults(rekClient);
System.out.println("This example is done!");
sqs.close();
rekClient.close();
}
use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class AddFacesToCollection method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <collectionId> <sourceImage>\n\n" + "Where:\n" + " collectionName - the name of the collection.\n" + " sourceImage - the path to the image (for example, C:\\AWS\\pic1.png). \n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String collectionId = args[0];
String sourceImage = args[1];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
addToCollection(rekClient, collectionId, sourceImage);
rekClient.close();
}
use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteFacesFromCollection method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <collectionId> <faceId> \n\n" + "Where:\n" + " collectionId - the id of the collection from which faces are deleted. \n\n" + " faceId - the id of the face to delete. \n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String collectionId = args[0];
String faceId = args[1];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
System.out.println("Deleting collection: " + collectionId);
deleteFacesCollection(rekClient, collectionId, faceId);
rekClient.close();
}
Aggregations