【发布时间】:2021-04-29 18:05:14
【问题描述】:
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)
错误:AttributeError:模块“google.cloud.videointelligence_v1p3beta1”没有属性“枚举”。尝试在 Google API 中使用人员检测但出现此错误?
由于某种原因,当我尝试在 Google Colab 中运行第一个代码时,没有任何反应。我对此很陌生,所以我不确定我还能做什么。太感谢了!我正在尝试按照本教程创建自己的乒乓球击球检测。 https://github.com/google/making_with_ml/blob/master/sports_ai/Sports_AI_Analysis.ipynb
【问题讨论】:
标签: python-3.x google-colaboratory