def detect_person(input_uri, output_uri):
"""Detects people in a video."""
client = videointelligence.VideoIntelligenceServiceClient(credentials=service_account.Credentials.from_service_account_file(
'./key.json'))
# Configure the request
config = videointelligence.types.PersonDetectionConfig(
include_bounding_boxes=True,
include_attributes=True,
include_pose_landmarks=True,
)
context = videointelligence.types.VideoContext(person_detection_config=config)
# Start the asynchronous request
operation = client.annotate_video(
input_uri=input_uri,
output_uri=output_uri,
features=[videointelligence.enums.Feature.PERSON_DETECTION],
video_context=context,
)
return operation然后我在运行时得到一个错误:
operation = detect_person(input_uri, output_uri)错误:枚举:模块'google.cloud.videointelligence_v1p3beta1‘没有属性’AttributeError‘。尝试在Google API中使用人员检测,但我收到此错误?
由于某些原因,当我尝试在Google Colab中运行第一个代码时,什么也没有发生。我对此非常陌生,所以我不确定我还能做什么。非常感谢!我正在尝试按照这个教程来创建我自己的乒乓球射击检测。https://github.com/google/making_with_ml/blob/master/sports_ai/Sports_AI_Analysis.ipynb
发布于 2021-03-25 00:55:44
在运行代码之前导入枚举。
from google.cloud import videointelligence
from google.cloud.videointelligence import enums, typeshttps://stackoverflow.com/questions/65893158
复制相似问题