Before you can use AutoML Vision, you must enable it for your project. Follow the instructions on this page, or visit the AutoML Vision UI and click Do it for me to automatically set up your project (once you've enabled billing in step 1 of the linked page.)
Set up your project
- 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.
Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.
- Enable the AutoML and Cloud Storage APIs.
- Install the
gcloudcommand line tool.
- Follow the instructions to create a service account and download a key file for that account.
- Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to the path to the service account key file that you downloaded when you created the service account.
- Set the
PROJECT_IDenvironment variable to your Project ID.
export PROJECT_ID=your-project-idThe AutoML API calls and resource names include your Project ID in them. The
PROJECT_IDenvironment variable provides a convenient way to specify the ID.
- If you are an owner for your project, add your service account to the AutoML Editor
IAM role, replacing service-account-name with the name of
your new service account. For example,
gcloud auth login gcloud projects add-iam-policy-binding $PROJECT_ID \ --member="serviceAccount:service-account-name" \ --role="roles/automl.editor"
- Otherwise (if you are not a project owner), ask a project owner to add both your user ID and your service account to the AutoML Editor IAM role.