mirror of
https://gitee.com/open-visual/face-search.git
synced 2025-07-25 19:41:42 +08:00
add:添加SeetaFace6Open的人脸关键点遮挡模型
This commit is contained in:
parent
91bf0b8853
commit
76c3eaa7e0
@ -22,7 +22,7 @@ public class QualityInfo {
|
||||
|
||||
|
||||
public boolean isMask(){
|
||||
return true;
|
||||
return null != this.maskPoints && this.maskPoints.isMask();
|
||||
}
|
||||
|
||||
|
||||
@ -45,6 +45,10 @@ public class QualityInfo {
|
||||
return score;
|
||||
}
|
||||
|
||||
public boolean isMask(){
|
||||
return this.score >= 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Mask{" + "score=" + score + '}';
|
||||
@ -108,5 +112,18 @@ public class QualityInfo {
|
||||
super.addAll(Arrays.asList(point));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判定是否存在遮挡
|
||||
* @return
|
||||
*/
|
||||
public boolean isMask(){
|
||||
for(MaskPoint point : this){
|
||||
if(point.isMask()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,10 +41,10 @@ public class SeetaMaskFaceKeyPointTest extends BaseTest {
|
||||
QualityInfo.MaskPoints maskPoints = keyPointInfer.inference(cropImageMat, null);
|
||||
System.out.println(maskPoints);
|
||||
for(QualityInfo.MaskPoint maskPoint : maskPoints){
|
||||
if(maskPoint.score >= 0.5){
|
||||
Imgproc.circle(cropFace, new Point(maskPoint.x, maskPoint.y), 3, new Scalar(0,0,255), -1);
|
||||
if(maskPoint.isMask()){
|
||||
Imgproc.circle(cropFace, new Point(maskPoint.x, maskPoint.y), 3, new Scalar(0, 0, 255), -1);
|
||||
}else{
|
||||
Imgproc.circle(cropFace, new Point(maskPoint.x, maskPoint.y), 3, new Scalar(255, 0,0), -1);
|
||||
Imgproc.circle(cropFace, new Point(maskPoint.x, maskPoint.y), 3, new Scalar(255, 0, 0), -1);
|
||||
}
|
||||
}
|
||||
HighGui.imshow(fileName, cropFace);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 90 KiB |
Loading…
x
Reference in New Issue
Block a user