If you haven't done so already, use the following instructions to set up your
project and create a Cloud Storage bucket.
Set up your project
Sign in to your Google Cloud account. If you're new to
Google Cloud,create an accountto 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
(roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission.Learn how to grant
roles.
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin), which
contains theserviceusage.services.enablepermission.Learn how to grant
roles.
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
(roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission.Learn how to grant
roles.
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin), which
contains theserviceusage.services.enablepermission.Learn how to grant
roles.
On theCreate a bucketpage, enter your bucket information. To go to the next
step, clickContinue.
ForName your bucket, enter a unique bucket name. Don't include sensitive
information in the bucket name, because the bucket namespace is global and publicly
visible.
In theChoose where to store your datasection, do the following:
To filter objects to replicate by object name prefix,
enter a prefix that you want to include or exclude objects from, then clickaddAdd a prefix.
To set a storage class for the replicated objects,
select a storage class from theStorage classmenu.
If you skip this step, the replicated objects will use the
destination bucket's storage class by default.
ClickDone.
In theChoose how to store your datasection, do the following:
In theSet a default classsection, select the following:Standard.
To enablehierarchical namespace, in theOptimize storage for data-intensive workloadssection, selectEnable hierarchical namespace on this bucket.
In theChoose how to control access to objectssection, select
whether or not your bucket enforcespublic access prevention,
and select anaccess control methodfor your bucket's objects.
In theChoose how to protect object datasection, do the
following:
Select any of the options underData protectionthat you
want to set for your bucket.
To enablesoft delete, click theSoft delete policy (For data recovery)checkbox,
and specify the number of days you want to retain objects
after deletion.
To setObject Versioning, click theObject versioning (For version control)checkbox,
and specify the maximum number of versions per object and the number of days after which
the noncurrent versions expire.
To enable the retention policy on objects and buckets, click theRetention (For compliance)checkbox, and then do the following:
Select the bucket you created in the previous section.
ClickUpload Filesand select the local version of thedemo-img.jpgfile to upload to your Cloud Storage bucket.This is the image file that you just uploaded:Image credit:Rohiim ArifulonUnsplash.
In theTry this methodsection, complete
the interactive API Explorer template by replacingcloud-samples-data/visionin theimage.source.imageUrifield with the
name of the Cloud Storage bucket where you uploaded thedemo-img.jpgfile. The request body should look like the following:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]