mirror of
https://github.com/koush/scrypted.git
synced 2026-02-10 09:12:03 +00:00
13 lines
441 B
TypeScript
13 lines
441 B
TypeScript
import * as faceapi from "face-api.js";
|
|
|
|
export function makeBoundingBoxFromFace(face: faceapi.WithFaceDescriptor<faceapi.WithFaceLandmarks<{
|
|
detection: faceapi.FaceDetection;
|
|
}, faceapi.FaceLandmarks68>>
|
|
): [number, number, number, number] {
|
|
return makeBoundingBox(face.detection.box);
|
|
}
|
|
|
|
export function makeBoundingBox(box: faceapi.Box<any>): [number, number, number, number] {
|
|
return [box.x, box.y, box.width, box.height];
|
|
}
|