Google视觉:我如何选择所有类型的检测

Google Vision: How do I choose all types of detection

我正在玩 Google Cloud Vision API 并在我自己的应用程序中实现了它。现在我只能在 POST 中实现一个 "type",但我想拥有多个。在 Vision API - 拖放演示 (https://cloud.google.com/vision/docs/drag-and-drop) 中,您可以输出多种类型,我也想这样做。

阅读 API 的文档后,我认为解决方案是将 "type" 设置为 "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*

我需要帮助来实施多个 "type".. 有什么想法吗?

来自 docs

Multiple Feature objects can be specified in the features list.

因此,要在对 REST annotate 方法的 POST 请求中实现所有类型 API,您必须在 features 中提供所有类型像这样列出:

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