我正在嘗試運行這段代碼,但出現權限錯誤。你建議什么解決方案?我可以io.open用別的東西代替嗎:
"""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:")
這是我得到的錯誤: PermissionError: [Errno 13] Permission denied: 'E:/.../Google_Video_API/videos/'
uj5u.com熱心網友回復:
有幾個問題:
io.open需要一個檔案而不是一個目錄;cwd看起來是一個目錄cwd = "E:/.../Google_Video_API/videos/"包括...,對嗎?
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/377079.html
下一篇:使用for回圈和函式創建字典
