zoukankan      html  css  js  c++  java
  • FACE++学习一、detect接口

    /detection/detect

    描述

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

    • 目前面部属性包括性别(gender), 年龄(age), 种族(race), 微笑程度(smiling), 眼镜(glass)和姿势(pose)
    若结果的face_id没有被加入任何faceset/person之中,则在72小时之后过期被自动清除。
    参数:
     
     
     
     
     
    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");
     
  • 相关阅读:
    Unix/Linux环境C编程入门教程(20) 搭建基于Mac的 Xcode 与 QT 开发环境
    CC++初学者编程教程(10) 搭建Android java C/C++ NDK QTforAndroid 开发环境
    CC++初学者编程教程(9) Windows8.1安装VS2013并捆绑QT与编程助手
    CC++初学者编程教程(8) VS2013配置编程助手与QT
    云服务和虚拟机的预留 IP 地址
    zabbix自定义监控mysql
    关于 /etc/zabbix/zabbix_agentd.conf 文件 Hostname 文件的说明
    Centos7安装Zabbix3.4
    覆盖索引小结
    关于使用索引的一些经验
  • 原文地址:https://www.cnblogs.com/Anita9002/p/4057128.html
Copyright © 2011-2022 走看看