Skip to content Skip to sidebar Skip to footer

How To Call For "label Detection" And "safe Search Detection" At A Time On Google Cloud Vision Api

I would like to ask you the the following thing about Vision API. The following picture indicates that I can take on 'Free with Label Detection, or $1.50', if I will use 'Label Det

Solution 1:

In case you want to send both types at the same time, you can use the annotate_image() method; in this way, you can specify all the features that need to be included in the same request. Based on this, I recommend you to take a look on this documentation (Doc1, Doc2) to get detailed information about this property usage, as well as this tutorial, that contains a curl command example where is shown the process required to send multiple features within the same call that you can use as an alternative workaround.

import io
import os

from google.cloud import vision

client = vision.ImageAnnotatorClient()

response = client.annotate_image({
  'image': {'source': {'image_uri': '<IMAGE_URI>'}},
  'features': [{'type': vision.enums.Feature.Type.SAFE_SEARCH_DETECTION},
               {'type': vision.enums.Feature.Type.LABEL_DETECTION}]
})

print(response)

Additionally, I think that this pricing information refers that you can use the Safe Search Detection feature for free if you use it with Label Detection; however, the Label Detection requests will be billed with the corresponding charges that are displayed at the Prices document.

Post a Comment for "How To Call For "label Detection" And "safe Search Detection" At A Time On Google Cloud Vision Api"