Real-time face detection using OpenCV, Node.js, and WebSockets
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is even with redbadger:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Badger Face Replace

Replace your face with badgers (or whatever image you upload). Based on the real-time face detection app using OpenCV, Node.js, and WebSockets built by Esther Jun Kim.


  • Node.js
  • OpenCV 2.4.x
  • ImageMagick – homebrew: brew install imagemagick
  • GraphicsMagick – homebrew: brew install graphicsmagick
  • pm2, a process manager for node.js that will restart the app in case of errors - npm install -g pm2 [optional]
  • A webcam, e.g. laptop-integrated webcam, USB webcam

Installing Node.js packages

  • Navigate to the server directory
  • To install the packages: npm install

Replacing the mask image

  • Add your image (in PNG format) to the server/lib/images directory
  • Update the MASK_IMAGE constant in server/lib/config/camera.js

Running the demo

  • Make sure you are still in the server directory
  • To run the server: pm2 start server.js
  • To run the demo locally, open a browser and go to localhost:8080
  • To shutdown the server: pm2 stop server

The app should be up and running!