I am trying to run this piece of code but I am getting a permission error. What solution do you suggest? Can I replace io.open
with something else:
"""Detect labels given a file path."""
video_client = videointelligence.VideoIntelligenceServiceClient()
features = [videointelligence.Feature.LABEL_DETECTION]
cwd = "E:/.../Google_Video_API/videos/"
with io.open(cwd, "rb") as movie:
input_content = movie.read()
operation = video_client.annotate_video(
request={"features": features, "input_content": input_content}
)
print("\nProcessing video for label annotations:")
This is the error I get: PermissionError: [Errno 13] Permission denied: 'E:/.../Google_Video_API/videos/'
CodePudding user response:
There are a couple of problems:
io.open
expects a file not a directory;cwd
looks to be a directorycwd = "E:/.../Google_Video_API/videos/"
includes...
, is that correct?