1.6.1.2 detect_labels()

优质
小牛编辑
129浏览
2023-12-01

detect_labels(self, **kwargs) 方法

调用人脸检测接口, 返回人脸检测的结果
request syntax

image = Image(uri="fds://cnbj2.fds.api.xiaomi.com/vision-test/test_img.jpg")
detect_labels_param = DetectLabelsParam(maxLabels = 5, minConfidence= 0.1)
detect_labels_request = DetectLabelsRequest(image=image, param=detect_labels_param)
labels_list = vision_client.detect_labels(detect_labels_request)

parameters

detect_labels_request : DetectLabelsRequest对象, 必须

用户在调用物体检测接口时, 必需提供必要的信息和数据,见 DetectLabelsRequest 

response syntax

{"labels": [
                {
                    "confidence": 0.25356695,
                    "name": "woman,adult female"
                },
                {
                    "confidence": 0.20326138,
                    "name": "female child,girl,little girl"
                }
            ]
}

labels 识别出的物体的列表

name String 
识别出的物品类别名称 
confidence float 
相应名称的置信度