Search in sources :

Example 1 with NotificationChannel

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

the class VideoCelebrityDetection 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();
    StartCelebrityDetection(rekClient, channel, bucket, video);
    GetCelebrityDetectionResults(rekClient);
    System.out.println("This example is done!");
    rekClient.close();
}
Also used : NotificationChannel(software.amazon.awssdk.services.rekognition.model.NotificationChannel) Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 2 with NotificationChannel

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

the class VideoPersonDetection 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();
    startPersonLabels(rekClient, channel, bucket, video);
    GetPersonDetectionResults(rekClient);
    System.out.println("This example is done!");
    rekClient.close();
}
Also used : NotificationChannel(software.amazon.awssdk.services.rekognition.model.NotificationChannel) Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 3 with NotificationChannel

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

the class VideoDetect method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "   <bucket> <video> <queueUrl> <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 the video (for example, people.mp4). \n\n" + "   queueUrl- the URL of a SQS queue. \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 != 5) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String bucket = args[0];
    String video = args[1];
    String queueUrl = args[2];
    String topicArn = args[3];
    String roleArn = args[4];
    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();
    startLabels(rekClient, channel, bucket, video);
    getLabelJob(rekClient, sqs, queueUrl);
    System.out.println("This example is done!");
    sqs.close();
    rekClient.close();
}
Also used : NotificationChannel(software.amazon.awssdk.services.rekognition.model.NotificationChannel) Region(software.amazon.awssdk.regions.Region) SqsClient(software.amazon.awssdk.services.sqs.SqsClient) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 4 with NotificationChannel

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

the class VideoDetectInappropriate 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();
    startModerationDetection(rekClient, channel, bucket, video);
    GetModResults(rekClient);
    System.out.println("This example is done!");
    rekClient.close();
}
Also used : NotificationChannel(software.amazon.awssdk.services.rekognition.model.NotificationChannel) Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 5 with NotificationChannel

use of software.amazon.awssdk.services.rekognition.model.NotificationChannel 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();
}
Also used : NotificationChannel(software.amazon.awssdk.services.rekognition.model.NotificationChannel) Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Aggregations

Region (software.amazon.awssdk.regions.Region)6 RekognitionClient (software.amazon.awssdk.services.rekognition.RekognitionClient)6 NotificationChannel (software.amazon.awssdk.services.rekognition.model.NotificationChannel)6 SqsClient (software.amazon.awssdk.services.sqs.SqsClient)2