Search in sources :

Example 31 with RekognitionClient

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

the class DetectLabelsS3 method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "   <bucket> <image>\n\n" + "Where:\n" + "   bucket - the name of the Amazon S3 bucket that contains the image (for example, ,ImageBucket)." + "   image - the name of the image located in the Amazon S3 bucket (for example, Lake.png). \n\n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String bucket = args[0];
    String image = args[1];
    Region region = Region.US_EAST_1;
    RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
    getLabelsfromImage(rekClient, bucket, image);
    rekClient.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 32 with RekognitionClient

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

the class CelebrityInfo method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "CelebrityInfo <id>\n\n" + "Where:\n" + "id - the id value of the celebrity. You can use the RecognizeCelebrities example to get the ID value. \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String id = args[0];
    Region region = Region.US_EAST_1;
    RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
    getCelebrityInfo(rekClient, id);
    rekClient.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 33 with RekognitionClient

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

the class DeleteCollection method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "   <collectionId> \n\n" + "Where:\n" + "   collectionId - the id of the collection to delete. \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String collectionId = args[0];
    Region region = Region.US_EAST_1;
    RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
    System.out.println("Deleting collection: " + collectionId);
    deleteMyCollection(rekClient, collectionId);
    rekClient.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient)

Example 34 with RekognitionClient

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

the class DetectCustomLabels method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "DetectLabels <project arn> <S3 bucket> <S3 key>\n\n" + "Where:\n" + "project arn - the arn of the model in Rekognition Custom Labels to the image (for example, arn:aws:rekognition:us-east-1:XXXXXXXXXXXX:project/YOURPROJECT/version/YOURPROJECT.YYYY-MM-DDT00.00.00/1234567890123). \n" + "S3 bucket - the bucket where your image is stored (for example, my-bucket-name \n" + "S3 key - the path of the image inside your bucket (for example, myfolder/pic1.png). \n\n";
    if (args.length != 3) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String arn = args[0];
    String bucket = args[1];
    String key = args[2];
    Region region = Region.US_EAST_1;
    RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
    detectImageCustomLabels(rekClient, arn, bucket, key);
    rekClient.close();
}
Also used : 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