get-face
v1.0.2
Published
use wasm opencv.js to get face!
Downloads
4
Readme
get-face
use wasm opencv.js to get face!
use
npm i get-face
example
const getFace = require('get-face');
const fs = require('fs');
const faceImgBufList = await getFace.getFace(fs.readFileSync('./imgInput.jpg'),'image/jpeg');
for(let i=0;i<faceImgBufList.length;i++) {
fs.writeFileSync(`./imgOnput${i}.jpeg`,faceImgBufList[i]);
}
imgInput.jpg
imgOnput0.jpeg
API
Function
getFace @return Promise<Array> (face photo's buffer )
|ParamName |Must|Type|Default|Remark| |:---- |:---|:----- |:----- |----- | |srcBuffer |yes |Buffer | / | photo's buffer | |mime |no |string | "image/jpeg" |alltype: "image/png","image/jpeg","image/bmp" | |top |no |number | 0 | | |right |no |number | 0 | | |bottom |no |number | 0 | | |left |no |number | 0 | |