Zero faces returned from Face API when sending stream

SSB 86 Reputation points
2021-02-27T16:36:44.37+00:00

I'm trying to detect if any faces in a picture using Azure Face Api. I have a Xamarin Forms apps where a picture is taken using the camera and I want to check if there are any faces there.

The picture is taken using the Xamarin Community Toolkit CameraView and i can successfully display that in an Image. The CameraView returns both an Image and a byte[] of the image.

I have checked that the byte[] actually is containing the image by testing as such:

img_selfie.Source = ImageSource.FromStream((() => new MemoryStream(_vm.SelfieImageData)));

However, when i pass that into the Azure Face api, it always returns no faces

var faceClient = new FaceClient(new ApiKeyServiceClientCredentials(key));

faceClient.Endpoint = endpoint;

var faces = await faceClient.Face.DetectWithStreamAsync(new MemoryStream(_vm.SelfieImageData));

Please could you suggest what could be going wrong here?

Thanks!

Azure Face
Azure Face
An Azure service that provides artificial intelligence algorithms that detect, recognize, and analyze human faces in images.
154 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,418 questions
{count} votes