【问题标题】:Face detection model returns empty dict (Google Cloud Video Intelligence)人脸检测模型返回空字典(Google Cloud Video Intelligence)
【发布时间】:2020-10-21 17:58:41
【问题描述】:

我在使用 Google Video Intelligence API 的人脸检测模型时遇到问题。

我正在使用Python 3.6.5google-cloud-videointelligence==1.15.0

有时我会收到来自人脸检测模型的错误响应。我通过使用google.protobuf.json_format.MessageToDict() 将其转换为字典来解析来自API 的响应。我预计会发生以下两种行为之一:

A.如果视频中出现人脸,我希望结果在键 'FaceDetectionAnnotations' 下,并采用字典的形式;外部字典的键是“段号”(整数),内部字典看起来像这样:

{'coordinates': {'left': 0.3432,
   'top': 0.075,
   'right': 0.6667,
   'bottom': 0.7435},
  'labels': {'confidence': 1.0,
   'attributes': [{'name': 'glasses', 'confidence': 0.041921083},
    {'name': 'headwear', 'confidence': 0.10601594},
    {'name': 'eyes_visible', 'confidence': 0.9976739},
    {'name': 'mouth_open', 'confidence': 0.005100015},
    {'name': 'looking_at_camera', 'confidence': 0.9647807},
    {'name': 'smiling', 'confidence': 0.017670842}]}}

B.如果视频中出现面孔,我希望结果中的任何地方都没有这样的'FaceDetectionAnnotations' 键。

但是,偶尔我会看到第三种响应,其中'FaceDetectionAnnotations' 出现在结果中(表明人脸检测模型确实检测到人脸),但是每个内部字典完全是空的。每个段仍然有一个内部字典,但它们不包含任何常见信息,例如段的开始和结束时间,或任何坐标或置信度值。

我只在有面孔的视频中看到这个问题

我可以确认此问题存在于 Google VI 的原始响应中(在使用 MessageToDict() 函数解析之前,我不确定是什么原因造成的。下面是一个示例视频的链接表现出这个问题。

https://drive.google.com/file/d/1gsbe20iWp6lD9dH0PNvxvvQFUeB5F_cz/view?usp=sharing

如果有人以前见过这样的事情,或者知道如何解决这个问题,我将不胜感激。

【问题讨论】:

    标签: video-intelligence-api


    【解决方案1】:

    目前,有一个关于您关注的未解决问题,here。有工程团队正在研究它,您可以按照上面链接的线程跟踪它的进度。

    【讨论】:

    • 感谢您告诉我。我会密切关注线程。
    • @Dylan,如果您认为这些信息有用,请考虑接受和投票。
    猜你喜欢
    • 2021-09-04
    • 2018-10-09
    • 2016-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-30
    相关资源
    最近更新 更多