Skip to content

Label Detection Activity

The Label Detection activity identifies and extracts information about entities within an image across various categories. It can detect general objects, locations, activities, animal species, and products, among others.

Field Description Requirement
Api key Google Cloud Vision API Key Required
Image path/url Google Cloud Storage URL of the image Optional
Base64 Base64 encoded string of the image file Optional
Response variable name Name of the variable to store the HTTP response Required

Action Types & Examples

Activity Output

  • Format: string (JSON)
  • Example Result: {"responses": [{"labelAnnotations": [{"mid": "/m/01bqvp", "description": "Sky", "score": 0.98, "topicality": 0.98}, {"mid": "/m/0csby", "description": "Cloud", "score": 0.97, "topicality": 0.97}]}]}

Implementation Examples

Field Setup

  • Api key: bb3c53c6-8515-4e34-97c8-8281de60972d
  • Image path/url: gs://cloud-samples-data/vision/ocr/sampleimage.jpg
  • Base64: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUF.../58x/8BX+R/9k=
  • Response variable name: getResponse

Execution Parameters

  • To use an image from Google Cloud Storage:
    • Image path/url: gs://cloud-samples-data/vision/ocr/sampleimage.jpg
    • Base64: null
  • To use a Base64 encoded image string:
    • Image path/url: null
    • Base64: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUF.../58x/8BX+R/9k=

Technical Notes

You must configure either the Image path/url or the Base64 field for the activity to execute successfully. Detailed information and documentation about Google Cloud Vision detect labels features can be found here.