use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class VideoDetectText 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();
startTextLabels(rekClient, channel, bucket, video);
GetTextResults(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 DetectFaces method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <sourceImage>\n\n" + "Where:\n" + " sourceImage - the path to the image (for example, C:\\AWS\\pic1.png). \n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String sourceImage = args[0];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
detectFacesinImage(rekClient, sourceImage);
rekClient.close();
}
use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class DetectPPE method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <sourceImage> <bucketName>\n\n" + "Where:\n" + " sourceImage - the name of the image in an Amazon S3 bucket (for example, people.png). \n\n" + " bucketName - the name of the Amazon S3 bucket (for example, myBucket). \n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String sourceImage = args[0];
String bucketName = args[1];
Region region = Region.US_EAST_1;
S3Client s3 = S3Client.builder().region(region).build();
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
displayGear(s3, rekClient, sourceImage, bucketName);
s3.close();
rekClient.close();
System.out.println("This example is done!");
}
use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class CompareFaces method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <pathSource> <pathTarget>\n\n" + "Where:\n" + " pathSource - the path to the source image (for example, C:\\AWS\\pic1.png). \n " + " pathTarget - the path to the target image (for example, C:\\AWS\\pic2.png). \n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
Float similarityThreshold = 70F;
String sourceImage = args[0];
String targetImage = args[1];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
compareTwoFaces(rekClient, similarityThreshold, sourceImage, targetImage);
rekClient.close();
}
use of software.amazon.awssdk.services.rekognition.RekognitionClient in project aws-doc-sdk-examples by awsdocs.
the class CreateStreamProcessor method main.
public static void main(String[] args) {
final String usage = "\n" + "Usage: " + " <role> <kinInputStream> <kinOutputStream> <collectionName> <StreamProcessorName>\n\n" + "Where:\n" + " role - the ARN of the AWS Identity and Access Management (IAM) role to use. \n\n" + " kinInputStream - the ARN of the Kinesis video stream. \n\n" + " kinOutputStream - the ARN of the Kinesis data stream. \n\n" + " collectionName - the name of the collection to use that contains content. \n\n" + " StreamProcessorName - the name of the Stream Processor. \n\n";
if (args.length != 5) {
System.out.println(usage);
System.exit(1);
}
String role = args[0];
String kinInputStream = args[1];
String kinOutputStream = args[2];
String collectionName = args[3];
String StreamProcessorName = args[4];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
processCollection(rekClient, StreamProcessorName, kinInputStream, kinOutputStream, collectionName, role);
startSpecificStreamProcessor(rekClient, StreamProcessorName);
listStreamProcessors(rekClient);
describeStreamProcessor(rekClient, StreamProcessorName);
deleteSpecificStreamProcessor(rekClient, StreamProcessorName);
}
Aggregations