gpt4 book ai didi

python - 视频情报 : Caller does not have permission

转载 作者:行者123 更新时间:2023-12-05 07:09:25 24 4
gpt4 key购买 nike

在 JupyterLab 上使用以下代码来运行 Google Video Intelligence Package:

from google.cloud import videointelligence
import os

client = videointelligence.VideoIntelligenceServiceClient.from_service_account_json("VidIntelligence.json")
job = client.annotate_video(
input_uri='gs://vidintelligencebucket/The Simpsons - Monopoly Night.mp4',
features=['LABEL_DETECTION', 'SHOT_CHANGE_DETECTION'])
result = job.result()

当我运行它时,出现以下错误:

PermissionDenied: 403 The caller does not have permission

有什么建议吗?

最佳答案

我遇到了这个问题。我很确定这是对您 Google 存储桶中的视频文件的权限。因为如果您转到 API > 仪表板,您应该会看到您的视频 API 被调用并注册了 4XX 错误。所以调用 API 不是问题。

奇怪的是,即使我将我的视频文件权限设置为 allUsers READ,我也会收到此错误,请注意此存储桶权限是基于粒度的。使用存储 API,我的服务帐户仍然可以下载文件,但只有视频 API 不起作用。

我再次尝试使用 Uniform-Control 存储桶,并向 @.iam.gserviceaccount.com 授予读取权限,然后可以访问此处的文件并且视频 API 可以正常工作。

关于python - 视频情报 : Caller does not have permission,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61579200/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com