Google Cloud Vision API에서 얼굴 인식 예제를 실행하려고합니다. 나는 [faces.py here] [1]을 (를) 실행하려고합니다.Google의 Cloud Vision API를 실행하는 중에 오류가 발생했습니다. (얼굴 인식)
나는 다음과 실행하면 :
되어 내가 오류 :faces.py 데모-picture.jpg 대신
아래
[email protected]:~/Documents/code/python- stuff/googleapis/cloudvisionapi/cloud-vision/python/face_detection$ python faces.py demo-image.jpg
Traceback (most recent call last):
File "faces.py", line 121, in <module>
main(args.input_image, args.output, args.max_results)
File "faces.py", line 98, in main
faces = detect_face(image, max_results)
File "faces.py", line 62, in detect_face
service = get_vision_service()
File "faces.py", line 35, in get_vision_service
credentials = GoogleCredentials.get_application_default()
File "/home/ubuntu/.local/lib/python2.7/site- packages/oauth2client/client.py", line 1398, in get_application_default
return GoogleCredentials._get_implicit_credentials()
File "/home/ubuntu/.local/lib/python2.7/site- packages/oauth2client/client.py", line 1388, in _get_implicit_credentials
raise ApplicationDefaultCredentialsError(ADC_HELP_MSG)
oauth2client.client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application- default-credentials for more information.
[email protected]:~/Documents/code/python- stuff/googleapis/cloudvisionapi/cloud-vision/python/face_detection$
[1]: https://github.com/GoogleCloudPlatform/cloud- vision/tree/master/python/face_detection
내 질문은 생각 - - 어떻게해야합니까?
그렇지 않으면 환경 변수 GOOGLE_APPLICATION_CREDENTIALS가 자격 증명을 정의하는 파일을 가리 키도록 정의되어야합니다.
줄'export ...'줄이'~/.bashrc' 파일의 끝 부분에 있어야합니까? – user1406716
일반적으로 ~/.bashrc에 추가하는 모든 추가/사용자 정의 행이 끝까지 이동합니다. 그러나 그것은 당신에게 달려 있습니다. –