Search in sources :

Example 6 with RekognitionClient

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

the class DetectLabels 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();
    detectImageLabels(rekClient, sourceImage);
    rekClient.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 7 with RekognitionClient

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

the class DetectModerationLabels 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();
    detectModLabels(rekClient, sourceImage);
    rekClient.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 8 with RekognitionClient

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

the class PPEBoundingBoxFrame method main.

public static void main(String[] args) throws Exception {
    final String USAGE = "\n" + "Usage: " + "DisplayFaces <sourceImage> <bucketName>\n\n" + "Where:\n" + "sourceImage - the name of the image in an Amazon S3 bucket that shows a person wearing a mask (for example, masks.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();
}
Also used : Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient) S3Client(software.amazon.awssdk.services.s3.S3Client)

Example 9 with RekognitionClient

use of software.amazon.awssdk.services.rekognition.RekognitionClient 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 10 with RekognitionClient

use of software.amazon.awssdk.services.rekognition.RekognitionClient 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)

Aggregations

RekognitionClient (software.amazon.awssdk.services.rekognition.RekognitionClient)34 Region (software.amazon.awssdk.regions.Region)32 NotificationChannel (software.amazon.awssdk.services.rekognition.model.NotificationChannel)6 S3Client (software.amazon.awssdk.services.s3.S3Client)3 ArrayList (java.util.ArrayList)2 SqsClient (software.amazon.awssdk.services.sqs.SqsClient)2 List (java.util.List)1 SdkBytes (software.amazon.awssdk.core.SdkBytes)1 software.amazon.awssdk.services.rekognition.model (software.amazon.awssdk.services.rekognition.model)1 DetectProtectiveEquipmentRequest (software.amazon.awssdk.services.rekognition.model.DetectProtectiveEquipmentRequest)1 DetectProtectiveEquipmentResponse (software.amazon.awssdk.services.rekognition.model.DetectProtectiveEquipmentResponse)1 EquipmentDetection (software.amazon.awssdk.services.rekognition.model.EquipmentDetection)1 Image (software.amazon.awssdk.services.rekognition.model.Image)1 ProtectiveEquipmentBodyPart (software.amazon.awssdk.services.rekognition.model.ProtectiveEquipmentBodyPart)1 ProtectiveEquipmentPerson (software.amazon.awssdk.services.rekognition.model.ProtectiveEquipmentPerson)1 ProtectiveEquipmentSummarizationAttributes (software.amazon.awssdk.services.rekognition.model.ProtectiveEquipmentSummarizationAttributes)1 RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1 S3Object (software.amazon.awssdk.services.rekognition.model.S3Object)1