【问题标题】:Google Vision: How do I choose all types of detectionGoogle Vision:如何选择所有类型的检测
【发布时间】:2018-12-08 16:34:32
【问题描述】:

我正在使用 Google Cloud Vision API,并已在我自己的应用程序中实现了它。现在我只能在 POST 中实现一种“类型”,但我想要不止一种。在 Vision API - Drag and Drop Demo (https://cloud.google.com/vision/docs/drag-and-drop) 中,您可以输出多种类型,我也想这样做。

在阅读 API 的文档后,我认为解决方案是将“类型”设置为“TYPE_UNSPECIFIED”,但在尝试之后我无法得到任何响应。

“type”是一个枚举,我在下面列出了文档:

*// Type: The feature type.
    //
    // Possible values:
    //   "TYPE_UNSPECIFIED" - Unspecified feature type.
    //   "FACE_DETECTION" - Run face detection.
    //   "LANDMARK_DETECTION" - Run landmark detection.
    //   "LOGO_DETECTION" - Run logo detection.
    //   "LABEL_DETECTION" - Run label detection.
    //   "TEXT_DETECTION" - Run text detection / optical character*

我需要帮助来实现多个“类型”.. 有什么想法吗?

【问题讨论】:

    标签: api cloud google-cloud-vision vision


    【解决方案1】:

    来自docs

    features列表中可以指定多个Feature对象。

    因此,要在 POST 请求中实现对 REST API 的 annotate 方法的所有类型,您必须提供 features 列表中的所有类型,如下所示:

    "features": [
            {
              "type": "FACE_DETECTION"
            },
            {
              "type": "LANDMARK_DETECTION"
            },
        ...
          ]
    

    【讨论】:

    • 谢谢!错过了那一行;)
    猜你喜欢
    • 2020-01-09
    • 1970-01-01
    • 2016-10-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 2018-01-26
    • 2020-03-06
    • 1970-01-01
    相关资源
    最近更新 更多