Skip to content

Commit e5bf821

Browse files
authored
Merge branch 'master' into master
2 parents e220a15 + a86f011 commit e5bf821

File tree

960 files changed

+11558
-21000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

960 files changed

+11558
-21000
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
node_modules
22
.rpt2_cache
33
.env*
4+
45
tmp
56
proto
67
weights_uncompressed
78
weights_unused
89
docs
9-
out
10+
out
11+
build

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ proto
66
weights
77
weights_uncompressed
88
weights_unused
9+
src
910
test
1011
tools
1112
docs

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ sudo: required
22
language: node_js
33
node_js:
44
#- "node"
5+
- "12"
56
- "11"
67
- "10"
78
- "8"

README.md

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://travis-ci.org/justadudewhohacks/face-api.js.svg?branch=master)](https://travis-ci.org/justadudewhohacks/face-api.js)
44
[![Slack](https://slack.bri.im/badge.svg)](https://slack.bri.im)
55

6-
**JavaScript face recognition API for the browser and nodejs implemented on top of tensorflow.js core ([tensorflow/tfjs-core](https://github.com/tensorflow/tfjs-core))**
6+
**JavaScript face recognition API for the browser and nodejs implemented on top of tensorflow.js core ([tensorflow/tfjs-core](https://github.com/tensorflow/tfjs))**
77

88
![faceapi](https://user-images.githubusercontent.com/31125521/57224752-ad3dc080-700a-11e9-85b9-1357b9f9bca4.gif)
99

@@ -16,6 +16,7 @@
1616
* **[Realtime Webcam Face Detection And Emotion Recognition - Video](https://youtu.be/CVClHLwv-4I)**
1717
* **[Easy Face Recognition Tutorial With JavaScript - Video](https://youtu.be/AZ4PdALMqx0)**
1818
* **[Using face-api.js with Vue.js and Electron](https://medium.com/@andreas.schallwig/do-not-laugh-a-simple-ai-powered-game-3e22ad0f8166)**
19+
* **[Add Masks to People - Gant Laborde on Learn with Jason](https://www.learnwithjason.dev/fun-with-machine-learning-pt-2)**
1920

2021
## Table of Contents
2122

@@ -25,7 +26,7 @@
2526
* **[face-api.js for Nodejs](#face-api.js-for-nodejs)**
2627
* **[Usage](#getting-started)**
2728
* **[Loading the Models](#getting-started-loading-models)**
28-
* **[High Level API](#getting-started-high-level-api)**
29+
* **[High Level API](#high-level-api)**
2930
* **[Displaying Detection Results](#getting-started-displaying-detection-results)**
3031
* **[Face Detection Options](#getting-started-face-detection-options)**
3132
* **[Utility Classes](#getting-started-utility-classes)**
@@ -135,8 +136,7 @@ import * as canvas from 'canvas';
135136
import * as faceapi from 'face-api.js';
136137

137138
// patch nodejs environment, we need to provide an implementation of
138-
// HTMLCanvasElement and HTMLImageElement, additionally an implementation
139-
// of ImageData is required, in case you want to use the MTCNN
139+
// HTMLCanvasElement and HTMLImageElement
140140
const { Canvas, Image, ImageData } = canvas
141141
faceapi.env.monkeyPatch({ Canvas, Image, ImageData })
142142
```
@@ -160,7 +160,6 @@ console.log(faceapi.nets)
160160
// faceRecognitionNet
161161
// ssdMobilenetv1
162162
// tinyFaceDetector
163-
// mtcnn
164163
// tinyYolov2
165164
```
166165

@@ -246,7 +245,6 @@ By default **detectAllFaces** and **detectSingleFace** utilize the SSD Mobilenet
246245
``` javascript
247246
const detections1 = await faceapi.detectAllFaces(input, new faceapi.SsdMobilenetv1Options())
248247
const detections2 = await faceapi.detectAllFaces(input, new faceapi.TinyFaceDetectorOptions())
249-
const detections3 = await faceapi.detectAllFaces(input, new faceapi.MtcnnOptions())
250248
```
251249

252250
You can tune the options of each face detector as shown [here](#getting-started-face-detection-options).
@@ -592,40 +590,6 @@ export interface ITinyFaceDetectorOptions {
592590
const options = new faceapi.TinyFaceDetectorOptions({ inputSize: 320 })
593591
```
594592

595-
### MtcnnOptions
596-
597-
``` javascript
598-
export interface IMtcnnOptions {
599-
// minimum face size to expect, the higher the faster processing will be,
600-
// but smaller faces won't be detected
601-
// default: 20
602-
minFaceSize?: number
603-
604-
// the score threshold values used to filter the bounding
605-
// boxes of stage 1, 2 and 3
606-
// default: [0.6, 0.7, 0.7]
607-
scoreThresholds?: number[]
608-
609-
// scale factor used to calculate the scale steps of the image
610-
// pyramid used in stage 1
611-
// default: 0.709
612-
scaleFactor?: number
613-
614-
// number of scaled versions of the input image passed through the CNN
615-
// of the first stage, lower numbers will result in lower inference time,
616-
// but will also be less accurate
617-
// default: 10
618-
maxNumScales?: number
619-
620-
// instead of specifying scaleFactor and maxNumScales you can also
621-
// set the scaleSteps manually
622-
scaleSteps?: number[]
623-
}
624-
625-
// example
626-
const options = new faceapi.MtcnnOptions({ minFaceSize: 100, scaleFactor: 0.8 })
627-
```
628-
629593
<a name="getting-started-utility-classes"></a>
630594

631595
## Utility Classes
@@ -726,7 +690,6 @@ Instead of using the high level API, you can directly use the forward methods of
726690
``` javascript
727691
const detections1 = await faceapi.ssdMobilenetv1(input, options)
728692
const detections2 = await faceapi.tinyFaceDetector(input, options)
729-
const detections3 = await faceapi.mtcnn(input, options)
730693
const landmarks1 = await faceapi.detectFaceLandmarks(faceImage)
731694
const landmarks2 = await faceapi.detectFaceLandmarksTiny(faceImage)
732695
const descriptor = await faceapi.computeFaceDescriptor(alignedFaceImage)
@@ -839,14 +802,6 @@ The face detector has been trained on a custom dataset of ~14K images labeled wi
839802

840803
This model is basically an even tinier version of Tiny Yolo V2, replacing the regular convolutions of Yolo with depthwise separable convolutions. Yolo is fully convolutional, thus can easily adapt to different input image sizes to trade off accuracy for performance (inference time).
841804

842-
### MTCNN
843-
844-
**Note, this model is mostly kept in this repo for experimental reasons. In general the other face detectors should perform better, but of course you are free to play around with MTCNN.**
845-
846-
MTCNN (Multi-task Cascaded Convolutional Neural Networks) represents an alternative face detector to SSD Mobilenet v1 and Tiny Yolo v2, which offers much more room for configuration. By tuning the input parameters, MTCNN should be able to detect a wide range of face bounding box sizes. MTCNN is a 3 stage cascaded CNN, which simultaneously returns 5 face landmark points along with the bounding boxes and scores for each face. Additionally the model size is only 2MB.
847-
848-
MTCNN has been presented in the paper [Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks](https://kpzhang93.github.io/MTCNN_face_detection_alignment/paper/spl.pdf) by Zhang et al. and the model weights are provided in the official [repo](https://github.com/kpzhang93/MTCNN_face_detection_alignment) of the MTCNN implementation.
849-
850805
<a name="models-face-landmark-detection"></a>
851806

852807
## 68 Point Face Landmark Detection Models

build/commonjs/ageGenderNet/AgeGenderNet.d.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

build/commonjs/ageGenderNet/AgeGenderNet.js

Lines changed: 0 additions & 145 deletions
This file was deleted.

build/commonjs/ageGenderNet/AgeGenderNet.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/commonjs/ageGenderNet/extractParams.d.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)