👤 Face Detection OCV3.js
Simple face detection class based on OpenCV for Node.js on top of C++ APIS.
Installation
$ yarn add face-detection
or
$ npm install --save face-detection
Note: installation may require some minutes. This library uses opencv4nodejs
which needs to be compiled from sources and that process is gonna take some time.
Usage
import FaceDetection as FD from 'face-detection'
async function detection() {
const IMG = await FD.readImg('./foo.jpg')
const RES = await FD.detect(IMG)
console.log(JSON.stringify(RES, null, 2))
}
detection()
output:
{
"objects": [
{
"height": 69,
"width": 69,
"y": 69,
"x": 345
},
{
"height": 148,
"width": 148,
"y": 4,
"x": 300
}
],
"numDetections": [
71,
4
]
}
Examples