Coursera

Create a Cloud Storage Bucket

Cloud storage > Buckets > Create bucket

Public to the internet: three dots > edit access > Entity = public, name=AllUsers, Access=Reader

Replace text in file

STR=$(jq .data.translations[0].translatedText translation-response.json) && STR=”${STR//"}” && sed -i “s|your_text_here|$STR|g” nl-request.json

OCR request

curl -s -X POST -H “Content-Type: application/json” –data-binary @ocr-request.json https://vision.googleapis.com/v1/images:annotate?key=${API_KEY} -o ocr-response.json

Translation request

curl -s -X POST -H “Content-Type: application/json” –data-binary @translation-request.json https://translation.googleapis.com/language/translate/v2?key=${API_KEY} -o translation-response.json

Entity request

curl “https://language.googleapis.com/v1/documents:analyzeEntities?key=${API_KEY}
-s -X POST -H “Content-Type: application/json” –data-binary @nl-request.json

Label detection request

curl -s -X POST -H “Content-Type: application/json” –data-binary @request.json https://vision.googleapis.com/v1/images:annotate?key=${API_KEY}

Web detection: change LABEL_DETECTION to WEB_DETECTION

Face detection { “requests”: [ { “image”: { “source”: { “gcsImageUri”: “gs://my-bucket-name/selfie.png” } }, “features”: [ { “type”: “FACE_DETECTION” }, { “type”: “LANDMARK_DETECTION” } ] } ] }

curl -s -X POST -H “Content-Type: application/json” –data-binary @request.json https://vision.googleapis.com/v1/images:annotate?key=${API_KEY}

Landmark detection

curl -s -X POST -H “Content-Type: application/json” –data-binary @request.json https://vision.googleapis.com/v1/images:annotate?key=${API_KEY}