Member-only story
Detect faces using Google cloud vision api
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