Google Vision API

This plugin sends your images to Google's Cloud Vision API on upload, and sets appropriate metadata in pre-configured fields based on what's been recognised in the image.

The plugin can be found under the 'Asset processing' category. The Google Vision plugin is available by default if you have a support contract with ResourceSpace. Upon signing up, you'll be allocated 10,000 calls - equivalent to 10,000 resources which will be processed on upload. Should you ever use up your free quota, there is a bolt-on available, which provides an additional 50,000 Google Vision API calls.

Plugin Configuration

If this plugin is enabled at initial setup then only the API key is required and default metadata fields are used to store suggested tags, location information and extracted text. Once ResourceSpace is installed the plugin options page allows the following options to be configured:-

Google API key You must add the application API key and ensure you have set up a Google billing account - see the Google Vision API quick start guide for more information
Field for suggested tags Select the metadata field that will store tags suggested by Google Vision. This should be a dynamic tag list.
Field for landmarks Select the metadata field that will store landmark information suggested by Google Vision. This should be a text field
Field for extracted text Select the metadata field that will store extracted text. This should be a Text box.
Field for detected popular logos Select the metadata field that will store the brand names for any detected popular logos (e.g. Microsoft, Apple, etc.)
Enabled resource types Select the resource types that will be processed by Google Vision
Enabled feature detection Select the feature detection options you require
Automatically set the title to the highest ranking tag Set to TRUE if you want to automatically populate the resource title field

Facial detection

Field to store face detection data in (optional) Select a field to enable and store face detection data (must be a large text multi-line text field)
Select a metadata field that will be hidden when facial recognition data field is empty (optional) This can be useful if you want to force users to update a field e.g. 'people in photo' should faces be detected
Please note: as Google Vision processing utilises low resolution preview files enabling this will override settings that normally prevent preview generation at upload e.g. $enable_thumbnail_creation_on_upload and $offline_job_queue
If storing face data, detect full faces and not just skin area See this link for more information
Store verbose face detection data (includes all face data, locations of facial features and emotion detection information) Facial recognition produces a lot of data that you may not require. Set to TRUE if you want to store ALL the data returned from the Google Vision API

Google Vision can also leverage AI automated tagging of your existing assets (in addition to new uploads).

Process existing collection resources

Google Vision plugin has a script which allows processing of existing resources that have not been previously processed.

To do this, all the administrator needs to do is run the script (once in the [webroot]/plugins/google_vision/pages) specifying the ID of the collection(s) using the "c" or "collection" options. Examples for collection #82 and #1:

php process_existing.php -c82 # short option
php process_existing.php --collection=82 # long option
php process_existing.php -c82 -c1 # multiple collections which works in both short and long option

Multilingual translation of keywords

The Google Vision API only returns English keywords. However, the separate translation API can be used to translate these to other languages. Ensure the Translation API is enabled in the Google console.

With a valid API entered and the translation API enabled you must then enter at least one language code. Multiple codes can be entered and keywords for different languages will be automatically retrieved.

Google Vision Translation 1

You can optionally choose to keep the original English keywords, or replace those with the translated keywords.

Google Vision Translation 2

These options can be different for certain user groups by using user group level configuration, for example one group could have the following in the group's config override:


...whereas another group could have different settings: