First steps to try Google CloudVision in Python

I tried to touch Google Cloud Vision at Kansai Home Hack Try 2016 vol.1, so a memorandum.

The environment is from Mac, terminal.

Basically, it's Google's Getting Start. https://cloud.google.com/vision/docs/getting-started

First, enable Cloud Vision from GCP スクリーンショット 2016-02-20 19.46.29.png

Credentials> Create credentials> Service account key> JSON> Create Follow the procedure in. Save the JSON file downloaded here. スクリーンショット 2016-02-20 20.31.16.png

Run Face Detection API in Python using google apiclient

First, define environment variables from the terminal. ʻExport GOOGLE_APPLICATION_CREDENTIALS ='/ xxx / xxx / {JSON file earlier} .json'`

Then clone the source from github. https://github.com/GoogleCloudPlatform/cloud-vision

Move from the cloned directory into python> face_detection, Execute faces.py in it. Specify the image file you want to analyze in the argument.

python faces.py face-input.jpg

It is OK if out.jpg is output in the same layer.

Face Annotation for face recognition

See here for information that can be obtained → https://cloud.google.com/vision/reference/rest/v1/images/annotate#FaceAnnotation

Not only facial expressions, but also the position of the mouth and the coordinates of the face can be obtained on the xyz axis, and it seems that it corresponds to multiple faces, and it only hits the API, so I want to try more. Free up to 1000 units per month. If you only use face recognition, you can do it 1000 times.

Recommended Posts

First steps to try Google CloudVision in Python
Try to calculate Trace in Python
Try logging in to qiita with Python
Try to implement Oni Maitsuji Miserable in python
Try to calculate a statistical problem in Python
3.14 π day, so try to output in Python
Try auto to automatically price Enums in Python 3.6
PyQ ~ Python First Steps ~
3 steps to put Python + mecab in yum only
Steps to develop a web application in Python
Try to calculate RPN in Python (for beginners)
Try gRPC in Python
Try 9 slices in Python
What to do to get google spreadsheet in python
[First API] Try to get Qiita articles with Python
Try to make a Python module in C language
Try to improve your own intro quiz in Python
To flush stdout in Python
Try to understand Python self
Login to website in Python
Try LINE Notify in Python
Speech to speech in python [text to speech]
Try implementing Yubaba in Python 3
How to develop in Python
Post to Slack in Python
Try to make it using GUI and PyQt in Python
How to extract any appointment in Google Calendar with Python
Just try to receive a webhook in ngrok and python
[Python] How to do PCA in Python
First simple regression analysis in Python
Convert markdown to PDF in Python
How to collect images in Python
Try to operate Facebook with Python
Steps to install Ubuntu in VirtualBox
Try implementing extension method in python
How to use SQLite in Python
Try using LevelDB in Python (plyvel)
Download Google Drive files in Python
Let's try Fizz Buzz in Python
In the python command python points to python3.8
Try PLC register access in Python
Try to put data in MongoDB
Python (from first time to execution)
Try converting cloudmonkey CLI to python3 -1
How to use Mysql in python
How to wrap C in Python
How to use ChemSpider in Python
6 ways to string objects in Python
How to use PubChem in Python
Cython to try in the shortest
Selenium and python to open google
Steps to install python3 on mac
Try using Leap Motion in Python
How to handle Japanese in Python
The first step in Python Matplotlib
An alternative to `pause` in Python
Try to get a list of breaking news threads in Python.
[Cloudian # 9] Try to display the metadata of the object in Python (boto3)
First python ② Try to write code while examining the features of python
[Cloudian # 2] Try to display the object storage bucket in Python (boto3)
Try to display google map and geospatial information authority map with python