face detect
npm install @paddlejs-models/facedetectFacedetect is used for face detection in image. It provides a simple interface. At the same time, you can use your own model.
``js
import { FaceDetector } from '@paddlejs-models/facedetect';
const faceDetector = new FaceDetector();
await faceDetector.init();
// Required parameter:imgEle(HTMLImageElement)
// Optional parameter: shrink, threshold
// Result is face area information. It includes left, top, width, height, confidence
const res = await faceDetector.detect(
imgEle,
{ shrink: 0.4, threshold: 0.6 }
);
`
bash
npm install
npm run dev
``
+ single big-sized face 