Search code examples
pythongoogle-cloud-vision

Using Google Cloud Vision API


I'm trying to use Google Cloud Vision API, but facing some issues. Let me explain the steps I took and then the issue I'm facing. I'm running this code in Windows 10.

  1. Download and install "GoogleCloudSDKInstaller".
  2. gcloud auth application-default login to activate my login credential
  3. Used this code to run the face detector, for the image in my local system.
  4. cd into the folder where image exists
  5. Then run the following code:

    python detect_face.py "image.jpg"

But I'm getting this error:

raise EnvironmentError('Project was not passed and could not be ' OSError: Project was not passed and could not be determined from the environment.

Can anyone please tell me why I'm getting this issue?


Solution

  • I'm using the Google Vision API but in C# with Visual Studios 2017, and I needed to set the environment variable to GOOGLE_DEFAULT_CREDENTIALS. You might have this problem, try to look on the net how to set it.