文档
测试

开始测肤

POST
/api/skin_test

接口描述

先使用上传图片接口,再向此接口发送图片URL获取测肤结果

请求头

参数名
类型
描述
必填
Cookies
string
cookies
必填

请求参数

参数名
类型
描述
必填
user_id
int
用户id
必填
img_url
str
用户自拍图片链接 先使用上传图片接口上传获取
必填

响应参数

请求返回的正文为_json格式 ```json { "status": { "code": "SUC", "msg": "请求成功" }, "data": { "test_id": 132, //测肤结果id "img_urls": { "origin": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d.jpg", //原图像 "acne": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d_3922_e4_d_d2_b.jpg", //处理后输出的痤疮图像 "black_heads": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d_03_d_f1_d55_b8.jpg", //处理后输出的黑头图像 "blood": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d_5_c893_f_b9_e_e.jpg", //处理后输出的红血丝图像 "dark_eye_circle": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d__e697_e_c8_a9_a.jpg", //处理后输出的黑眼圈图像 "pore": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d_83_f_a_b_c_c35_d.jpg", //处理后输出的毛孔图像 "roughness": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d__f2_b_a_c78918.jpg", //处理后输出的粗糙度图像 "texture": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d_975_e_e673_a_d.jpg", //处理后输出的纹理图像 "splash": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d__e_d_c925_a079.jpg", //处理后输出的色斑图像 "water": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d_0857_e1_d7_a5.jpg", //处理后输出的水分图像 "wrinkle": "http://pg.pandaguangguang.com/files/03/22/1993??????8_b_b_d__a_f35_c11_b39.jpg", //处理后输出的皱纹图像 }, "gender": 99,//性别 0偏向于女性,100偏向于男性 "age": 20,//肤龄 "beauty": 78,//颜值 "glass": 0,//是否戴眼镜 0:不戴眼镜,1:戴眼镜 "face_shape": {//人脸关键点 "face_profile": [ //描述脸型轮廓的21点(每点为一个对象{x, y}) { "x": 90, "y": 170 }, ...... ], "left_eye": [ //描述左眼轮廓的8点(每点为一个对象{x, y}) { "x": 116, "y": 170 }, ...... ], "right_eye": [ //描述右眼轮廓的8点(每点为一个对象{x, y}) { "x": 189, "y": 169 }, ...... ], "left_eyebrow": [ //描述左眉轮廓的8点(每点为一个对象{x, y}) { "x": 102, "y": 155 }, ...... ], "right_eyebrow": [ //描述右眉轮廓的8点(每点为一个对象{x, y}) { "x": 204, "y": 156 }, ...... ], "mouth": [ //描述嘴巴轮廓的22点(每点为一个对象{x, y}) { "x": 131, "y": 228 }, ...... ], "nose": [ //描述鼻子轮廓的13点(每点为一个对象{x, y}) { "x": 153, "y": 201 }, ...... ] }, // acne:痤疮,其中: // acne_num表示痤疮数目, // acne_score表示痤疮打分, // left_face_acne_num表示左脸区域痤疮数目, // right_face_acne_num表示右脸区域痤疮数目, // fore_head_acne_num表示额头区域痤疮数目, // nose_area_acne_num表示鼻子区域痤疮数目, // upper_lip_acne_num表示上唇区域痤疮数目, // chin_acne_num表示下巴区域痤疮数目。 "acne": { //痘痘 "acne_num": 1, "acne_score": 100, "chin_acne_num": 0, "fore_head_acne_num": 1, "left_face_acne_num": 0, "nose_area_acne_num": 0, "right_face_acne_num": 0, "upper_lip_acne_num": 0 }, //black_heads:黑头,其中: // black_heads_num表示黑头数目, // black_heads_score表示黑头打分, // black_heads_ratio表示黑头面积占鼻头区域面积的比值。 "black_heads": { "black_heads_num": 32, "black_heads_ratio": 6.9286391654812709, "black_heads_score": 84 }, // dark_eye_circle:黑眼圈,其中: // dark_eye_circle_score:表示黑眼圈得分, // dark_eye_circle_style:为0表示无黑眼圈; // 为17表示轻度黑眼圈; // 为34表示中度黑眼圈; // 为51表示重度黑眼圈。 "dark_eye_circle": { //黑眼圈 "dark_eye_circle_score": 46, "dark_eye_circle_style": 34 }, //face_skin_type:肤质,其中: //skin_type_num为17表示油性肤质, // skin_type_num为34表示干性肤质, // skin_type_num为51表示混合肤质, // skin_type_num为0表示中性肤质。 "face_skin_type": { //肤质 油性,中性,干性,混合肤质 "skin_type": "you xing", "skin_type_num": 17 }, // pore:毛孔,其中: // pore_num表示毛孔数目, // pore_score表示毛孔打分, // pore_ratio表示毛孔面积占脸部的比值。 "pore": { //毛孔 "pore_num": 314, "pore_ratio": 2.669013652086702, "pore_score": 94 }, //roughness:粗糙度,其中: // roughness_score表示粗糙度打分。 "roughness": { //粗糙度 "roughness_score": 76 }, //skin_color:肤色,其中: // skin_color_type为17表示透白, // skin_color_type为34表示白皙, // skin_color_type为51表示自然, // skin_color_type为68表示小麦, // skin_color_type为85表示暗沉, // skin_color_type为0表示黝黑, // skin_color_score表示肤色打分. "skin_color": { "skin_color": "xiao mai", "skin_color_score": 75, "skin_color_type": 68 }, //skin_disease:面部皮肤疾病,其中: // skin_disease_num为17表示痤疮, // skin_disease_num为34表示敏感皮肤, // skin_disease_num为51表示毛孔粗大, // skin_disease_num为0表示健康皮肤。 "skin_disease": { "skin_disease_num": 34, "skin_disease_type": "sensitive skin" }, // splash:色斑,其中: // splash_num表示色斑数目, // splash_score表示色斑打分, // splash_ratio表示色斑面积占脸部的比值, // left_face_splash_num表示左脸区域色斑数目, // right_face_splash_num表示右脸区域色斑数目, // fore_head_splash_num表示额头区域色斑数目, // nose_area_splash_num表示鼻子区域色斑数目, // upper_lip_splash_num表示上唇区域色斑数目, // chin_splash_num表示下巴区域色斑数目。 "splash": { //色斑 "chin_splash_num": 0, "fore_head_splash_num": 4, "left_face_splash_num": 1, "nose_area_splash_num": 2, "right_face_splash_num": 0, "splash_num": 7, "splash_ratio": 1.0793573876581231, "splash_score": 89, "upper_lip_splash_num": 0 }, //texture:纹理,其中: // texture_score表示纹理打分。 "texture": { //纹理 "texture_score": 86 }, // start_time:启动系统时间,其中: // time:程序启动时的系统时间。 "start_time": { //开始时间 "time": "thu oct 10 12:45:06 2019" }, // finish_time:程序结束系统时间,其中: // time:程序结束时的系统时间。 "finish_time": { //结束时间 "time": "thu oct 10 12:45:09 2019" }, //time:总时间,其中: // total_time表示总时间。 "time": { "total_time": 2579 }, //total_score:总得分,其中: // roughness_score表示总得分。 "total_score": { //总分 "total_score": 75 }, //water:含水量,其中: // very_good_ratio表示面部含水量很好区域占人脸面积的比例, // good_ratio表示面部含水量较好区域占人脸面积的比例, // general_ratio表示面部含水量一般区域占人脸面积的比例, // poor_ratio表示面部含水量较少区域占人脸面积的比例, // very_poor_ratio表示面部含水量很少区域占人脸面积的比例, "water": { //水分 "general_ratio": 0.44455682199790608, "good_ratio": 0.18155778993738031, "poor_ratio": 0.24959405803686069, "very_good_ratio": 0.1242399699741224, "very_poor_ratio": 5.1360053730517753_e-05, "water_score": 63 }, // wrinkle:皱纹,其中: // wrinkle_num表示皱纹数目, // wrinkle_score表示皱纹打分。 "wrinkle": { //皱纹 "wrinkle_num": 4, "wrinkle_score": 93 } } } ``` ## 错误索引 | 序号 | 描述 | 说明 | | ---- | ------------------------ | ----------------------------------------| | 0 | success | 请求成功。 | | 501 | fill_face_report_exception | 获取面部检测结果失败。 | | 502 | general_process_exception | 通用面部检测失败。 | | 503 | face_remote_api_request_fail | 远程接口调用失败。 | | 1001 | id_is_missing | 请求正文没有_i_d参数。 | | 1002 | id_type_invalid | 请求正文的_i_d类型错误。 | | 1003 | id_invalid | 请求正文的_i_d无效。 | | 1004 | app_key_is_missing | 请求正文没有_app_key参数。 | | 1005 | app_key_type_invalid | 请求正文的_app_key参数类型错误。 | | 1006 | app_key_invalid | 请求正文的_app_key参数无效。 | | 1007 | image_param_missing | 请求正文没有_image参数。 | | 1008 | image_param_type_invalid | 请求正文的_image参数类型错误。 | | 1009 | image_base64_code_invalid | 请求正文的_image参数不是有效的_base64格式。 | | 1010 | content_missing | 没有请求正文。 | | 1011 | image_base64_code_missing | 请求正文没有_image参数内容为空。 | | 1012 | same_request_is_processing | 有一个相同的图片请求正在进行。 | | 1013 | token_invalid | 图片的票根无效。 | | 1014 | subject_param_missing | 请求正文没有_subject参数。 | | 1015 | subject_param_type_invalid | 请求正文的_subject参数类型错误。 |