类 FaceUtils
- java.lang.Object
-
- cn.smartjavaai.face.utils.FaceUtils
-
public class FaceUtils extends Object
人脸检测相关工具类- 作者:
- dwj
-
-
构造器概要
构造器 构造器 说明 FaceUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static DetectionResponseconvertToDetectionResponse(ai.djl.modality.cv.output.DetectedObjects detection, ai.djl.modality.cv.Image img)转换为FaceDetectedResultstatic DetectionResponseconvertToDetectionResponse(com.seeta.sdk.SeetaRect[] seetaResult, FaceModelConfig config, List<com.seeta.sdk.SeetaPointF[]> seetaPointFSList)转换为FaceDetectedResultstatic DetectionRectanglecorrectRect(DetectionRectangle rectangle, int imageWidth, int imageHeight)修正检测框static BufferedImagedrawBoundingBoxes(BufferedImage sourceImage, DetectionResponse detectionResponse)绘制人脸框static voiddrawBoundingBoxes(BufferedImage sourceImage, DetectionResponse detectionResponse, String savePath)绘制人脸框static double[][]facePoints(com.seeta.sdk.SeetaPointF[] pointFS)子图中人脸关键点坐标 - Coordinates of key points in the imagestatic double[][]facePoints(List<Point> points)子图中人脸关键点坐标 - Coordinates of key points in the imagestatic ai.djl.ndarray.NDArrayfaceTemplate512x512(ai.djl.ndarray.NDManager manager)512x512的目标点 - Target point of 512x512 standard 5 landmarks for FFHQ faces with 512 x 512static BufferedImagetoBufferedImage(com.seeta.sdk.SeetaImageData seetaImageData)bgr转图片
-
-
-
方法详细资料
-
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-- 返回:
-
drawBoundingBoxes
public static void drawBoundingBoxes(BufferedImage sourceImage, DetectionResponse detectionResponse, String savePath) throws IOException
绘制人脸框- 参数:
sourceImage-detectionResponse-savePath-- 抛出:
IOException
-
drawBoundingBoxes
public static BufferedImage drawBoundingBoxes(BufferedImage sourceImage, DetectionResponse detectionResponse) throws IOException
绘制人脸框- 参数:
sourceImage-detectionResponse-- 抛出:
IOException
-
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转图片- 返回:
- 图片
-
-