You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**JavaScript API for face detection and face recognition in the browser with tensorflow.js**
3
+
**JavaScript API for face detection and face recognition in the browser implemented on top of the tensorflow.js core API ([tensorflow/tfjs-core](https://github.com/tensorflow/tfjs-core))**
4
4
5
-
This project implements a ResNet-34 like architecture using the tensorflow.js core API ([@tensorflow/tfjs-core](https://github.com/tensorflow/tfjs-core)) for realtime face recognition in the browser. The neural net is equivalent to the **FaceRecognizerNet** used in [face-recognition.js](https://github.com/justadudewhohacks/face-recognition.js) and the net used in the [dlib](https://github.com/davisking/dlib/blob/master/examples/dnn_face_recognition_ex.cpp) face recognition example. The weights have been trained by [davisking](https://github.com/davisking) and the model achieves a prediction accuracy of 99.38% on the LFW (Labeled Faces in the Wild) benchmark for face recognition.
5
+
***[Running the Examples](#running-the-examples)**
6
+
***[About Face Detection](#about-face-detection)**
7
+
***[About Face Recognition](#about-face-recognition)**
8
+
***[Usage](#usage)**
6
9
7
-
## What does it do?
10
+
## Examples
8
11
9
-
The neural net computes a vector with 128 values (face descriptor) from any given face image, which is **not** limited to the set of faces used for training the model. You can determine the similarity of two arbitrary faces by comparing their face descriptors, for example by computing the euclidean distance or using any other classifier of your choice.
For face recognition, this project implements a SSD (Single Shot Multibox Detector) based on MobileNetV1. The neural net will compute the locations of each face in an image and will return the bounding boxes together with it's probability for each face.
51
+
52
+
The face detection model has been trained on the [WIDERFACE dataset](http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/) and the weights are provided by [yeephycho](https://github.com/yeephycho) in [this](https://github.com/yeephycho/tensorflow-face-detection) repo.
53
+
54
+
<aname="about-face-recognition"></a>
55
+
56
+
## About Face Recognition
57
+
58
+
For face recognition, a ResNet-34 like architecture is implemented to compute a face descriptor (a feature vector with 128 values) from any given face image, which is used to describe the characteristics of a persons face. The model is **not** limited to the set of faces used for training, meaning you can use it for face recognition of any person, for example yourself. You can determine the similarity of two arbitrary faces by comparing their face descriptors, for example by computing the euclidean distance or using any other classifier of your choice.
59
+
60
+
The neural net is equivalent to the **FaceRecognizerNet** used in [face-recognition.js](https://github.com/justadudewhohacks/face-recognition.js) and the net used in the [dlib](https://github.com/davisking/dlib/blob/master/examples/dnn_face_recognition_ex.cpp) face recognition example. The weights have been trained by [davisking](https://github.com/davisking) and the model achieves a prediction accuracy of 99.38% on the LFW (Labeled Faces in the Wild) benchmark for face recognition.
61
+
62
+
<aname="usage"></a>
63
+
19
64
## Usage
20
65
21
-
Get the latest build from dist/face-recognition.min.js and include the script:
66
+
Get the latest build from dist/face-api.js or dist/face-api.min.js and include the script:
22
67
23
68
```html
24
-
<scriptsrc="face-recognition.min.js"></script>
69
+
<scriptsrc="face-api.js"></script>
70
+
```
71
+
72
+
Or install the package:
73
+
74
+
```bash
75
+
npm i face-api
25
76
```
26
77
27
-
Download the weights file from your server and initialize the net (note, that your server has to host the *face_recognition_model.weights* file):
78
+
### Face Detection
79
+
80
+
Download the weights file from your server and initialize the net (note, that your server has to host the *face_detection_model.weights* file).
0 commit comments