Google Cloud Vision - Start Annotate Images Operation

Prerequisites

Usage

StartGcpVisionAnnotateImagesOperation is designed to trigger image annotation operations. This processor should be used in pair with the GetGcpVisionAnnotateImagesOperationStatus Processor. Outgoing FlowFiles contain the raw response to the request returned by the Vision server. The response is in JSON format and contains the result and additional metadata as written in the Google Vision API Reference documents.

Payload

The JSON Payload is a request in JSON format as documented in the Google Vision REST API reference document. Payload can be fed to the processor via the JSON Payload property or as a FlowFile content. The property has higher precedence over FlowFile content. Please make sure to delete the default value of the property if you want to use FlowFile content payload. A JSON payload template example:

{
	"requests": [{
		"image": {
			"source": {
				"imageUri": "gs://${gcs.bucket}/${filename}"
			}
		},
		"features": [{
			"type": "${vision-feature-type}",
			"maxResults": 4
		}]
	}],
	"outputConfig": {
		"gcsDestination": {
			"uri": "gs://${output-bucket}/${filename}/"
		},
		"batchSize": 2
	}
}
    

Features types

You can find more details at Google Vision Feature List

Example: How to setup a simple Annotate Image Flow

Prerequisites

Create the following flow

Execution steps: