Member-only story

Detect faces using Google cloud vision api

Rajathithan Rajasekar
3 min readOct 19, 2021

--

Photo by Naassom Azevedo on Unsplash

In this post , we are going to see how to use google cloud computer vision api to detect faces in an image and classify the joy likelihood .

To start , first enable the cloud vision api in the google cloud console or via the gcloud command.

Next, create a service account with “AI platform admin” permissions.

Create a json key for this service account.

Now you can create a jupyter notebook in your local machine or you can create notebook in Google cloud AI platform . ( Please note that creating a python notebook instance in GCP will incur costs).

  • Import the required cloud vision library, opencv , os and matplotlib libraries
  • For the purpose of detecting faces with Joy Likelihood, I have selected image with a happy face , an image with a sad face and an image with multiple joyful faces, Lets plot these images to visualize them.
  • Place the service account json key in a hidden folder

--

--

Rajathithan Rajasekar
Rajathithan Rajasekar

Written by Rajathithan Rajasekar

I like to write code in Python . Interested in cloud , dataAnalysis, computerVision, ML and deepLearning. https://rajathithanrajasekar.medium.com/membership

No responses yet