Giter Site home page Giter Site logo

abbathaw / face-tracking-with-webcam Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 11.01 MB

Browser based webcam face tracking and detection. This code is modified from face-api.js library to only use the Tiny Face Detector and the webcam directly.

JavaScript 73.42% CSS 12.25% HTML 14.33%

face-tracking-with-webcam's Introduction

Face tracking and detection with webcam

Playing with an example repurposed from face-api.js for hackweek.

To start:

npm i
npm start

Browse to http://localhost:3000/.

This example is modified to only use the Tiny Face Detector and the webcam directly. All other non-related code has been reduced and removed. For the full examples, visit the face-api.js library itself.

Using Face Detection

In order for face detection to work you will need to create at least 1 reference object.

Inside the images folder:

  1. create a folder with the reference name (e.g. john):
  2. Inside the folder, add 3 images with these names (john1.jpeg, john2.jpeg, john3.jpeg). Please note the use of the extension (jpeg, and the numbers 1, 2, 3). This was a quick example so few of these things are hardcoded but you can edit all of these in the file main.js
  3. update the array of classes inside the main.js file with the name of the reference (folder).

Example output image:

screenshot output on browser

Branches

Check the different branches for different code configuration branch: multiple-faces (for webcam and multiple face detection) branch: multiple-faces-from-video (for detection from a video source. Put the video in the media folder and change the source in the index.html file.)

face-tracking-with-webcam's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.