Search code examples
google-translategoogle-cloud-vision

Getting the LABEL_DETECTION results from Google Vision API in another language


More specifically I would like to get the labels in french, so instead of:

  "labelAnnotations": [
    {
      "mid": "/m/019sc",
      "description": "black",
      "score": 0.95744693
    },
    {
      "mid": "/m/07s6nbt",
      "description": "text",
      "score": 0.9175479
    },
    {
      "mid": "/m/01zbnw",
      "description": "screenshot",
      "score": 0.8477094
    }]

I would like to get:

  "labelAnnotations": [
    {
      "mid": "/m/019sc",
      "description": "noir",
      "score": 0.95744693
    },
    {
      "mid": "/m/07s6nbt",
      "description": "texte",
      "score": 0.9175479
    },
    {
      "mid": "/m/01zbnw",
      "description": "capture d'écran",
      "score": 0.8477094
    }]

Or is Google Translate API my only solution currently?


Solution

  • Google Cloud Vision API LABEL_DETECTION are returned in English only. The Cloud Translate API can translate English labels into any of a number of other languages.

    Reference Detect Labels