【问题标题】:Azure Cognitive Face throws NullReferenceException [duplicate]Azure Cognitive Face 引发 NullReferenceException [重复]
【发布时间】:2019-03-23 19:08:16
【问题描述】:

我正在尝试制作一个 Xamarin 应用程序,该应用程序将识别相机拍摄的照片上的面孔。不知何故,这部分代码抛出了 NullReferenceException

using (Stream imageFileStream = new MemoryStream(a))
{
    imageFileStream.Position = 0;
    var result = await faceServiceClient.DetectAsync(imageFileStream);

    if (result != null)
        await BlobStorageService.SaveBlockBlob("photos", a, Entry1.Text);
}

其中“a”是图片的一个字节[]

我想知道如何解决这个问题?

【问题讨论】:

  • Exeption.SystemStack 显示异常在 var 结果内...
  • 您确定faceServiceClient 不为空吗?
  • 为了扩展@G.hakim 提到的内容,您能展示一下您是如何创建faceServiceClient 的吗?

标签: c# azure xamarin microsoft-cognitive


【解决方案1】:

我认为微软停止支持 Project Oxford(或类似的东西),所以我改用 Azure.Cognitive.Vision.Face :\

【讨论】:

    猜你喜欢
    • 2020-06-07
    • 1970-01-01
    • 2017-12-21
    • 1970-01-01
    • 1970-01-01
    • 2017-08-16
    • 2020-02-14
    • 2019-04-10
    • 1970-01-01
    相关资源
    最近更新 更多