Browse Source

fix(face-landmarks): get face models from node_modules instead of having resoruces folder (#11326)

master
Gabriel Borlea 3 years ago
parent
commit
856ef757d4
No account linked to committer's email address

+ 5
- 2
Makefile View File

@@ -8,7 +8,7 @@ TF_WASM_DIR = node_modules/@tensorflow/tfjs-backend-wasm/dist/
8 8
 RNNOISE_WASM_DIR = node_modules/rnnoise-wasm/dist
9 9
 TFLITE_WASM = react/features/stream-effects/virtual-background/vendor/tflite
10 10
 MEET_MODELS_DIR  = react/features/stream-effects/virtual-background/vendor/models
11
-FACE_MODELS_DIR = react/features/face-landmarks/resources
11
+FACE_MODELS_DIR = node_modules/@vladmandic/face-api/model
12 12
 NODE_SASS = ./node_modules/.bin/sass
13 13
 NPM = npm
14 14
 OUTPUT_DIR = .
@@ -103,7 +103,10 @@ deploy-meet-models:
103 103
 
104 104
 deploy-face-landmarks:
105 105
 	cp \
106
-		$(FACE_MODELS_DIR)/* \
106
+		$(FACE_MODELS_DIR)/tiny_face_detector_model-weights_manifest.json \
107
+		$(FACE_MODELS_DIR)/tiny_face_detector_model.bin \
108
+		$(FACE_MODELS_DIR)/face_expression_model-weights_manifest.json \
109
+		$(FACE_MODELS_DIR)/face_expression_model.bin \
107 110
 		$(DEPLOY_DIR)
108 111
 
109 112
 deploy-css:

+ 0
- 21
react/features/face-landmarks/resources/README.md View File

@@ -1,21 +0,0 @@
1
-# Face Landmarks Detection and Face Expression Models and Weights
2
-
3
-### Tiny Face Detector
4
-
5
-It is a realtime face detector.
6
-
7
-### Face Expression Recognition Model
8
-
9
-It is a models that recognizes face expressions.
10
-
11
-### Usage
12
-
13
-Both models are loaded using face-api which is as AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS.
14
-
15
-Depending on the browser and hardware acceleration available the tensorflow.js will use a webgl backend of a cpu backend.
16
-
17
-## LICENSE
18
-
19
-The models were both downloaded from the face-api repository, https://github.com/vladmandic/face-api , and they can be found in this folder https://github.com/vladmandic/face-api/tree/master/model.
20
-
21
-The repository has a MIT License. More information can be found here https://github.com/vladmandic/face-api/blob/master/LICENSE.

+ 0
- 60
react/features/face-landmarks/resources/face_expression_model-weights_manifest.json View File

@@ -1,60 +0,0 @@
1
-[
2
-  {
3
-      "weights":
4
-      [
5
-          {"name":"dense0/conv0/filters","shape":[3,3,3,32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0057930146946626555,"min":-0.7125408074435067}},
6
-          {"name":"dense0/conv0/bias","shape":[32],"dtype":"float32"},
7
-          {"name":"dense0/conv1/depthwise_filter","shape":[3,3,32,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006473719839956246,"min":-0.6408982641556684}},
8
-          {"name":"dense0/conv1/pointwise_filter","shape":[1,1,32,32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.010509579321917366,"min":-1.408283629136927}},
9
-          {"name":"dense0/conv1/bias","shape":[32],"dtype":"float32"},
10
-          {"name":"dense0/conv2/depthwise_filter","shape":[3,3,32,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.005666389652326995,"min":-0.7252978754978554}},
11
-          {"name":"dense0/conv2/pointwise_filter","shape":[1,1,32,32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.010316079270605948,"min":-1.1760330368490781}},
12
-          {"name":"dense0/conv2/bias","shape":[32],"dtype":"float32"},
13
-          {"name":"dense0/conv3/depthwise_filter","shape":[3,3,32,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0063220320963392074,"min":-0.853474333005793}},
14
-          {"name":"dense0/conv3/pointwise_filter","shape":[1,1,32,32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.010322785377502442,"min":-1.4658355236053466}},
15
-          {"name":"dense0/conv3/bias","shape":[32],"dtype":"float32"},
16
-          {"name":"dense1/conv0/depthwise_filter","shape":[3,3,32,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0042531527724920535,"min":-0.5741756242864272}},
17
-          {"name":"dense1/conv0/pointwise_filter","shape":[1,1,32,64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.010653339647779278,"min":-1.1825207009035}},
18
-          {"name":"dense1/conv0/bias","shape":[64],"dtype":"float32"},
19
-          {"name":"dense1/conv1/depthwise_filter","shape":[3,3,64,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.005166931012097527,"min":-0.6355325144879957}},
20
-          {"name":"dense1/conv1/pointwise_filter","shape":[1,1,64,64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.011478300188101974,"min":-1.3888743227603388}},
21
-          {"name":"dense1/conv1/bias","shape":[64],"dtype":"float32"},
22
-          {"name":"dense1/conv2/depthwise_filter","shape":[3,3,64,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006144821410085641,"min":-0.8479853545918185}},
23
-          {"name":"dense1/conv2/pointwise_filter","shape":[1,1,64,64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.010541967317169788,"min":-1.3809977185492421}},
24
-          {"name":"dense1/conv2/bias","shape":[64],"dtype":"float32"},
25
-          {"name":"dense1/conv3/depthwise_filter","shape":[3,3,64,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.005769844849904378,"min":-0.686611537138621}},
26
-          {"name":"dense1/conv3/pointwise_filter","shape":[1,1,64,64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.010939095534530341,"min":-1.2689350820055196}},
27
-          {"name":"dense1/conv3/bias","shape":[64],"dtype":"float32"},
28
-          {"name":"dense2/conv0/depthwise_filter","shape":[3,3,64,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0037769308277204924,"min":-0.40790852939381317}},
29
-          {"name":"dense2/conv0/pointwise_filter","shape":[1,1,64,128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.01188667194516051,"min":-1.4382873053644218}},
30
-          {"name":"dense2/conv0/bias","shape":[128],"dtype":"float32"},
31
-          {"name":"dense2/conv1/depthwise_filter","shape":[3,3,128,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006497045825509464,"min":-0.8381189114907208}},
32
-          {"name":"dense2/conv1/pointwise_filter","shape":[1,1,128,128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.011632198913424622,"min":-1.3377028750438316}},
33
-          {"name":"dense2/conv1/bias","shape":[128],"dtype":"float32"},
34
-          {"name":"dense2/conv2/depthwise_filter","shape":[3,3,128,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.005947182225246056,"min":-0.7969224181829715}},
35
-          {"name":"dense2/conv2/pointwise_filter","shape":[1,1,128,128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.011436844339557722,"min":-1.4524792311238306}},
36
-          {"name":"dense2/conv2/bias","shape":[128],"dtype":"float32"},
37
-          {"name":"dense2/conv3/depthwise_filter","shape":[3,3,128,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006665432686899222,"min":-0.8998334127313949}},
38
-          {"name":"dense2/conv3/pointwise_filter","shape":[1,1,128,128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.01283421422920975,"min":-1.642779421338848}},
39
-          {"name":"dense2/conv3/bias","shape":[128],"dtype":"float32"},
40
-          {"name":"dense3/conv0/depthwise_filter","shape":[3,3,128,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.004711699953266218,"min":-0.6737730933170692}},
41
-          {"name":"dense3/conv0/pointwise_filter","shape":[1,1,128,256],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.010955964817720302,"min":-1.3914075318504784}},
42
-          {"name":"dense3/conv0/bias","shape":[256],"dtype":"float32"},
43
-          {"name":"dense3/conv1/depthwise_filter","shape":[3,3,256,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.00554193468654857,"min":-0.7149095745647656}},
44
-          {"name":"dense3/conv1/pointwise_filter","shape":[1,1,256,256],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.016790372250126858,"min":-2.484975093018775}},
45
-          {"name":"dense3/conv1/bias","shape":[256],"dtype":"float32"},
46
-          {"name":"dense3/conv2/depthwise_filter","shape":[3,3,256,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006361540626077091,"min":-0.8142772001378676}},
47
-          {"name":"dense3/conv2/pointwise_filter","shape":[1,1,256,256],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.01777329678628959,"min":-1.7062364914838006}},
48
-          {"name":"dense3/conv2/bias","shape":[256],"dtype":"float32"},
49
-          {"name":"dense3/conv3/depthwise_filter","shape":[3,3,256,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006900275922289082,"min":-0.8625344902861353}},
50
-          {"name":"dense3/conv3/pointwise_filter","shape":[1,1,256,256],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.015449936717164282,"min":-1.9003422162112067}},
51
-          {"name":"dense3/conv3/bias","shape":[256],"dtype":"float32"},
52
-          {"name":"fc/weights","shape":[256,7],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.004834276554631252,"min":-0.7203072066400565}},
53
-          {"name":"fc/bias","shape":[7],"dtype":"float32"}
54
-      ],
55
-      "paths":
56
-      [
57
-          "face_expression_model.bin"
58
-      ]
59
-  }
60
-]

BIN
react/features/face-landmarks/resources/face_expression_model.bin View File


+ 0
- 30
react/features/face-landmarks/resources/tiny_face_detector_model-weights_manifest.json View File

@@ -1,30 +0,0 @@
1
-[
2
-  {
3
-      "weights":
4
-      [
5
-          {"name":"conv0/filters","shape":[3,3,3,16],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.009007044399485869,"min":-1.2069439495311063}},
6
-          {"name":"conv0/bias","shape":[16],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.005263455241334205,"min":-0.9211046672334858}},
7
-          {"name":"conv1/depthwise_filter","shape":[3,3,16,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.004001977630690033,"min":-0.5042491814669441}},
8
-          {"name":"conv1/pointwise_filter","shape":[1,1,16,32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.013836609615999109,"min":-1.411334180831909}},
9
-          {"name":"conv1/bias","shape":[32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0015159862590771096,"min":-0.30926119685173037}},
10
-          {"name":"conv2/depthwise_filter","shape":[3,3,32,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.002666276225856706,"min":-0.317286870876948}},
11
-          {"name":"conv2/pointwise_filter","shape":[1,1,32,64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.015265831292844286,"min":-1.6792414422128714}},
12
-          {"name":"conv2/bias","shape":[64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0020280554598453,"min":-0.37113414915168985}},
13
-          {"name":"conv3/depthwise_filter","shape":[3,3,64,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006100742489683862,"min":-0.8907084034938438}},
14
-          {"name":"conv3/pointwise_filter","shape":[1,1,64,128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.016276211832083907,"min":-2.0508026908425725}},
15
-          {"name":"conv3/bias","shape":[128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.003394414279975143,"min":-0.7637432129944072}},
16
-          {"name":"conv4/depthwise_filter","shape":[3,3,128,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006716050119961009,"min":-0.8059260143953211}},
17
-          {"name":"conv4/pointwise_filter","shape":[1,1,128,256],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.021875603993733724,"min":-2.8875797271728514}},
18
-          {"name":"conv4/bias","shape":[256],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0041141652009066415,"min":-0.8187188749804216}},
19
-          {"name":"conv5/depthwise_filter","shape":[3,3,256,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.008423839597141042,"min":-0.9013508368940915}},
20
-          {"name":"conv5/pointwise_filter","shape":[1,1,256,512],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.030007277283014035,"min":-3.8709387695088107}},
21
-          {"name":"conv5/bias","shape":[512],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.008402082966823203,"min":-1.4871686851277068}},
22
-          {"name":"conv8/filters","shape":[1,1,512,25],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.028336129469030042,"min":-4.675461362389957}},
23
-          {"name":"conv8/bias","shape":[25],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.002268134028303857,"min":-0.41053225912299807}}
24
-      ],
25
-      "paths":
26
-      [
27
-          "tiny_face_detector_model.bin"
28
-      ]
29
-  }
30
-]

BIN
react/features/face-landmarks/resources/tiny_face_detector_model.bin View File


+ 10
- 5
resources/load-test/package-lock.json View File

@@ -9800,7 +9800,8 @@
9800 9800
       "version": "5.1.0",
9801 9801
       "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz",
9802 9802
       "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==",
9803
-      "dev": true
9803
+      "dev": true,
9804
+      "requires": {}
9804 9805
     },
9805 9806
     "acorn-walk": {
9806 9807
       "version": "6.2.0",
@@ -9824,13 +9825,15 @@
9824 9825
       "version": "1.0.1",
9825 9826
       "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz",
9826 9827
       "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==",
9827
-      "dev": true
9828
+      "dev": true,
9829
+      "requires": {}
9828 9830
     },
9829 9831
     "ajv-keywords": {
9830 9832
       "version": "3.4.1",
9831 9833
       "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz",
9832 9834
       "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==",
9833
-      "dev": true
9835
+      "dev": true,
9836
+      "requires": {}
9834 9837
     },
9835 9838
     "ansi-escapes": {
9836 9839
       "version": "3.2.0",
@@ -11382,7 +11385,8 @@
11382 11385
       "version": "git+ssh://git@github.com/jitsi/eslint-config-jitsi.git#f292fbc07689eb3dbeb81c074accff25b448b074",
11383 11386
       "integrity": "sha512-kBrBgI96QBKg4hG633q0zeYZBWT8T79vTGoHuy3TapKrTG/1y6IneRXQ9+NKoTdCY+zQ6A4xc6D29iJKc6dVMQ==",
11384 11387
       "dev": true,
11385
-      "from": "eslint-config-jitsi@github:jitsi/eslint-config-jitsi#1.0.3"
11388
+      "from": "eslint-config-jitsi@github:jitsi/eslint-config-jitsi#1.0.3",
11389
+      "requires": {}
11386 11390
     },
11387 11391
     "eslint-import-resolver-node": {
11388 11392
       "version": "0.3.4",
@@ -11677,7 +11681,8 @@
11677 11681
       "version": "0.7.5",
11678 11682
       "resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-0.7.5.tgz",
11679 11683
       "integrity": "sha512-iPowgKUZkTPX5PznYsmifVj9Bob0w2wTHVkt/eYNPSzyebkUgIedmskf/kcfEIWpiWjg3JRjnW+a17XypySMuw==",
11680
-      "dev": true
11684
+      "dev": true,
11685
+      "requires": {}
11681 11686
     },
11682 11687
     "express": {
11683 11688
       "version": "4.17.1",

Loading…
Cancel
Save