Socket
Socket
Sign inDemoInstall

node-face-detector

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-face-detector

node-face-detector


Version published
Weekly downloads
8
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Node Face Detector

FlowType compatible

This is node module based on the use of face-recognition.js, written to cut faces from the images.

How to use

yarn add node-face-detector

Or

git clone https://github.com/YozhikM/node-face-detector.git

Then run two tasks, because the two Big Brothers (Nodemon and Babel) are watching you in two different folders

yarn build

yarn start

API

getCroppedFace function accepts a url as a string and an optional scale.

function getCroppedFace(src: string, scale?: number = 1): Promise<{ buffer: Buffer, format: string }>

The src address can be either local or external - URL. You can not use the image format returned in promise, but I am not responsible for the consequences.

Example

getCroppedFace(
  'https://almaty.hh.kz/photo/492004920.jpeg?t=1520531261&h=Yerj2GWZtRPEUR6cQFGSjw'
).then(({ buffer, format }) =>
  fs.writeFile(`./images/face_out.${format}`, buffer, () => console.log('file writted'))
);

Keywords

FAQs

Package last updated on 03 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc