Skip to content

Instantly share code, notes, and snippets.

@jefBinomed
Created December 3, 2020 12:49
Show Gist options
  • Save jefBinomed/905cc2fa4637c78573dbd875f6e930b9 to your computer and use it in GitHub Desktop.
Save jefBinomed/905cc2fa4637c78573dbd875f6e930b9 to your computer and use it in GitHub Desktop.
2020-fugu-face-detection
const faceDetector = new FaceDetector({
// (Optional) Hint to try and limit the amount of detected faces
// on the scene to this maximum number.
maxDetectedFaces: 5,
// (Optional) Hint to try and prioritize speed over accuracy
// by, e.g., operating on a reduced scale or looking for large features.
fastMode: false
});
try {
const faces = await faceDetector.detect(image);
faces.forEach(face => console.log(face));
} catch (e) {
console.error('Face detection failed:', e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment