Label detection

In the previous code snippet, we used the face_detection method to fetch the various coordinates.

In order to understand the label of the image, we will be using the label_detection method in place of face_detection, as follows:

response_label = client.label_detection({'source' : {'image_uri': "gs://kish-bucket/11.jpg"},})

The output of label detection is a collection of labels, along with the scores associated with each label.

Get Hands-On Machine Learning on Google Cloud Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.