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.)
Sign in to your Google Account.
If you don't already have one, sign up for a new account.
In the GCP Console, go to the Manage resources page and select or create a new project.
Make sure that billing is enabled for your project.
- Enable the Cloud AutoML and Storage APIs.
- Install the
gcloudcommand line tool.
- Follow the instructions to create a service account and download a key file.
- Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to the path to the service account key file that you downloaded when you created the service account. For example:
- Give yourself and the new service account permissions.
The following commands will give AutoML Editor IAM role to the
service account and AutoML Admin to you.
Replace project-id with the name of your
GCP project and replace 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="user:your-userid@your-domain" \ --role="roles/automl.admin"gcloud projects add-iam-policy-binding project-id \ --member="serviceAccount:service-account-name" \ --role="roles/automl.editor"
- Allow the AutoML Vision service accounts to access your Google Cloud project resources:
gcloud projects add-iam-policy-binding project-id \ --member="serviceAccount:firstname.lastname@example.org" \ --role="roles/ml.admin"
gcloud projects add-iam-policy-binding project-id \ --member="serviceAccount:email@example.com" \ --role="roles/storage.admin"
- Create a Google Cloud Storage bucket for storing your images:
gsutil mb -p $PROJECT -c regional -l us-central1 gs://project-id-vcm/