初始化完了你的对象
我们现在就可以正式开始使用百度云人脸识别服务了
接着来看SDK技术文档
image = "取决于image_type参数,传入BASE64字符串或URL字符串或FACE_TOKEN字符串"
imageType = "BASE64"
""" 调用人脸检测 """
client.detect(image, imageType);
""" 如果有可选参数 """
options = {}
options["face_field"] = "age"
options["max_face_num"] = 2
options["face_type"] = "LIVE"
""" 带参数调用人脸检测 """
client.detect(image, imageType, options)
插句题外话,在这里我们需要注意下,先前提到了百度云人脸识别接口有三个版本,这个代码的版本使用的是最新接口(V3接口)。
回到正题,看第一部分代码
image =