use of com.amazonaws.services.rekognition.model.S3Object in project aws-doc-sdk-examples by awsdocs.
the class VideoDetect method StartFaceSearchCollection.
// Started face collection search in a video by calling StartFaceSearch.
// bucket is the S3 bucket that contains the video.
// video is the video filename.
// Change CollectionId to the ID of the collection that you want to search
private static void StartFaceSearchCollection(String bucket, String video) throws Exception {
StartFaceSearchRequest req = new StartFaceSearchRequest().withCollectionId("CollectionId").withVideo(new Video().withS3Object(new S3Object().withBucket(bucket).withName(video))).withNotificationChannel(channel);
StartFaceSearchResult startPersonCollectionSearchResult = rek.startFaceSearch(req);
startJobId = startPersonCollectionSearchResult.getJobId();
}
use of com.amazonaws.services.rekognition.model.S3Object in project aws-doc-sdk-examples by awsdocs.
the class DetectModerationLabels method main.
public static void main(String[] args) throws Exception {
// Change the values of photo and bucket to your values.
String photo = "input.jpg";
String bucket = "bucket";
AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient();
DetectModerationLabelsRequest request = new DetectModerationLabelsRequest().withImage(new Image().withS3Object(new S3Object().withName(photo).withBucket(bucket))).withMinConfidence(60F);
try {
DetectModerationLabelsResult result = rekognitionClient.detectModerationLabels(request);
List<ModerationLabel> labels = result.getModerationLabels();
System.out.println("Detected labels for " + photo);
for (ModerationLabel label : labels) {
System.out.println("Label: " + label.getName() + "\n Confidence: " + label.getConfidence().toString() + "%" + "\n Parent:" + label.getParentName());
}
} catch (AmazonRekognitionException e) {
e.printStackTrace();
}
}
use of com.amazonaws.services.rekognition.model.S3Object in project aws-doc-sdk-examples by awsdocs.
the class VideoDetect method StartModerationLabels.
// Starts the moderation of content in a video by calling StartContentModeration.
// bucket is the S3 bucket that contains the video.
// video is the video filename.
// ==================================================================
private static void StartModerationLabels(String bucket, String video) throws Exception {
StartContentModerationRequest req = new StartContentModerationRequest().withVideo(new Video().withS3Object(new S3Object().withBucket(bucket).withName(video))).withNotificationChannel(channel);
StartContentModerationResult startModerationLabelDetectionResult = rek.startContentModeration(req);
startJobId = startModerationLabelDetectionResult.getJobId();
}
use of com.amazonaws.services.rekognition.model.S3Object in project aws-doc-sdk-examples by awsdocs.
the class VideoDetect method StartCelebrities.
// Starts the detection of celebrities in a video by calling StartCelebrityRecognition.
// bucket is the S3 bucket that contains the video.
// video is the video filename.
private static void StartCelebrities(String bucket, String video) throws Exception {
StartCelebrityRecognitionRequest req = new StartCelebrityRecognitionRequest().withVideo(new Video().withS3Object(new S3Object().withBucket(bucket).withName(video))).withNotificationChannel(channel);
StartCelebrityRecognitionResult startCelebrityRecognitionResult = rek.startCelebrityRecognition(req);
startJobId = startCelebrityRecognitionResult.getJobId();
}
use of com.amazonaws.services.rekognition.model.S3Object in project aws-doc-sdk-examples by awsdocs.
the class VideoDetect method StartFaces.
// Starts face detection in a stored video by calling StartFaceDetection.
// bucket is the S3 bucket that contains the video.
// video is the video filename.
private static void StartFaces(String bucket, String video) throws Exception {
StartFaceDetectionRequest req = new StartFaceDetectionRequest().withVideo(new Video().withS3Object(new S3Object().withBucket(bucket).withName(video))).withNotificationChannel(channel);
StartFaceDetectionResult startLabelDetectionResult = rek.startFaceDetection(req);
startJobId = startLabelDetectionResult.getJobId();
}
Aggregations