rjuqwhnt
This commit is contained in:
parent
ece8503dd7
commit
05550308b7
@ -0,0 +1,125 @@
|
||||
package com.heyu.api.controller.face;
|
||||
|
||||
|
||||
import com.aliyun.facebody20191230.models.MonitorExaminationResponse;
|
||||
import com.aliyun.facebody20191230.models.MonitorExaminationResponseBody;
|
||||
import com.heyu.api.alibaba.handle.facebody.AMonitorExaminationHandle;
|
||||
import com.heyu.api.alibaba.request.facebody.AMonitorExaminationRequest;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.request.face.MonitorExaminationScreenReq;
|
||||
import com.heyu.api.resp.face.MonitorExaminationFaceResp;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/***
|
||||
* https://next.api.aliyun.com/api/facebody/2019-12-30/MonitorExamination?tab=DOC¶ms={%22ImageURL%22:%22http%3A%2F%2Fworkbench-file-transfer.oss-cn-shanghai.aliyuncs.com%2Fuser-files%2F84753ea9-9809-4348-ac27-71437b89fee9-WechatIMG29.jpg%3FOSSAccessKeyId%3DLTAI5tRvL6vYdjKSfTFZ156m%26Expires%3D1742056256%26Signature%3Dl%252B1vglgYe%252BIN3wHE4Eror6e5tj4%253D%26response-content-disposition%3Dattachment%22,%22Type%22:1}&lang=JAVA
|
||||
*线上监考
|
||||
*
|
||||
* MonitorExamination
|
||||
*
|
||||
* 人脸监控
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/monitor")
|
||||
@NotIntercept
|
||||
public class MonitorExaminationFaceController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private AMonitorExaminationHandle aMonitorExaminationHandle;
|
||||
|
||||
@RequestMapping("/face")
|
||||
public R screen(MonitorExaminationScreenReq req) {
|
||||
|
||||
|
||||
MonitorExaminationFaceResp monitorExaminationScreenResp = new MonitorExaminationFaceResp();
|
||||
|
||||
AMonitorExaminationRequest aMonitorExaminationRequest = new AMonitorExaminationRequest();
|
||||
aMonitorExaminationRequest.setImageUrl(req.getImageUrl());
|
||||
aMonitorExaminationRequest.setImageBase64(req.getImageBase64());
|
||||
// 1:考生状态检测
|
||||
aMonitorExaminationRequest.setType(1L);
|
||||
ApiR<MonitorExaminationResponse> aR = aMonitorExaminationHandle.handle(aMonitorExaminationRequest);
|
||||
if (aR.isSuccess() && isSuccessStatusCode(aR.getData().getStatusCode())) {
|
||||
/**
|
||||
* {
|
||||
* "RequestId": "00FA2FA3-3773-50B4-B07D-46E585034E5A",
|
||||
* "Data": {
|
||||
* "PersonInfo": {
|
||||
* "PersonNumber": 1,
|
||||
* "EarPhone": {
|
||||
* "Score": 0.9309924244880676,
|
||||
* "Threshold": 0.6
|
||||
* },
|
||||
* "CellPhone": {
|
||||
* "Score": 0.3302510678768158,
|
||||
* "Threshold": 0.6
|
||||
* }
|
||||
* },
|
||||
* "FaceInfo": {
|
||||
* "Completeness": 1,
|
||||
* "Pose": {
|
||||
* "Pitch": 6.967320919036865,
|
||||
* "Roll": -1.4554272890090942,
|
||||
* "Yaw": -28.746829986572266
|
||||
* },
|
||||
* "FaceNumber": 1
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
MonitorExaminationResponseBody.MonitorExaminationResponseBodyData responseBodyData = aR.getData().getBody().getData();
|
||||
|
||||
MonitorExaminationResponseBody.MonitorExaminationResponseBodyDataFaceInfo dataFaceInfo = responseBodyData.getFaceInfo();
|
||||
|
||||
MonitorExaminationResponseBody.MonitorExaminationResponseBodyDataPersonInfo dataPersonInfo = responseBodyData.getPersonInfo();
|
||||
MonitorExaminationResponseBody.MonitorExaminationResponseBodyDataPersonInfoEarPhone infoEarPhone = dataPersonInfo.getEarPhone();
|
||||
MonitorExaminationResponseBody.MonitorExaminationResponseBodyDataPersonInfoCellPhone infoCellPhone = dataPersonInfo.getCellPhone();
|
||||
|
||||
|
||||
MonitorExaminationFaceResp.FaceInfoDTO faceInfoDTO = new MonitorExaminationFaceResp.FaceInfoDTO();
|
||||
MonitorExaminationFaceResp.PersonInfoDTO personInfoDTO = new MonitorExaminationFaceResp.PersonInfoDTO();
|
||||
faceInfoDTO.setFaceNumber(dataFaceInfo.getFaceNumber());
|
||||
faceInfoDTO.setCompleteness(dataFaceInfo.getCompleteness());
|
||||
MonitorExaminationFaceResp.FaceInfoDTO.PoseDTO poseDTO = new MonitorExaminationFaceResp.FaceInfoDTO.PoseDTO();
|
||||
MonitorExaminationResponseBody.MonitorExaminationResponseBodyDataFaceInfoPose pose = dataFaceInfo.getPose();
|
||||
poseDTO.setPitch(pose.getPitch());
|
||||
poseDTO.setYaw(pose.getYaw());
|
||||
poseDTO.setRoll(pose.getRoll());
|
||||
|
||||
faceInfoDTO.setPose(poseDTO);
|
||||
|
||||
|
||||
personInfoDTO.setPersonNumber(dataPersonInfo.getPersonNumber());
|
||||
|
||||
MonitorExaminationFaceResp.PersonInfoDTO.EarPhoneDTO earPhoneDTO = new MonitorExaminationFaceResp.PersonInfoDTO.EarPhoneDTO();
|
||||
MonitorExaminationFaceResp.PersonInfoDTO.CellPhoneDTO cellPhoneDTO = new MonitorExaminationFaceResp.PersonInfoDTO.CellPhoneDTO();
|
||||
earPhoneDTO.setScore(infoEarPhone.getScore());
|
||||
earPhoneDTO.setThreshold(infoEarPhone.getThreshold());
|
||||
|
||||
|
||||
cellPhoneDTO.setScore(infoCellPhone.getScore());
|
||||
cellPhoneDTO.setThreshold(infoCellPhone.getThreshold());
|
||||
|
||||
personInfoDTO.setEarPhone(earPhoneDTO);
|
||||
personInfoDTO.setCellPhone(cellPhoneDTO);
|
||||
|
||||
|
||||
monitorExaminationScreenResp.setFaceInfo(faceInfoDTO);
|
||||
monitorExaminationScreenResp.setPersonInfo(personInfoDTO);
|
||||
|
||||
return R.error().setData(monitorExaminationScreenResp);
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -25,8 +25,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 监控屏幕
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/monitor")
|
||||
|
||||
@ -0,0 +1,168 @@
|
||||
package com.heyu.api.controller.face;
|
||||
|
||||
|
||||
import com.aliyun.facebody20191230.models.PedestrianDetectAttributeResponse;
|
||||
import com.aliyun.facebody20191230.models.PedestrianDetectAttributeResponseBody;
|
||||
import com.heyu.api.alibaba.handle.facebody.APedestrianDetectAttributeHandle;
|
||||
import com.heyu.api.alibaba.request.facebody.APedestrianDetectAttributeRequest;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.request.face.PedestrianDetectAttributeReq;
|
||||
import com.heyu.api.resp.face.PedestrianDetectAttributeResp;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/***
|
||||
*
|
||||
* https://next.api.aliyun.com/api/facebody/2019-12-30/PedestrianDetectAttribute?RegionId=cn-shanghai
|
||||
*人体结构化属性
|
||||
*
|
||||
* PedestrianDetectAttribute
|
||||
*
|
||||
*
|
||||
* 功能描述
|
||||
* 人体结构化属性能力可以检测图片中人体的属性,具体功能包括人体检测以及属性预估。例如:性别、年龄、朝向、帽子、眼镜、包、衣服、颜色等。
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/face")
|
||||
@NotIntercept
|
||||
public class PedestrianDetectAttributeController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private APedestrianDetectAttributeHandle aPedestrianDetectAttributeHandle;
|
||||
|
||||
|
||||
@RequestMapping("/attribute")
|
||||
@CacheResult
|
||||
public R attribute(PedestrianDetectAttributeReq req) {
|
||||
PedestrianDetectAttributeResp resp = new PedestrianDetectAttributeResp();
|
||||
|
||||
APedestrianDetectAttributeRequest request = new APedestrianDetectAttributeRequest();
|
||||
request.setImageBase64(req.getImageBase64());
|
||||
request.setImageUrl(req.getImageUrl());
|
||||
|
||||
ApiR<PedestrianDetectAttributeResponse> aR = aPedestrianDetectAttributeHandle.handle(request);
|
||||
if (aR.isSuccess() && isSuccessStatusCode(aR.getData().getStatusCode())) {
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyData responseBodyData = aR.getData().getBody().getData();
|
||||
List<PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributes> attributes = responseBodyData.getAttributes();
|
||||
resp.setWidth(responseBodyData.getWidth());
|
||||
resp.setHeight(responseBodyData.getHeight());
|
||||
resp.setPersonNumber(responseBodyData.getPersonNumber());
|
||||
List<PedestrianDetectAttributeResp.AttributesDTO> attributesDTOList = new ArrayList<>();
|
||||
List<PedestrianDetectAttributeResp.BoxesDTO> boxesDTOList = new ArrayList<>();
|
||||
|
||||
|
||||
if (CollectionUtils.isNotEmpty(attributes)) {
|
||||
for (PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributes attribute : attributes) {
|
||||
PedestrianDetectAttributeResp.AttributesDTO attributeDTO = new PedestrianDetectAttributeResp.AttributesDTO();
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.LowerWearDTO lowerWear = new PedestrianDetectAttributeResp.AttributesDTO.LowerWearDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesLowerWear attributesLowerWear = attribute.getLowerWear();
|
||||
lowerWear.setName(attributesLowerWear.getName());
|
||||
lowerWear.setScore(attributesLowerWear.getScore());
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.BackpackDTO backpack = new PedestrianDetectAttributeResp.AttributesDTO.BackpackDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesBackpack attributeBackpack = attribute.getBackpack();
|
||||
backpack.setName(attributeBackpack.getName());
|
||||
backpack.setScore(attributeBackpack.getScore());
|
||||
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.OrientDTO orient = new PedestrianDetectAttributeResp.AttributesDTO.OrientDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesOrient attributesOrient = attribute.getOrient();
|
||||
orient.setName(attributesOrient.getName());
|
||||
orient.setScore(attributesOrient.getScore());
|
||||
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.ShoulderBagDTO shoulderBag = new PedestrianDetectAttributeResp.AttributesDTO.ShoulderBagDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesShoulderBag attributesShoulderBag = attribute.getShoulderBag();
|
||||
shoulderBag.setName(attributesShoulderBag.getName());
|
||||
shoulderBag.setScore(attributesShoulderBag.getScore());
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.LowerColorDTO lowerColor = new PedestrianDetectAttributeResp.AttributesDTO.LowerColorDTO();
|
||||
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesLowerColor attributesLowerColor = attribute.getLowerColor();
|
||||
lowerColor.setName(attributesLowerColor.getName());
|
||||
lowerColor.setScore(attributesLowerColor.getScore());
|
||||
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.GlassesDTO glasses = new PedestrianDetectAttributeResp.AttributesDTO.GlassesDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesGlasses attributesGlasses = attribute.getGlasses();
|
||||
glasses.setName(attributesGlasses.getName());
|
||||
glasses.setScore(attributesGlasses.getScore());
|
||||
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.UpperColorDTO upperColor = new PedestrianDetectAttributeResp.AttributesDTO.UpperColorDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesUpperColor attributesUpperColor = attribute.getUpperColor();
|
||||
upperColor.setName(attributesUpperColor.getName());
|
||||
upperColor.setScore(attributesUpperColor.getScore());
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.HatDTO hat = new PedestrianDetectAttributeResp.AttributesDTO.HatDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesHat attributesHat = attribute.getHat();
|
||||
hat.setName(attributesHat.getName());
|
||||
hat.setScore(attributesHat.getScore());
|
||||
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.HandbagDTO handbag = new PedestrianDetectAttributeResp.AttributesDTO.HandbagDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesHandbag attributesHandbag = attribute.getHandbag();
|
||||
handbag.setName(attributesHandbag.getName());
|
||||
handbag.setScore(attributesHandbag.getScore());
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.GenderDTO gender = new PedestrianDetectAttributeResp.AttributesDTO.GenderDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesGender attributesGender = attribute.getGender();
|
||||
gender.setName(attributesGender.getName());
|
||||
gender.setScore(attributesGender.getScore());
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.AgeDTO age = new PedestrianDetectAttributeResp.AttributesDTO.AgeDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesAge attributesAge = attribute.getAge();
|
||||
age.setName(attributesAge.getName());
|
||||
age.setScore(attributesAge.getScore());
|
||||
|
||||
PedestrianDetectAttributeResp.AttributesDTO.UpperWearDTO upperWear = new PedestrianDetectAttributeResp.AttributesDTO.UpperWearDTO();
|
||||
PedestrianDetectAttributeResponseBody.PedestrianDetectAttributeResponseBodyDataAttributesUpperWear attributesUpperWear = attribute.getUpperWear();
|
||||
upperWear.setName(attributesUpperWear.getName());
|
||||
upperWear.setScore(attributesUpperWear.getScore());
|
||||
|
||||
|
||||
attributeDTO.setLowerWear(lowerWear);
|
||||
attributeDTO.setBackpack(backpack);
|
||||
attributeDTO.setOrient(orient);
|
||||
attributeDTO.setShoulderBag(shoulderBag);
|
||||
attributeDTO.setLowerColor(lowerColor);
|
||||
attributeDTO.setGlasses(glasses);
|
||||
attributeDTO.setUpperColor(upperColor);
|
||||
attributeDTO.setHat(hat);
|
||||
attributeDTO.setHandbag(handbag);
|
||||
attributeDTO.setGender(gender);
|
||||
attributeDTO.setAge(age);
|
||||
attributeDTO.setUpperWear(upperWear);
|
||||
|
||||
attributesDTOList.add(attributeDTO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resp.setAttributes(attributesDTOList);
|
||||
resp.setBoxes(boxesDTOList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return R.error();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.heyu.api.request.face;
|
||||
|
||||
import com.heyu.api.request.CommonReq;
|
||||
import lombok.Data;
|
||||
|
||||
/***
|
||||
* https://next.api.aliyun.com/api/facebody/2019-12-30/MonitorExamination?tab=DOC¶ms={%22ImageURL%22:%22http%3A%2F%2Fworkbench-file-transfer.oss-cn-shanghai.aliyuncs.com%2Fuser-files%2F84753ea9-9809-4348-ac27-71437b89fee9-WechatIMG29.jpg%3FOSSAccessKeyId%3DLTAI5tRvL6vYdjKSfTFZ156m%26Expires%3D1742056256%26Signature%3Dl%252B1vglgYe%252BIN3wHE4Eror6e5tj4%253D%26response-content-disposition%3Dattachment%22,%22Type%22:1}&lang=JAVA
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class MonitorExaminationFaceReq extends CommonReq {
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
ImageURL
|
||||
string
|
||||
图像 URL 地址。推荐使用上海地域的 OSS 链接,对于文件在本地或者非上海地域 OSS 链接的情况,请参见文件 URL 处理。
|
||||
|
||||
示例值:
|
||||
http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/facebody/MonitorExamination/1MonitorExamination1.jpg
|
||||
参考取值来源:
|
||||
MergeImageFace
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.heyu.api.request.face;
|
||||
|
||||
import com.heyu.api.request.CommonReq;
|
||||
import lombok.Data;
|
||||
|
||||
/***
|
||||
* https://next.api.aliyun.com/api/facebody/2019-12-30/PedestrianDetectAttribute?RegionId=cn-shanghai
|
||||
*/
|
||||
@Data
|
||||
public class PedestrianDetectAttributeReq extends CommonReq {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,146 @@
|
||||
package com.heyu.api.resp.face;
|
||||
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
/***
|
||||
* https://next.api.aliyun.com/api/facebody/2019-12-30/MonitorExamination?tab=DOC¶ms={%22ImageURL%22:%22http%3A%2F%2Fworkbench-file-transfer.oss-cn-shanghai.aliyuncs.com%2Fuser-files%2F84753ea9-9809-4348-ac27-71437b89fee9-WechatIMG29.jpg%3FOSSAccessKeyId%3DLTAI5tRvL6vYdjKSfTFZ156m%26Expires%3D1742056256%26Signature%3Dl%252B1vglgYe%252BIN3wHE4Eror6e5tj4%253D%26response-content-disposition%3Dattachment%22,%22Type%22:1}&lang=JAVA
|
||||
*
|
||||
*线上监考
|
||||
*
|
||||
* MonitorExamination
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class MonitorExaminationFaceResp extends BaseResp {
|
||||
|
||||
private PersonInfoDTO personInfo;
|
||||
|
||||
private FaceInfoDTO faceInfo;
|
||||
|
||||
/***
|
||||
* 中心人物的属性行为信息。当请求参数 Type 取值为 1 时显示该参数。
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public static class PersonInfoDTO {
|
||||
/***
|
||||
* 检测到的总人数,0 代表未检测到考生。
|
||||
*
|
||||
* 注意 请注意,该值为 Long 类型,在某些语言中可能存在精度丢失的风险,请小心使用。
|
||||
* 示例值:
|
||||
* 1
|
||||
*/
|
||||
private Long personNumber;
|
||||
/***
|
||||
* 戴耳机。
|
||||
*
|
||||
*/
|
||||
private EarPhoneDTO earPhone;
|
||||
/***
|
||||
* 打电话。
|
||||
*/
|
||||
private CellPhoneDTO cellPhone;
|
||||
|
||||
|
||||
@Data
|
||||
public static class EarPhoneDTO {
|
||||
/***
|
||||
* 戴耳机的概率分数,取值范围(0,1)。
|
||||
*
|
||||
* 示例值:
|
||||
* 0.7980290651321411
|
||||
*/
|
||||
private Float score;
|
||||
/***
|
||||
* 建议阈值。
|
||||
*
|
||||
* 说明 仅作为参考,实际应用中根据测试情况选取合适的 Score 阈值即可。
|
||||
* 示例值:
|
||||
* 0.6
|
||||
*/
|
||||
private Float threshold;
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public static class CellPhoneDTO {
|
||||
/***
|
||||
* 打电话的概率分数,取值范围(0,1)。
|
||||
*
|
||||
* 示例值:
|
||||
* 0.39076218008995056
|
||||
*
|
||||
*/
|
||||
private Float score;
|
||||
/***
|
||||
* 建议阈值。
|
||||
*
|
||||
* 说明 仅作为参考,实际应用中根据测试情况选取合适的 Score 阈值即可。
|
||||
* 示例值:
|
||||
* 0.6
|
||||
*/
|
||||
private Float threshold;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
public static class FaceInfoDTO {
|
||||
/***
|
||||
* 人脸完整度分数,取值范围(0,1)。
|
||||
*
|
||||
* 示例值:
|
||||
* 1
|
||||
*
|
||||
*/
|
||||
private Float completeness;
|
||||
/***
|
||||
* 正对摄像机时 3 个角度都为 0, 取值范围正负 90 度之间。
|
||||
*/
|
||||
private PoseDTO pose;
|
||||
/***
|
||||
* 检测到的人脸人数,0 代表未检测到考生人脸。
|
||||
*
|
||||
* 注意 请注意,该值为 Long 类型,在某些语言中可能存在精度丢失的风险,请小心使用。
|
||||
* 示例值:
|
||||
* 1
|
||||
*
|
||||
*/
|
||||
private Long faceNumber;
|
||||
|
||||
/***
|
||||
* 正对摄像机时 3 个角度都为 0, 取值范围正负 90 度之间。
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public static class PoseDTO {
|
||||
/***
|
||||
* 上下俯仰角角度,抬头为正值,低头为负值。
|
||||
*
|
||||
* 示例值:
|
||||
* -0.9185499548912048
|
||||
*/
|
||||
private Float pitch;
|
||||
/**
|
||||
* 人脸在画面中顺时针转动为正值,逆时针转动为负值。
|
||||
*
|
||||
* 示例值:
|
||||
* -0.18541647493839264
|
||||
*/
|
||||
private Float roll;
|
||||
/***
|
||||
* 向左看为正值,向右看为负值。
|
||||
*
|
||||
* 示例值:
|
||||
* 8.095342636108398
|
||||
*/
|
||||
private Float yaw;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,281 @@
|
||||
package com.heyu.api.resp.face;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/***
|
||||
* https://next.api.aliyun.com/api/facebody/2019-12-30/PedestrianDetectAttribute?RegionId=cn-shanghai&tab=DEBUG¶ms={%22ImageURL%22:%22http%3A%2F%2Fworkbench-file-transfer.oss-cn-shanghai.aliyuncs.com%2Fuser-files%2Fa8412c32-3e41-458c-9d5c-a55e9dff0bc6-PedestrianDetectAttribute1.jpg%3FOSSAccessKeyId%3DLTAI5tRvL6vYdjKSfTFZ156m%26Expires%3D1742094860%26Signature%3Di3aty663zZGOgYl5VjnkkiRVxkY%253D%26response-content-disposition%3Dattachment%22}
|
||||
*人体结构化属性
|
||||
*
|
||||
* PedestrianDetectAttribute
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class PedestrianDetectAttributeResp {
|
||||
/***
|
||||
* 检测到的行人个数,取值为正整数。
|
||||
*
|
||||
* 示例值:
|
||||
* 1
|
||||
*
|
||||
*/
|
||||
private Integer personNumber;
|
||||
/***
|
||||
* 行人属性。
|
||||
*/
|
||||
private List<AttributesDTO> attributes;
|
||||
|
||||
/***
|
||||
* 原图的高度,单位像素。
|
||||
*
|
||||
* 注意 请注意,该值为 Long 类型,在某些语言中可能存在精度丢失的风险,请小心使用。
|
||||
* 示例值:
|
||||
* 584
|
||||
*/
|
||||
private Long height;
|
||||
|
||||
/***
|
||||
* 原图的宽度,单位像素。
|
||||
*
|
||||
* 注意 请注意,该值为 Long 类型,在某些语言中可能存在精度丢失的风险,请小心使用。
|
||||
* 示例值:
|
||||
* 264
|
||||
*/
|
||||
private Long width;
|
||||
|
||||
/***
|
||||
* 检测到行人边界框的坐标。
|
||||
*/
|
||||
private List<BoxesDTO> boxes;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
public static class AttributesDTO {
|
||||
/***
|
||||
*Trousers(长裤);Shorts(短裤);Skirt&Dress(裙子)。
|
||||
*
|
||||
* 示例值:
|
||||
* Trousers
|
||||
*/
|
||||
private LowerWearDTO lowerWear;
|
||||
/***
|
||||
* Yes(有背包);No(无背包)。
|
||||
*
|
||||
* 示例值:
|
||||
* No
|
||||
*/
|
||||
private BackpackDTO backpack;
|
||||
/***
|
||||
* Front(正向);Side(侧向);Back(背面)。
|
||||
*
|
||||
* 示例值:
|
||||
* Front
|
||||
*
|
||||
*/
|
||||
private OrientDTO orient;
|
||||
/**
|
||||
* Yes(有肩挎包);No(无肩挎包)。
|
||||
*
|
||||
* 示例值:
|
||||
* No
|
||||
*/
|
||||
private ShoulderBagDTO shoulderBag;
|
||||
/***
|
||||
* 黑,灰,蓝,绿,白,紫,红,棕,黄,粉,不确定。
|
||||
*
|
||||
* 示例值:
|
||||
* 黄
|
||||
*/
|
||||
private LowerColorDTO lowerColor;
|
||||
/***
|
||||
* Yes(戴眼镜);No(不戴眼镜)。
|
||||
*
|
||||
* 示例值:
|
||||
* No
|
||||
*/
|
||||
private GlassesDTO glasses;
|
||||
/***
|
||||
*黑,灰,蓝,绿,白,紫,红,棕,黄,粉,不确定。
|
||||
*
|
||||
* 示例值:
|
||||
* 黄
|
||||
*
|
||||
*/
|
||||
private UpperColorDTO upperColor;
|
||||
/***
|
||||
* Yes(戴帽子);No(不戴帽子)。
|
||||
*
|
||||
* 示例值:
|
||||
* No
|
||||
*/
|
||||
private HatDTO hat;
|
||||
/***
|
||||
* Yes(有手提包);No(无手提包)。
|
||||
*
|
||||
* 示例值:
|
||||
* Yes
|
||||
*
|
||||
*/
|
||||
private HandbagDTO handbag;
|
||||
/**
|
||||
* 性别。
|
||||
*/
|
||||
private GenderDTO gender;
|
||||
/**
|
||||
* AgeOver60(大于 60 岁);Age18-60(18-60 岁之间);AgeLess18(小于 18 岁)。
|
||||
*
|
||||
* 示例值:
|
||||
* Age18-60
|
||||
*
|
||||
*/
|
||||
private AgeDTO age;
|
||||
/***
|
||||
* LongSleeve(长袖);ShortSleeve(短袖)。
|
||||
*
|
||||
* 示例值:
|
||||
* ShortSleeve
|
||||
*/
|
||||
private UpperWearDTO upperWear;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class LowerWearDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class BackpackDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class OrientDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class ShoulderBagDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class LowerColorDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class GlassesDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class UpperColorDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class HatDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class HandbagDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class GenderDTO {
|
||||
/**
|
||||
* 置信度。
|
||||
*
|
||||
* 示例值:
|
||||
* 0.97989875078201294
|
||||
*
|
||||
*/
|
||||
private Float score;
|
||||
/***
|
||||
* male(男);female(女)。
|
||||
*
|
||||
* 示例值:
|
||||
* female
|
||||
*/
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class AgeDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class UpperWearDTO {
|
||||
private Float score;
|
||||
private String name;
|
||||
}
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class BoxesDTO {
|
||||
/***
|
||||
* 边界框置信度。
|
||||
*
|
||||
* 示例值:
|
||||
* 0.88381063938140869
|
||||
*/
|
||||
private Float score;
|
||||
|
||||
/***
|
||||
* 边框右下角 y 坐标值。
|
||||
*
|
||||
* 示例值:
|
||||
* 218
|
||||
*/
|
||||
private Integer bottomRightY;
|
||||
/***
|
||||
* 边框右下角 x 坐标值。
|
||||
*
|
||||
* 示例值:
|
||||
* 584
|
||||
*/
|
||||
private Integer bottomRightX;
|
||||
/***
|
||||
* 边框左上角 y 坐标值。
|
||||
*
|
||||
* 示例值:
|
||||
* 27
|
||||
*/
|
||||
private Integer topLeftY;
|
||||
/***
|
||||
* 边框左上角 x 坐标值。
|
||||
*
|
||||
* 示例值:
|
||||
* 36
|
||||
*/
|
||||
private Integer topLeftX;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user