Photo Album Example
Disclaimer: This is not an official Google product.
This is an example application demonstrating how Vision API and Translation API can be used to create a photo album application which automatically add appropriate tags to uploaded photos with various languages.
Products
Language
APIs
Prerequisites
- A Google Cloud Platform Account
- A new Google Cloud Platform Project for this lab with billing enabled (You can choose the region for App Engine deployment with advanced options.)
- Enable the Cloud Vision API and Cloud Translation API from the API Manager
Do this first
In this section you will start your Google Cloud Shell and clone the application code repository to it.
-
Click the Google Cloud Shell icon in the top-right and wait for your shell to open:
- Clone the lab repository in your cloud shell, then
cd
into that dir:
$ git clone https://github.com/GoogleCloudPlatform/appengine-photoalbum-example.git
Cloning into 'appengine-photoalbum-example'...
...
$ cd appengine-photoalbum-example
Customize the language used for tag names
Open 'app.yaml' with a text editor and replace the language code to your favorite one from the supported languages.
You can replace the timezone code used for timestamps, too.
env_variables:
LANG_TAG: 'it' <-- change to your favorite language code.
TIMESTAMP_TZ: 'Europe/Rome' <-- change to your favorite timezone code.
Deploy the application
$ pip install -r requirements.txt -t lib
$ gcloud beta app create
$ gcloud datastore create-indexes index.yaml
$ gcloud app deploy
By executing these commands on the Cloud Shell, the project id is automatically applied to the application and the application URL will be https://<project id>.appspot.com.
You can see Datastore's index creation status from the Cloud Console. Once indexes have been created successfully, you can start using the application.
Clean up
Clean up is really easy, but also super important: if you don't follow these instructions, you will continue to be billed for the project you created.
To clean up, navigate to the Google Developers Console Project List, choose the project you created for this lab, and delete it. That's it.