This plug-in will take all the selected photos and upload their thumbnails to Google Vision for analysis. It will then allow you to attach the selected labels and landmarks as keywords to the photo in your Lightroom catalog.
- Download the
dist/robotagger.zip
distribution package - Unzip it to a convenient location; it will show up as folder named
robotagger.lrplugin
- Launch Lightroom
- Select
File
, thenPlug-in Manager...
- Click on the
Add
button under the plug-in list on the left - Navigate to the location where you unzipped the plug-in
- Click on the folder named
robotagger.lrplugin
and click onAdd Plug-in
Be sure to read the following sections for critical dependencies.
- Launch Lightroom
- Select one or more photos (no videos) in any of the catalog views
- Select
File
thenPlug-in Extras...
and finallyTag Photos with Google Vision
- A dialog opens to show the results as they arrive, with actions you can take
Note that it may take several seconds for each photo to be analyzed, so the plug-in issues several requests in parallel. The counter will show how many results are available.
You will need a Google Cloud Platform service account configured to support Google Vision API requests in order to use this plug-in. Instructions can be found here and here. You do not need to create a storage bucket because this plug-in will not store your photos in the cloud.
Once you have set up your service account, you need to download the private key (JSON), and import it into the plug-in:
- Launch Lightroom
- Select
File
, thenPlug-in Manager...
- Select the plug-in from the list on the left
- Click on the
Load Credentials...
button in theGoogle Cloud Credentials
section - Select the JSON file and click on
Choose
- Click on the
Save
button to save the credentials in Lightroom's secure password store
IMPORTANT: DO NOT DELETE YOUR PRIVATE KEY!
Google only retains your public key. This plug-in will store your private key and show it obscured in the UI, but as security measure it will not let you copy it back out.
Google Vision API requires its JSON Web Token requests to be signed with the RSASSA-PKCS1-V1_5-SIGN
algorithm. There were no implementations of that readily available in Lua, and I did not feel like writing one. I simply launch OpenSSL to sign the token request with the private key extracted from the JSON file mentioned above.
You will need OpenSSL installed on your system and available along the PATH. To test that everything is working, check the Versions
section in the Plug-In Manager. It should show the OpenSSL version number, such as OpenSSL 0.9.8zh 14 Jan 2016
.
Adobe Lightroom plug-ins are written in a subset of the Lua language, version 5.1. More information is available here.
Lightroom will run Lua code either directly as source code, or as a compiled bytecode. The repo contains a compiled distribution package. You can re-build that distribution image with rake
, even though that is not necessary. Make sure you're running Lua version 5.1, because Lightroom will reject code compiled with newer versions. On Mac OS X, you can install it with brew
:
$ brew install [email protected]
If you have other versions of Lua installed, you may need to switch to the correct version:
$ brew switch [email protected]
The Rakefile
assumes Lua v5.1 is available as luac5.1
.