【问题标题】:Google Video Intelligence API query谷歌视频智能 API 查询
【发布时间】:2017-03-13 10:46:28
【问题描述】:

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

我怎样才能做到这一点?有什么建议吗?

谢谢

【问题讨论】:

  • 考虑到您已获得访问私人测试版程序的权限,我假设 Google 已将您添加到一个群组以寻求帮助。我认为你应该检查一下。
  • @DaImTo 我该如何检查?
  • @DaImTo 有什么建议可以完成这项工作吗?

标签: python google-api google-api-client google-api-python-client video-intelligence-api


【解决方案1】:

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

本页顶部有一个蓝色大按钮可以申请Google Video Intelligence

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

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

【讨论】:

  • @DalmTo 如何验证我是否已获得访问权限? [我在 3 天前注册了私人 Beta 访问权限。但尚未得到任何确认。]
  • 他们通常需要一段时间才能知道您是否可以访问
  • @DalmTo 我对原始问题做了一些改动。你能帮忙解决这个问题吗? [我现在可以访问我的“个人项目”的 VideoIntelligence API]
  • 你不应该改变你原来的问题它不会帮助别人如果我是正确的并且你没有访问权限,你应该打开一个新问题
  • 我从一开始就打算让这个 API 工作。最初,我不知道我无法访问 API。访问 API 只是解决方案的中间部分。
【解决方案2】:

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

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

确实(使用您按照these 步骤创建的json)。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多