码迷,mamicode.com
首页 > 其他好文 > 详细

FACE++学习一、detect接口

时间:2014-10-28 17:25:07      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   io   color   os   ar   sp   

/detection/detect

描述

检测给定图片(Image)中的所有人脸(Face)的位置和相应的面部属性

  • 目前面部属性包括性别(gender), 年龄(age), 种族(race), 微笑程度(smiling), 眼镜(glass)和姿势(pose)
若结果的face_id没有被加入任何faceset/person之中,则在72小时之后过期被自动清除。
参数:
 
 bubuko.com,布布扣
 
bubuko.com,布布扣
 
 bubuko.com,布布扣
JSON构成:
{
    "face": [
        {
            "attribute": {
                "age": {
                    "range": 5, 
                    "value": 23
                }, 
                "gender": {
                    "confidence": 99.9999, 
                    "value": "Female"
                }, 
                "glass": {
                    "confidence": 99.945, 
                    "value": "None"
                }, 
                "pose": {
                    "pitch_angle": {
                        "value": 17
                    }, 
                    "roll_angle": {
                        "value": 0.735735
                    }, 
                    "yaw_angle": {
                        "value": -2
                    }
                }, 
                "race": {
                    "confidence": 99.6121, 
                    "value": "Asian"
                }, 
                "smiling": {
                    "value": 4.86501
                }
            }, 
            "face_id": "17233b4b1b51ac91e391e5afe130eb78", 
            "position": {
                "center": {
                    "x": 49.4, 
                    "y": 37.6
                }, 
                "eye_left": {
                    "x": 43.3692, 
                    "y": 30.8192
                }, 
                "eye_right": {
                    "x": 56.5606, 
                    "y": 30.9886
                }, 
                "height": 26.8, 
                "mouth_left": {
                    "x": 46.1326, 
                    "y": 44.9468
                }, 
                "mouth_right": {
                    "x": 54.2592, 
                    "y": 44.6282
                }, 
                "nose": {
                    "x": 49.9404, 
                    "y": 38.8484
                }, 
                "width": 26.8
            }, 
            "tag": ""
        }
    ], 
    "img_height": 500, 
    "img_id": "22fd9efc64c87e00224c33dd8718eec7", 
    "img_width": 500, 
    "session_id": "38047ad0f0b34c7e8c6efb6ba39ed355", 
    "url": "http://www.faceplusplus.com.cn/wp-content/themes/faceplusplus/assets/img/demo/1.jpg?v=4"
}

 JSON调用格式:

 final float ag ;
                            final String ger;
                            float x, y, w, h;
                            int i = 0;
                            //get the center point
                            x = (float)rst.getJSONArray("face").getJSONObject(i)
                                    .getJSONObject("position").getJSONObject("center").getDouble("x");
                            y = (float)rst.getJSONArray("face").getJSONObject(i)
                                    .getJSONObject("position").getJSONObject("center").getDouble("y");

                            //get face size
                            w = (float)rst.getJSONArray("face").getJSONObject(i)
                                    .getJSONObject("position").getDouble("width");
                            h = (float)rst.getJSONArray("face").getJSONObject(i)
                                    .getJSONObject("position").getDouble("height");
                            
                            //get face age
                            ag = (float)rst.getJSONArray("face").getJSONObject(i)
                            .getJSONObject("attribute").getJSONObject("age").getInt("value");
                            
                            // get face gender
                            
                            ger = (String)rst.getJSONArray("face").getJSONObject(i)
                                    .getJSONObject("attribute").getJSONObject("gender").getString("value");

 

 

FACE++学习一、detect接口

标签:des   style   blog   http   io   color   os   ar   sp   

原文地址:http://www.cnblogs.com/Anita9002/p/4057128.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!