Search in sources :

Example 1 with EyeOpen

use of com.amazonaws.services.rekognition.model.EyeOpen 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);
}
Also used : Beard(com.amazonaws.services.rekognition.model.Beard) MouthOpen(com.amazonaws.services.rekognition.model.MouthOpen) FaceDetail(com.amazonaws.services.rekognition.model.FaceDetail) EyeOpen(com.amazonaws.services.rekognition.model.EyeOpen) Mustache(com.amazonaws.services.rekognition.model.Mustache) BinaryFeature(com.amplifyframework.predictions.models.BinaryFeature) Smile(com.amazonaws.services.rekognition.model.Smile) Eyeglasses(com.amazonaws.services.rekognition.model.Eyeglasses) Sunglasses(com.amazonaws.services.rekognition.model.Sunglasses) Test(org.junit.Test)

Aggregations

Beard (com.amazonaws.services.rekognition.model.Beard)1 EyeOpen (com.amazonaws.services.rekognition.model.EyeOpen)1 Eyeglasses (com.amazonaws.services.rekognition.model.Eyeglasses)1 FaceDetail (com.amazonaws.services.rekognition.model.FaceDetail)1 MouthOpen (com.amazonaws.services.rekognition.model.MouthOpen)1 Mustache (com.amazonaws.services.rekognition.model.Mustache)1 Smile (com.amazonaws.services.rekognition.model.Smile)1 Sunglasses (com.amazonaws.services.rekognition.model.Sunglasses)1 BinaryFeature (com.amplifyframework.predictions.models.BinaryFeature)1 Test (org.junit.Test)1