url: https://travelnoire.com/best-carnival-celebrations-around-the-world/, pageTitle: Best \u003cb\u003eCarnival\u003c/b\u003e Celebrations Around The World - Travel Noire, fullMatchingImages: [{url: https://travelnoire.com/wp-content/uploads/2019/02/quinten-de-graaf-278848-unsplash.jpg}]
url: https://bespokebrazil.com/rio-carnival-2019/, pageTitle: Visit \u003cb\u003eRio Carnival 2019\u003c/b\u003e with the Brazil Specialists - Bespoke Brazil, partialMatchingImages: [{ url: https://bespoke-brazil-2018-bespokebrazil.netdna-ssl.com/wp-content/uploads/2019/01/Carnival-1.jpg}]
Set up your Google Cloud project and authentication
If you have not created a Google Cloud project, do so now. Expand this section for instructions.
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Roles required to select or create a project
Select a project: Selecting a project doesn't require a specific
IAM role—you can select any project that you've been
granted a role on.
Create a project: To create a project, you need the Project Creator role
(roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
To initialize the gcloud CLI, run the following command:
gcloudinit
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Roles required to select or create a project
Select a project: Selecting a project doesn't require a specific
IAM role—you can select any project that you've been
granted a role on.
Create a project: To create a project, you need the Project Creator role
(roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
RESULTS_INT: (Optional) An integer value of results to
return. If you omit the "maxResults" field and its value, the API returns the default
value of 10 results. This field does not apply to the following feature types:
TEXT_DETECTION, DOCUMENT_TEXT_DETECTION, or CROP_HINTS.
PROJECT_ID: Your Google Cloud project ID.
HTTP method and URL:
POST https://vision.googleapis.com/v1/images:annotate
// detectWeb gets image properties from the Vision API for an image at the given file path.funcdetectWeb(wio.Writer,filestring)error{ctx:=context.Background()client,err:=vision.NewImageAnnotatorClient(ctx)iferr!=nil{returnerr}f,err:=os.Open(file)iferr!=nil{returnerr}deferf.Close()image,err:=vision.NewImageFromReader(f)iferr!=nil{returnerr}web,err:=client.DetectWeb(ctx,image,nil)iferr!=nil{returnerr}fmt.Fprintln(w,"Web properties:")iflen(web.FullMatchingImages)!=0{fmt.Fprintln(w,"\tFull image matches:")for_,full:=rangeweb