Zero faces returned from Face API when sending stream
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!