use of com.amazonaws.services.rekognition.model.S3Object in project aws-doc-sdk-examples by awsdocs.
the class VideoDetect method StartPersons.
// Starts the tracking of people in a video by calling StartPersonTracking
// bucket is the S3 bucket that contains the video.
// video is the video filename.
private static void StartPersons(String bucket, String video) throws Exception {
int maxResults = 10;
String paginationToken = null;
StartPersonTrackingRequest req = new StartPersonTrackingRequest().withVideo(new Video().withS3Object(new S3Object().withBucket(bucket).withName(video))).withNotificationChannel(channel);
StartPersonTrackingResult startPersonDetectionResult = rek.startPersonTracking(req);
startJobId = startPersonDetectionResult.getJobId();
}
use of com.amazonaws.services.rekognition.model.S3Object in project aws-doc-sdk-examples by awsdocs.
the class VideoDetect method StartLabels.
// Starts label detection by calling StartLabelDetection.
// bucket is the S3 bucket that contains the video.
// video is the video filename.
private static void StartLabels(String bucket, String video) throws Exception {
StartLabelDetectionRequest req = new StartLabelDetectionRequest().withVideo(new Video().withS3Object(new S3Object().withBucket(bucket).withName(video))).withMinConfidence(50F).withJobTag("DetectingLabels").withNotificationChannel(channel);
StartLabelDetectionResult startLabelDetectionResult = rek.startLabelDetection(req);
startJobId = startLabelDetectionResult.getJobId();
}
use of com.amazonaws.services.rekognition.model.S3Object in project aws-doc-sdk-examples by awsdocs.
the class AddFacesToCollection method main.
public static void main(String[] args) throws Exception {
AmazonRekognition rekognitionClient = AmazonRekognitionClientBuilder.defaultClient();
Image image = new Image().withS3Object(new S3Object().withBucket(bucket).withName(photo));
IndexFacesRequest indexFacesRequest = new IndexFacesRequest().withImage(image).withQualityFilter(QualityFilter.AUTO).withMaxFaces(1).withCollectionId(collectionId).withExternalImageId(photo).withDetectionAttributes("DEFAULT");
IndexFacesResult indexFacesResult = rekognitionClient.indexFaces(indexFacesRequest);
System.out.println("Results for " + photo);
System.out.println("Faces indexed:");
List<FaceRecord> faceRecords = indexFacesResult.getFaceRecords();
for (FaceRecord faceRecord : faceRecords) {
System.out.println(" Face ID: " + faceRecord.getFace().getFaceId());
System.out.println(" Location:" + faceRecord.getFaceDetail().getBoundingBox().toString());
}
List<UnindexedFace> unindexedFaces = indexFacesResult.getUnindexedFaces();
System.out.println("Faces not indexed:");
for (UnindexedFace unindexedFace : unindexedFaces) {
System.out.println(" Location:" + unindexedFace.getFaceDetail().getBoundingBox().toString());
System.out.println(" Reasons:");
for (String reason : unindexedFace.getReasons()) {
System.out.println(" " + reason);
}
}
}
Aggregations