4

Using the following code on JupyterLab in order to run 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()

When I run it, the following error appears:

PermissionDenied: 403 The caller does not have permission

Any suggestions?

jb6ei
  • 41
  • 1

1 Answers1

1

I encountered this problem. I'm pretty sure it is the permission to the video file in your Google Storage Bucket. Because if you go to API > Dashboard, you should see that your Video API is called and registered 4XX errors. So it isn't a problem with calling the API.

Weirdly, I get this error even when I set my video file permission to allUsers READ, note that this bucket permission is granular based. Using Storage API, my service account could still download file, but only Video API didn't work.

I tried again with a Uniform-Control bucket, and grant READ to the @.iam.gserviceaccount.com, then the file here is accessible and the Video API works.

Kelvin Yeo
  • 102
  • 1
  • 7