Detect Labels, Faces, and Landmarks in Images with the Cloud Vision API | Qwiklabs

The Cloud Vision API lets you understand the content of an image by encapsulating powerful machine learning models in a simple REST API.

In this lab, we will send images to the Vision API and see it detect objects, faces, and landmarks.

What you'll learn

What you'll need

Create an API Key

Since you'll be using curl to send a request to the Vision API, you'll need to generate an API key to pass in your request URL.

  1. To create an API key, navigate to APIs & Services > Credentials in your Cloud console:

https://cdn.qwiklabs.com/gKXW0dOf4CjxRQvqyeMPx7RzwYjvHJw3kolFap4rI2Y%3D

  1. Click Create credentials and select API key.

https://cdn.qwiklabs.com/eHce11mfAlx01W6e0WnhzLWXRZXq0duS6ZZi2EsCr7g%3D

  1. Next, copy the key you just generated and click Close.

Now save it to an environment variable to avoid having to insert the value of your API key in each request.

Run the following in Cloud Shell, replacing <your_api_key> with the key you just copied:

export API_KEY=<YOUR_API_KEY>

Upload an Image to a Cloud Storage bucket