Request structure

We are going to make a request as follows:

Field Value
HTTP method POST
URL https://vision.googleapis.com/v1/images:annotate?key=API_KEY
Request body
// SNIPP SNIPP
{
"requests": [
{
"image": {
"content": "/9j/7QBEUGhvdG9zaG9...base64-encoded-image-content...fXNWzvDEeYxxxzj/Coa6Bax//Z"
},
"features": [
{
"type": "FACE_DETECTION"
}
]
}
]
}
// SNIPP SNIPP

 

Note that the content property under the image property is the base64 encoded version of the image. In the same images folder, you should find a file named Face_Detection_SriDevi_base64.txt. This is the base64 version of the same image. You can use an online service such as https://www.browserling.com/tools/image-to-base64 or https://www.base64-image.de/ for converting your own image to a base64 string. Under features, we are requesting the FACE_DETECTION feature.

Neither Packt Publishing nor the author are endorsing the preceding links. Please use them at your own risk.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.41.229