0

我正在尝试在我的“个人项目”中实现 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”项目中搜索。而它应该搜索/使用我的“个人项目”的权限。[因为我可以访问“个人项目”而不是“可用授权库”]

我怎样才能使这项工作?请问有什么建议吗?

谢谢

4

2 回答 2

1

Google Video Intelligence目前处于私人测试阶段。这意味着您需要申请 Beta 访问权限才能使用它。

此页面顶部有一个蓝色大按钮,用于应用Google Video Intelligence

当/如果谷歌授予您测试访问权限,您应该会收到一封包含支持和反馈信息的电子邮件。这通常是 Google 群组上的私人群组。

阅读您的评论后,我想知道您是否已被授予访问权限。如果您的访问权限尚未消失,但您将无法提出任何请求。

于 2017-03-13T11:38:56.063 回答
0

我遇到了类似的问题。对我来说,它与我试图用来授权的服务帐户有关(设置 GOOGLE_APPLICATION_CREDENTIALS 环境变量对我没有用),但是

gcloud auth activate-service-account --key-file service-account-key-file

做了(使用您按照这些步骤创建的 json )。

不知道为什么,因为环境变量应该根据this优先。

于 2017-04-26T14:09:30.260 回答