Java Code Examples for software.amazon.awssdk.regions.Region#US_EAST_2

The following examples show how to use software.amazon.awssdk.regions.Region#US_EAST_2 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeleteAlarm.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE =
                "To run this example, supply an alarm name\n" +
                        "Ex: DeleteAlarm <alarm-name>\n";

        if (args.length != 1) {
            System.out.println(USAGE);
            System.exit(1);
        }

        String alarmName = args[0];
        Region region = Region.US_EAST_2;
        CloudWatchClient cw = CloudWatchClient.builder()
                .region(region)
                .build();

        deleteCWAlarm(cw, alarmName) ;
    }
 
Example 2
Source File: DetectFaces.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "DetectFaces - how to detect faces in an image\n\n" +
                "Usage: DetectFaces <path>\n\n" +
                "Where:\n" +
                "path - the path to the image (ie, 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_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        detectFacesinImage(rekClient, sourceImage );
    }
 
Example 3
Source File: CelebrityInfo.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "CelebrityInfo - how to get information about a detected celebrity\n\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_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        // Get celebrity information
        getCelebrityInfo(rekClient, id);
    }
 
Example 4
Source File: DetectLabels.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "DetectLabels - how to capture labels within an image\n\n" +
                "Usage: DetectLabels <path>\n\n" +
                "Where:\n" +
                "path - the path to the image (i.e., 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_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        detectImageLabels(rekClient, sourceImage );
    }
 
Example 5
Source File: CreateCollection.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "CreateCollection - creates a collection\n\n" +
                "Usage: CreateCollection <collectionName> \n\n" +
                "Where:\n" +
                "  collectionName - the name of the collection \n\n";

        if (args.length < 1) {
            System.out.println(USAGE);
            System.exit(1);
        }

        String collectionId = args[0];

        Region region = Region.US_EAST_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        System.out.println("Creating collection: " +
                collectionId);

        createMyCollection(rekClient, collectionId );
    }
 
Example 6
Source File: DetectModerationLabels.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "DetectModerationLabels - detects unsafe content in an image\n\n" +
                "Usage: DetectModerationLabels <path>\n\n" +
                "Where:\n" +
                "path - the path to the image (i.e., 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_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        detectModLabels(rekClient, sourceImage);
    }
 
Example 7
Source File: AddFacesToCollection.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "AddFacesToCollection - add faces to a collection\n\n" +
                "Usage: AddFacesToCollection <collectionName><path>\n\n" +
                "Where:\n" +
                "  collectionName - the name of the collection \n" +
                "  path - the path to the image (i.e., 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_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        // Add the image to the collection
        addToCollection(rekClient, collectionId, sourceImage);
    }
 
Example 8
Source File: ListFacesInCollection.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "ListFacesInCollection - how to capture faces within a collection of images\n\n" +
                "Usage: ListFacesInCollection <collectionId>\n\n" +
                "Where:\n" +
                "collectionId - the name of the collection) \n\n";

        if (args.length < 1) {
            System.out.println(USAGE);
            System.exit(1);
        }

        // Read the collection ID value
        String collectionId = args[0];

        Region region = Region.US_EAST_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        System.out.println("Faces in collection " + collectionId);
        listFacesCollection(rekClient, collectionId) ;
    }
 
Example 9
Source File: RecognizeCelebrities.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "RecognizeCelebrities -  recognize celebrities in a given image\n\n" +
                "Usage: RecognizeCelebrities <path>\n\n" +
                "Where:\n" +
                "path - the path to the image (i.e., 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_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        System.out.println("Locating celebrities in " + sourceImage);
        recognizeAllCelebrities(rekClient, sourceImage);
    }
 
Example 10
Source File: DeleteCollection.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "DeleteCollection - deletes a collection\n\n" +
                "Usage: DeleteCollection <collectionName> \n\n" +
                "Where:\n" +
                "  collectionName - the name of the collection \n\n";

        if (args.length < 1) {
            System.out.println(USAGE);
            System.exit(1);
        }

        String collectionId = args[0];

        Region region = Region.US_EAST_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        System.out.println("Deleting collection: " +
                collectionId);

        deleteMyCollection(rekClient, collectionId);
    }
 
Example 11
Source File: CompareFaces.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "CompareFaces - how to compare two faces in two images\n\n" +
                "Usage: CompareFaces <pathSource> <pathTarget>\n\n" +
                "Where:\n" +
                "pathSource - the path to the source image (i.e., C:\\AWS\\pic1.png) \n " +
                "pathTarget - the path to the target image (i.e., C:\\AWS\\pic2.png) \n\n";

        Float similarityThreshold = 70F;
        String sourceImage = args[0];
        String targetImage = args[1];

        Region region = Region.US_EAST_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        compareTwoFaces(rekClient, similarityThreshold, sourceImage, targetImage);
   }
 
Example 12
Source File: SearchFaceMatchingImageCollection.java    From aws-doc-sdk-examples with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {

        final String USAGE = "\n" +
                "SearchFaceMatchingImageCollection - searches for matching faces in a collection\n\n" +
                "Usage: SearchFaceMatchingImageCollection <collectionName><path>\n\n" +
                "Where:\n" +
                "  collectionName - the name of the collection  \n" +
                "  path - the path to the image (i.e., 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_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        System.out.println("Searching for a face in a collection");
        searchFaceInCollection(rekClient, collectionId, sourceImage ) ;
    }
 
Example 13
Source File: ListCollections.java    From aws-doc-sdk-examples with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {

        Region region = Region.US_EAST_2;
        RekognitionClient rekClient = RekognitionClient.builder()
                .region(region)
                .build();

        System.out.println("Listing collections");
        listAllCollections(rekClient);
    }