use of com.amazonaws.services.rekognition.model.FaceDetail in project amplify-android by aws-amplify.
the class RekognitionResultTransformersTest method testFaceDetailConversion.
/**
* Tests that the individual attributes from Rekognition
* face detail are properly converted to a list of binary
* features that are compatible with Amplify's entity
* details.
*/
@Test
public void testFaceDetailConversion() {
FaceDetail faceDetail = new FaceDetail().withBeard(new Beard().withValue(random.nextBoolean()).withConfidence(random.nextFloat())).withSunglasses(new Sunglasses().withValue(random.nextBoolean()).withConfidence(random.nextFloat())).withSmile(new Smile().withValue(random.nextBoolean()).withConfidence(random.nextFloat())).withEyeglasses(new Eyeglasses().withValue(random.nextBoolean()).withConfidence(random.nextFloat())).withMustache(new Mustache().withValue(random.nextBoolean()).withConfidence(random.nextFloat())).withMouthOpen(new MouthOpen().withValue(random.nextBoolean()).withConfidence(random.nextFloat())).withEyesOpen(new EyeOpen().withValue(random.nextBoolean()).withConfidence(random.nextFloat()));
List<BinaryFeature> features = RekognitionResultTransformers.fromFaceDetail(faceDetail);
FeatureAssert.assertMatches(Arrays.asList(faceDetail.getBeard().getValue(), faceDetail.getSunglasses().getValue(), faceDetail.getSmile().getValue(), faceDetail.getEyeglasses().getValue(), faceDetail.getMustache().getValue(), faceDetail.getMouthOpen().getValue(), faceDetail.getEyesOpen().getValue()), features);
}
Aggregations