facr
v2.1.0
Published
Detects faces in images and returns a focal point
Downloads
3
Readme
facr
Detects faces in images and returns a focal point. Is used to crop the right part of an image. You should use this in conjunction with the ee-image-worker package which has support for cropping using focal points.
The Python script bin/detect is licenced unter the GPL2 Licence. The file was copied from https://gitlab.com/wavexx/facedetect
installation
You have first to install native dependecies
ubuntu linux
sudo apt -y install python python3-opencv libopencv-dev python3-numpy
API
const FaceDetection = require('facr');
// create an instance
const detector = new FaceDetection();
// get focal point for an image
const focalPoint = await detector.detect(imageBuffer);
if (focalPoint) console.log('Yeah, we got it! x %s, y %s :)', focalPoint.x, focalPoint.y);
else console.log('sorry, failed to detect any faces in this image ...'');