source: gs3-extensions/structured-image/trunk/README.txt@ 37112

Last change on this file since 37112 was 37112, checked in by davidb, 16 months ago

Range of updates: main one being to run INSTALL-JS.sh in 'src' to install the Javascript file document_extra.js

File size: 1.7 KB
Line 
1
2#---
3# Setup
4#---
5
6Assuming you have been through setting up:
7
8 cd ext-cli/
9 ./get-selfcontained-python3.sh
10
11Then to setup this extension then all you need to do is:
12
13 pip install --upgrade google-cloud-vision
14
15To enable the Google Vision API, set up a key etc, see:
16
17 https://cloud.google.com/vision/docs/setup
18
19
20When you create a key, your browsesr downloads a JSON version of the key.
21
22
23Also check:
24
25 src/README.txt
26
27and follow its instructions.
28
29
30#---
31# Using the Extension
32#---
33
34The extension provides the GoogleVisionImagePlugin, for use in collections.
35
36Example use of the plugin:
37
38 <plugin name="GoogleVisionImagePlugin">
39 <option name="-enable_document_ocr"/>
40 <option name="-enable_image_labelling"/>
41 </plugin>
42
43The plugin currently has a hard-wired filename for the Google
44service key. This need's to be in the collection's 'etc'
45directory as follows:
46
47 etc/my-google-service-account-key.json
48
49
50For the 'atea-storage' Google Cloud Project, for example, a redacted version of
51the JSON key file looks like:
52
53{
54 "type": "service_account",
55 "project_id": "atea-storage",
56 "private_key_id": "7bc843de4257da515193eaa5b60468fcab5b3948",
57 "private_key": "-----BEGIN PRIVATE KEY-----\n???????.........??????=\n-----END PRIVATE KEY-----\n",
58 "client_email": "[email protected]",
59 "client_id": "123???...????",
60 "auth_uri": "https://accounts.google.com/o/oauth2/auth",
61 "token_uri": "https://oauth2.googleapis.com/token",
62 "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
63 "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service-account%40atea-storage.iam.gserviceaccount.com"
64}
65
66
Note: See TracBrowser for help on using the repository browser.