Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video Intelligence: Caller does not have permission

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?

like image 674
jb6ei Avatar asked Oct 30 '25 11:10

jb6ei


1 Answers

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.

like image 68
Kelvin Yeo Avatar answered Nov 02 '25 01:11

Kelvin Yeo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!