Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodoface

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodoface

C++ Addon for fast and efficient face analytics

  • 0.0.1-alpha3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Nodoface

License: GPL v3

C++ Addon for fast and efficient facial analytics on Nodejs/TypeScript.

CCExtractor + Google Summer of Code = :purple_heart:

Nodoface is the backbone of Poor Man's Rekognition being developed under Google Summer of Code 2019 for CCExtractor Development.

CCExtractor Logo

Features

This Addon provides bindings to all OpenFace 2.0 features except the visualization utilities and FaceAnalyser class. Face detection can be easily run in realtime on any modern CPU. The Addon is built using node-addon-api.

Available classes from OpenFace

  • ImageCapture
  • SequenceCapture
  • FaceDetectorMTCNN
  • CLNF (LandmarkDetectorModel in OpenFace)
  • LandmarkModelConfig (FaceModelParameters in OpenFace)
  • GazeAnalyser (GazeAnalysis in OpenFace)

CLNF also provides HOG-based and Haar Cascades face detector. GazeAnalysis is a namespace with static classes in OpenFace but GazeAnalyser is a class in Nodoface.

Bindings to some OpenCV types

  • Image (cv::Mat)
  • IntImage (cv::Mat_<int>)
  • FloatImage (cv::Mat_<float>)
  • rectangle (cv::rectangle())
  • showImage (cv::imshow())
  • readImage (cv::imread())
  • destroyWindow (cv::destroyWindow())
  • destroyAllWindows (cv::destroyAllWindows())
  • waitkey (cv::waitKey())

OpenCV classes are partial bindings just sufficient for passing underlying Mat to/from nodejs and C++.

Installation

Dependencies

  • OpenFace >= 2.1.0
  • OpenCV >= 3.4.0
  • dlib >= 19.13
    All above libs must be compiled as a shared library
  • node-addon-api >= 1.6.3

Step 1: Install OpenCV 3.4.x.
If opencv is already installed, ensure it is recognised by pkg-config by executing:

$ pkg-config --modversion opencv

Step 2: Install dlib 19.13 or greater as a shared library (default is static). Check this answer by DavisKing for compiling it as shared library.
Ensure it is recognised by pkg-config:

$ pkg-config --modversion dlib

Step 3: Install OpenFace. The original repo has some issues. It can only compile as static library. So use my OpenFace fork instead. I have modified CMakelists.txt to compile OpenFace as shared lib.

$ git clone https://github.com/sziraqui/OpenFace.git && cd OpenFace
$ git checkout dynamic-compile
$ ./download_models.sh
$ mkdir build && cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE CMAKE_CXX_FLAGS="-std=c++11" -D CMAKE_EXE_LINKER_FLAGS="-std=c++11" 
$ make -j2
$ sudo make install

Step 4: Compile the bindings.

$ git clone https://github.com/sziraqui/nodoface.git && cd nodoface
$ npm install

If you encounter errors, see my gsoc notes for some assistance. The addon is exported from ./api/nodoface.js I will publish it to npm soon.

Examples

Run some samples to test if everything is working.

$ node examples/mtcnn_on_video.js path/to/a/video/file <OpenFace_REPO_DIR>/lib/local/LandmarkDetector/model/mtcnn_detector/MTCNN_detector.txt

Here's sample run:

IMAGE ALT Video Annotation

Mentors

License

GNU General Public License 3.0 (GPL-v3.0)
Please carefully read OpenFace 2.0 license. You must also respect opencv and dlib license.

Keywords

FAQs

Package last updated on 25 Jun 2019

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