#--- # Setup #--- Assuming you have been through setting up: cd ext-cli/ ./get-selfcontained-python3.sh Then to setup this extension then all you need to do is: pip install --upgrade google-cloud-vision To enable the Google Vision API, set up a key etc, see: https://cloud.google.com/vision/docs/setup When you create a key, your browsesr downloads a JSON version of the key. #--- # Using the Extension #--- The extension provides the GoogleVisionImagePlugin, for use in collections. Small workaround needed if checked out in the GS3 extension area: export GSDL3EXTS=$GSDL3EXTS:structured-image Example use of the plugin: The plugin currently has a hard-wired filename for the Google service key. This need's to be in the collection's 'etc' directory as follows: etc/my-google-service-account-key.json For the 'atea-storage' Google Cloud Project, for example, a redacted version of the JSON key file looks like: { "type": "service_account", "project_id": "atea-storage", "private_key_id": "7bc843de4257da515193eaa5b60468fcab5b3948", "private_key": "-----BEGIN PRIVATE KEY-----\n???????.........??????=\n-----END PRIVATE KEY-----\n", "client_email": "service-account@atea-storage.iam.gserviceaccount.com", "client_id": "123???...????", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service-account%40atea-storage.iam.gserviceaccount.com" } ========= Deprecated #==== # Getting the extension #==== Assuming you are in the Greenstone3 top-level (i.e. GSDL3SRCHOME) directory, (if not already done so) this extension can be checked out as follows: svn co https://svn.greenstone.org/gs3-extensions/structured-image/trunk ext/structured-image Note that the plugin this extension introduces makes use of a Google Service Account and requires credentials. For more details, visit: https://cloud.google.com/vision/docs/setup. #==== # Compiling the extension #==== #-<> # #-- cd ext/structured-image ./CREATE-VENV-PYTHON3.sh cd ../.. ln -s ext/structured-image/SETUP-TOP-LEVEL.sh SETUP.sh ln -s ext/structured-image/DEVEL-TOP-LEVEL.sh DEVEL.sh # If your python does not already have Google Cloud Vision source ./SETUP.sh pip install --upgrade google-cloud-vision #-- # #