类 FaceUtils


  • public class FaceUtils
    extends Object
    人脸检测相关工具类
    作者:
    dwj
    • 构造器详细资料

      • FaceUtils

        public FaceUtils()
    • 方法详细资料

      • convertToDetectionResponse

        public static DetectionResponse convertToDetectionResponse​(ai.djl.modality.cv.output.DetectedObjects detection,
                                                                   ai.djl.modality.cv.Image img)
        转换为FaceDetectedResult
        参数:
        detection -
        img -
        返回:
      • convertToDetectionResponse

        public static DetectionResponse convertToDetectionResponse​(com.seeta.sdk.SeetaRect[] seetaResult,
                                                                   FaceModelConfig config,
                                                                   List<com.seeta.sdk.SeetaPointF[]> seetaPointFSList)
        转换为FaceDetectedResult
        参数:
        seetaResult -
        返回:
      • correctRect

        public static DetectionRectangle correctRect​(DetectionRectangle rectangle,
                                                     int imageWidth,
                                                     int imageHeight)
        修正检测框
        参数:
        rectangle -
        imageWidth -
        imageHeight -
        返回:
      • facePoints

        public static double[][] facePoints​(List<Point> points)
        子图中人脸关键点坐标 - Coordinates of key points in the image
        参数:
        points -
        返回:
      • facePoints

        public static double[][] facePoints​(com.seeta.sdk.SeetaPointF[] pointFS)
        子图中人脸关键点坐标 - Coordinates of key points in the image
        参数:
        pointFS -
        返回:
      • faceTemplate512x512

        public static ai.djl.ndarray.NDArray faceTemplate512x512​(ai.djl.ndarray.NDManager manager)
        512x512的目标点 - Target point of 512x512 standard 5 landmarks for FFHQ faces with 512 x 512
        参数:
        manager -
        返回:
      • toBufferedImage

        public static BufferedImage toBufferedImage​(com.seeta.sdk.SeetaImageData seetaImageData)
        bgr转图片
        返回:
        图片
      • convertToSeetaRect

        public static com.seeta.sdk.SeetaRect convertToSeetaRect​(DetectionRectangle detectionRectangle)
        将DetectionRectangle转换为SeetaRect
        参数:
        detectionRectangle -
        返回:
      • convertToSeetaPointF

        public static com.seeta.sdk.SeetaPointF[] convertToSeetaPointF​(List<Point> pointList)
        将PointList转换为SeetaPointF[]
        参数:
        pointList -
        返回:
      • convertToLivenessStatus

        public static LivenessStatus convertToLivenessStatus​(com.seeta.sdk.FaceAntiSpoofing.Status status)
        将SeetaAntiSpoofing.Status转换为LivenessStatus
        参数:
        status -
        返回:
      • convertToGenderType

        public static GenderType convertToGenderType​(com.seeta.sdk.GenderPredictor.GENDER gender)
        转为GenderType
        参数:
        gender -
        返回:
      • convertToEyeStatus

        public static EyeStatus convertToEyeStatus​(com.seeta.sdk.EyeStateDetector.EYE_STATE eyeState)
        转为EyeStatus
        参数:
        eyeState -
        返回:
      • convertToFaceAttributeResponse

        public static DetectionResponse convertToFaceAttributeResponse​(com.seeta.sdk.SeetaRect[] seetaResult,
                                                                       List<com.seeta.sdk.SeetaPointF[]> seetaPointFSList,
                                                                       List<FaceAttribute> faceAttributeList)
      • convertToDetectionResponse

        public static DetectionResponse convertToDetectionResponse​(com.seeta.sdk.SeetaRect[] seetaResult,
                                                                   List<com.seeta.sdk.SeetaPointF[]> seetaPointFSList,
                                                                   List<LivenessStatus> livenessStatusList)
        转换为FaceDetectedResult
        参数:
        seetaResult -
        返回: