Spring GCP Cloud Vision Sample Application
This code sample shows how the Spring Cloud GCP integrations can simplify the use of Google Cloud Vision APIs.
Running the sample
Create a Google Cloud Platform project with billing enabled, if you don’t have one already.
Enable the Google Cloud Vision API from the "APIs & Services" menu of the Google Cloud Console.
Authenticate in one of two ways:
$ mvn spring-boot:runcommand from the same directory as this sample’s
Go to http://localhost:8080 in your browser, paste a URL to an image and press the
You will see a readable version of the Google Cloud Vision API response, which contains the words that Google Cloud Vision attributed to your image, as well as a percentage of certainty.
In this case, by using the Spring Cloud GCP Core Boot starter, you can inject a
CredentialsProvider object which you can pass to our API to provide the correct Google credentials.
You don’t need to set any environment variables for authentication to work.