microsoft / Cognitive-Face-Android

Cognitive Services Face client library for Android.
https://www.microsoft.com/cognitive-services/en-us/face-api
Other
269 stars 151 forks source link

FaceServiceClient.detect returns faceid = null #58

Closed ugochirico closed 5 years ago

ugochirico commented 5 years ago

I'm using FaceServiceClient.detect to detect a face in a photo containing only one face. For most of the photos it works. But for some photos the function FaceServiceClient.detect returns one Face object but with faceid = null. i.e. it returns a List object with one Face but that Face has faceid = null and I cannot use it later for verification.

this is my code:

faceServiceClient.detect(
                        params[0],  /* Input stream of image to detect */
                        true,       /* Whether to return face ID */
                        false,       /* Whether to return face landmarks */
                        /* Which face attributes to analyze, currently we support:
                           age,gender,headPose,smile,facialHair */
                        null);

Why does that happen? Is there any reason why FaceServiceClient.detect returns a Face with faceid null?

ugochirico commented 5 years ago

The problem was due to obfuscation. By setting the proguard configuration in the right way, all works.