npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

nodoface

v0.0.10

Published

C++ Addon for fast and efficient face analytics

Readme

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.

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
  • FaceDetectorHaar
  • FaceDetectorHOG
  • CLNF (LandmarkDetectorModel in OpenFace)
  • LandmarkModelConfig (FaceModelParameters in OpenFace)
  • GazeAnalyser (GazeAnalysis in OpenFace) [Does not work]

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 and functions

  • Image (cv::Mat)
  • IntImage (cv::Mat_<int>)
  • FloatImage (cv::Mat_<float>)
  • drawRect() (cv::rectangle())
  • drawText() (cv::putText()) (not working)
  • showImage() (cv::imshow())
  • readImage() (cv::imread())
  • saveImage() (cv::imwrite)
  • destroyWindow() (cv::destroyWindow())
  • destroyAllWindows() (cv::destroyAllWindows())
  • waitkey() (cv::waitKey())
  • VideoCapture (cv::VideoCapture)
  • VideoWriter (cv::VideoWriter) Note: All methods return RGB image instead of BGR unlike OpenCV OpenCV classes are partial bindings just sufficient for passing underlying Mat to/from nodejs and C++.

Utility functions

  • Image.fromBase64() (decodes base64 string into cv::Mat)
  • drawDetections() (Draws bounding boxes and texts on image)

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

Step 5 (Optional): Run tests

$ npm test

This will execute mocha tests. Some tests generate image outputs which can be checked in ./tests/outputs directory To clear all files generated by tests, execute npm run clean:test

If you encounter errors, see my gsoc notes for some assistance. The addon is exported from ./api/nodoface.js

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.