我正在尝试在我的“个人项目”中实现 VideoIntelligence API。但我不能这样做。[我的个人项目拥有 VideoIntelligence API 的访问权限]
请提供一些建议以使其正常工作。
我尝试了以下命令:
(venv) naveen@naveen:~/Desktop/personal-project$ python manage.py shell
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from google.cloud.gapic.videointelligence.v1beta1 import video_intelligence_service_client
>>> video_client = video_intelligence_service_client.VideoIntelligenceServiceClient()
>>> path = 'gs://demomaker/google_gmail.mp4'
>>> features = [2]
>>> operation = video_client.annotate_video(path, features)
但我将此视为错误:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "personal-project/venv/local/lib/python2.7/site-packages/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py", line 234, in annotate_video
self._annotate_video(request, options), self.operations_client,
File "personal-project/venv/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 419, in inner
return api_caller(api_call, this_settings, request)
File "personal-project/venv/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 407, in base_caller
return api_call(*args)
File "personal-project/venv/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 368, in inner
return a_func(*args, **kwargs)
File "personal-project/venv/local/lib/python2.7/site-packages/google/gax/retry.py", line 126, in inner
' classified as transient', exception)
RetryError: GaxError(Exception occurred in retry method that was not classified as transient, caused by <_Rendezvous of RPC that terminated with (StatusCode.PERMISSION_DENIED, Google Cloud Video Intelligence API has not been used in project usable-auth-library before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/videointelligence.googleapis.com/overview?project=usable-auth-library then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.)>)
它正在“usable-auth-library”项目中搜索。而它应该搜索/使用我的“个人项目”的权限。[因为我可以访问“个人项目”而不是“可用授权库”]
我怎样才能使这项工作?请问有什么建议吗?
谢谢