update tfjs and esbuild

pull/46/head
Vladimir Mandic 2021-03-09 17:32:33 -05:00
parent d024b045d4
commit 863c6fcd7a
23 changed files with 1780 additions and 49680 deletions

View File

@ -9,6 +9,9 @@ Repository: **<git+https://github.com/vladmandic/face-api.git>**
## Changelog
### **HEAD -> master** 2021/03/09 mandic00@live.com
### **1.0.1** 2021/03/09 mandic00@live.com
- add badges

View File

@ -20,7 +20,7 @@ This is updated **face-api.js** with latest available TensorFlow/JS as the origi
Forked from [face-api.js](https://github.com/justadudewhohacks/face-api.js) version **0.22.2** which was released on March 22nd, 2020
Currently based on **`TensorFlow/JS` 3.2.0**
Currently based on **`TensorFlow/JS` 3.3.0**
### Why?

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

1016
dist/face-api.esm.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3194
dist/face-api.esm.json vendored

File diff suppressed because it is too large Load Diff

1006
dist/face-api.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3073
dist/face-api.json vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

3073
dist/face-api.node.json vendored

File diff suppressed because it is too large Load Diff

936
dist/tfjs.esm.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

29564
dist/tfjs.esm.json vendored

File diff suppressed because it is too large Load Diff

180
package-lock.json generated
View File

@ -9,10 +9,10 @@
"version": "1.0.1",
"license": "MIT",
"devDependencies": {
"@tensorflow/tfjs": "^3.2.0",
"@tensorflow/tfjs-backend-wasm": "^3.2.0",
"@tensorflow/tfjs-node": "^3.2.0",
"@tensorflow/tfjs-node-gpu": "^3.2.0",
"@tensorflow/tfjs": "^3.3.0",
"@tensorflow/tfjs-backend-wasm": "^3.3.0",
"@tensorflow/tfjs-node": "^3.3.0",
"@tensorflow/tfjs-node-gpu": "^3.3.0",
"@types/node": "^14.14.33",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
@ -194,17 +194,17 @@
}
},
"node_modules/@tensorflow/tfjs": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-3.2.0.tgz",
"integrity": "sha512-rgcHHhzI+JVl206eMbYO8WzBW3DO9pinEbgtUWdxjfk+a4ojlqvJ34RPEISMSQZRR5KRCA7E/dHFv9+EULfqmw==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-3.3.0.tgz",
"integrity": "sha512-xo22GCUCGcPtNGIdDpLPrp9ms3atXmzX8AF4y3aIBEwK5KlvGe+ZhcoQ2xEOCPQGBr7NB7AO6rwT8gRoziAHVg==",
"dev": true,
"dependencies": {
"@tensorflow/tfjs-backend-cpu": "3.2.0",
"@tensorflow/tfjs-backend-webgl": "3.2.0",
"@tensorflow/tfjs-converter": "3.2.0",
"@tensorflow/tfjs-core": "3.2.0",
"@tensorflow/tfjs-data": "3.2.0",
"@tensorflow/tfjs-layers": "3.2.0",
"@tensorflow/tfjs-backend-cpu": "3.3.0",
"@tensorflow/tfjs-backend-webgl": "3.3.0",
"@tensorflow/tfjs-converter": "3.3.0",
"@tensorflow/tfjs-core": "3.3.0",
"@tensorflow/tfjs-data": "3.3.0",
"@tensorflow/tfjs-layers": "3.3.0",
"argparse": "^1.0.10",
"chalk": "^4.1.0",
"core-js": "3",
@ -216,9 +216,9 @@
}
},
"node_modules/@tensorflow/tfjs-backend-cpu": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.2.0.tgz",
"integrity": "sha512-L3Pp7FHO92BaeG8Uuc/RJMJ/e61UrIbKgFHS3MKr0zcbmEsqGfos6/5yR1EHj7SoYG2nPlC5+6HxbYy0zp22IA==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.3.0.tgz",
"integrity": "sha512-DLctv+PUZni26kQW1hq8jwQQ8u+GGc/p764WQIC4/IDagGtfGAUW1mHzWcTxtni2l4re1VrwE41ogWLhv4sGHg==",
"dev": true,
"dependencies": {
"@types/seedrandom": "2.4.27",
@ -228,7 +228,7 @@
"yarn": ">= 1.3.2"
},
"peerDependencies": {
"@tensorflow/tfjs-core": "3.2.0"
"@tensorflow/tfjs-core": "3.3.0"
}
},
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom": {
@ -238,25 +238,25 @@
"dev": true
},
"node_modules/@tensorflow/tfjs-backend-wasm": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-wasm/-/tfjs-backend-wasm-3.2.0.tgz",
"integrity": "sha512-gXxhJWRCmkcwSNatG7eGrmHKmjJC/AxvQdToHymkp1KtRazrsMWFrROoj1HuHwK1hCZyGa90ldmXlY9QdzFkuQ==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-wasm/-/tfjs-backend-wasm-3.3.0.tgz",
"integrity": "sha512-1mU3+GuCc0tPzG65qIVwlJoIOyOOvVVkNl1NsId7PTt/PwE/QwiofsCmfPDqH47rTMxBzhvnHZTi+Nj9VBaz1g==",
"dev": true,
"dependencies": {
"@tensorflow/tfjs-backend-cpu": "3.2.0",
"@tensorflow/tfjs-backend-cpu": "3.3.0",
"@types/emscripten": "~0.0.34"
},
"peerDependencies": {
"@tensorflow/tfjs-core": "3.2.0"
"@tensorflow/tfjs-core": "3.3.0"
}
},
"node_modules/@tensorflow/tfjs-backend-webgl": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-3.2.0.tgz",
"integrity": "sha512-WORXpDt5Ey5/+a4NioyrJkfbJUlleaSELpHnxeDsGt6BpRC2P/1pVJS1IjnBD/f4QlOm3mhouN2Oq28dRhRvqA==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-3.3.0.tgz",
"integrity": "sha512-GWCtXbrjPTyye3ooId9GlcNDwnIMskZarUpNIQ5g/zeISLfwEQoutA/UqJF+HzuEHgGMsWFkmaO3xKVT7UMpdg==",
"dev": true,
"dependencies": {
"@tensorflow/tfjs-backend-cpu": "3.2.0",
"@tensorflow/tfjs-backend-cpu": "3.3.0",
"@types/offscreencanvas": "~2019.3.0",
"@types/seedrandom": "2.4.27",
"@types/webgl-ext": "0.0.30",
@ -267,7 +267,7 @@
"yarn": ">= 1.3.2"
},
"peerDependencies": {
"@tensorflow/tfjs-core": "3.2.0"
"@tensorflow/tfjs-core": "3.3.0"
}
},
"node_modules/@tensorflow/tfjs-backend-webgl/node_modules/seedrandom": {
@ -277,18 +277,18 @@
"dev": true
},
"node_modules/@tensorflow/tfjs-converter": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-3.2.0.tgz",
"integrity": "sha512-iE2Q0naHR8OVcMc9RluebMObsPysru7X1y+mWtkPNnYlNUJORxfkEitrMbVDAKw6lsivIfo4Ar5UcstiG8/ckQ==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-3.3.0.tgz",
"integrity": "sha512-k57wN4yelePhmO9orcT/wzGMIuyedrMpVtg0FhxpV6BQu0+TZ/ti3W4Kb97GWJsoHKXMoing9SnioKfVnBW6hw==",
"dev": true,
"peerDependencies": {
"@tensorflow/tfjs-core": "3.2.0"
"@tensorflow/tfjs-core": "3.3.0"
}
},
"node_modules/@tensorflow/tfjs-core": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-3.2.0.tgz",
"integrity": "sha512-MZnTk9wcJai5lTfkC8T1rr6/M9C4eO0DfojZghopZXDflCTndLPIKcudx6E8qfrmZOkRSqMIwB7A8UFs7f+3Kg==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-3.3.0.tgz",
"integrity": "sha512-6G+LcCiQBl4Kza5mDbWbf8QSWBTW3l7SDjGhQzMO1ITtQatHzxkuHGHcJ4CTUJvNA0JmKf4QJWOvlFqEmxwyLQ==",
"dev": true,
"dependencies": {
"@types/offscreencanvas": "~2019.3.0",
@ -308,36 +308,36 @@
"dev": true
},
"node_modules/@tensorflow/tfjs-data": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-data/-/tfjs-data-3.2.0.tgz",
"integrity": "sha512-fG4rYJlxh/B9fzgc+/qdj5gPI485RsDUM99mErxovlh3UMIdRgMeHHdFse44VlyAShEAgsOehuWovhY5520kEw==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-data/-/tfjs-data-3.3.0.tgz",
"integrity": "sha512-0x28tRe6RJu5GmYq3IYN2GNnOgXU0nY+o6zZrlijkK+W3vjSTJlZzaBSifoeD6J8gzVpjs8W8qd/JKHQ1MQp8w==",
"dev": true,
"dependencies": {
"@types/node-fetch": "^2.1.2",
"node-fetch": "~2.6.1"
},
"peerDependencies": {
"@tensorflow/tfjs-core": "3.2.0",
"@tensorflow/tfjs-core": "3.3.0",
"seedrandom": "~2.4.3"
}
},
"node_modules/@tensorflow/tfjs-layers": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-3.2.0.tgz",
"integrity": "sha512-TgTpH6RI+NmL4s8pQ76wkq15p79SfSQLOfFL2rGmJgatQRuA/mxLlH5GLir5HwwER3a0Vj8lMbexxCAGTqr2Xg==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-3.3.0.tgz",
"integrity": "sha512-qO+TL2I29vWUiuFcQJXNyayWFYagwR+SIfbex8p5jjYaCGHGwE5GQcrH+ngoCgKZxm5tdMvYJsJPnih2M3fYzQ==",
"dev": true,
"peerDependencies": {
"@tensorflow/tfjs-core": "3.2.0"
"@tensorflow/tfjs-core": "3.3.0"
}
},
"node_modules/@tensorflow/tfjs-node": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node/-/tfjs-node-3.2.0.tgz",
"integrity": "sha512-4k8HvT+lFauy30EMoKhLvXykQ4xKfi5yTs0EdWue80z9XNNDIMG3932owBpWMeaRb5P0ONUuv9MSu+pi17rNnA==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node/-/tfjs-node-3.3.0.tgz",
"integrity": "sha512-grRgaXereQt5mQnu31gHCPkzA6SGReXW94b5FEMk1Psenmb0APnT7MGgZbujiMruQ81vG0/8gYA28uyZeZKcJw==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"@tensorflow/tfjs": "3.2.0",
"@tensorflow/tfjs": "3.3.0",
"adm-zip": "^0.4.11",
"google-protobuf": "^3.9.2",
"https-proxy-agent": "^2.2.1",
@ -351,13 +351,13 @@
}
},
"node_modules/@tensorflow/tfjs-node-gpu": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node-gpu/-/tfjs-node-gpu-3.2.0.tgz",
"integrity": "sha512-zAQPT9RwA5KOFFtkRzUGXE+9loJeJWbxkw2OnIPdB8+18c8s6/ICsHpN9nYLhelR+9wl877aaN4wQVR5T7iQDw==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node-gpu/-/tfjs-node-gpu-3.3.0.tgz",
"integrity": "sha512-a641ugrLvVjz2p0eGD0V+jyh9mtxrUSxVvX+aH2aQvOnz4BTFv/zOlPPCI/7D8zIiLBzSJCXMB5DdI3qg92n8Q==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"@tensorflow/tfjs": "3.2.0",
"@tensorflow/tfjs": "3.3.0",
"adm-zip": "^0.4.11",
"google-protobuf": "^3.9.2",
"https-proxy-agent": "^2.2.1",
@ -4044,17 +4044,17 @@
}
},
"@tensorflow/tfjs": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-3.2.0.tgz",
"integrity": "sha512-rgcHHhzI+JVl206eMbYO8WzBW3DO9pinEbgtUWdxjfk+a4ojlqvJ34RPEISMSQZRR5KRCA7E/dHFv9+EULfqmw==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-3.3.0.tgz",
"integrity": "sha512-xo22GCUCGcPtNGIdDpLPrp9ms3atXmzX8AF4y3aIBEwK5KlvGe+ZhcoQ2xEOCPQGBr7NB7AO6rwT8gRoziAHVg==",
"dev": true,
"requires": {
"@tensorflow/tfjs-backend-cpu": "3.2.0",
"@tensorflow/tfjs-backend-webgl": "3.2.0",
"@tensorflow/tfjs-converter": "3.2.0",
"@tensorflow/tfjs-core": "3.2.0",
"@tensorflow/tfjs-data": "3.2.0",
"@tensorflow/tfjs-layers": "3.2.0",
"@tensorflow/tfjs-backend-cpu": "3.3.0",
"@tensorflow/tfjs-backend-webgl": "3.3.0",
"@tensorflow/tfjs-converter": "3.3.0",
"@tensorflow/tfjs-core": "3.3.0",
"@tensorflow/tfjs-data": "3.3.0",
"@tensorflow/tfjs-layers": "3.3.0",
"argparse": "^1.0.10",
"chalk": "^4.1.0",
"core-js": "3",
@ -4063,9 +4063,9 @@
}
},
"@tensorflow/tfjs-backend-cpu": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.2.0.tgz",
"integrity": "sha512-L3Pp7FHO92BaeG8Uuc/RJMJ/e61UrIbKgFHS3MKr0zcbmEsqGfos6/5yR1EHj7SoYG2nPlC5+6HxbYy0zp22IA==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-3.3.0.tgz",
"integrity": "sha512-DLctv+PUZni26kQW1hq8jwQQ8u+GGc/p764WQIC4/IDagGtfGAUW1mHzWcTxtni2l4re1VrwE41ogWLhv4sGHg==",
"dev": true,
"requires": {
"@types/seedrandom": "2.4.27",
@ -4081,22 +4081,22 @@
}
},
"@tensorflow/tfjs-backend-wasm": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-wasm/-/tfjs-backend-wasm-3.2.0.tgz",
"integrity": "sha512-gXxhJWRCmkcwSNatG7eGrmHKmjJC/AxvQdToHymkp1KtRazrsMWFrROoj1HuHwK1hCZyGa90ldmXlY9QdzFkuQ==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-wasm/-/tfjs-backend-wasm-3.3.0.tgz",
"integrity": "sha512-1mU3+GuCc0tPzG65qIVwlJoIOyOOvVVkNl1NsId7PTt/PwE/QwiofsCmfPDqH47rTMxBzhvnHZTi+Nj9VBaz1g==",
"dev": true,
"requires": {
"@tensorflow/tfjs-backend-cpu": "3.2.0",
"@tensorflow/tfjs-backend-cpu": "3.3.0",
"@types/emscripten": "~0.0.34"
}
},
"@tensorflow/tfjs-backend-webgl": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-3.2.0.tgz",
"integrity": "sha512-WORXpDt5Ey5/+a4NioyrJkfbJUlleaSELpHnxeDsGt6BpRC2P/1pVJS1IjnBD/f4QlOm3mhouN2Oq28dRhRvqA==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-3.3.0.tgz",
"integrity": "sha512-GWCtXbrjPTyye3ooId9GlcNDwnIMskZarUpNIQ5g/zeISLfwEQoutA/UqJF+HzuEHgGMsWFkmaO3xKVT7UMpdg==",
"dev": true,
"requires": {
"@tensorflow/tfjs-backend-cpu": "3.2.0",
"@tensorflow/tfjs-backend-cpu": "3.3.0",
"@types/offscreencanvas": "~2019.3.0",
"@types/seedrandom": "2.4.27",
"@types/webgl-ext": "0.0.30",
@ -4113,16 +4113,16 @@
}
},
"@tensorflow/tfjs-converter": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-3.2.0.tgz",
"integrity": "sha512-iE2Q0naHR8OVcMc9RluebMObsPysru7X1y+mWtkPNnYlNUJORxfkEitrMbVDAKw6lsivIfo4Ar5UcstiG8/ckQ==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-3.3.0.tgz",
"integrity": "sha512-k57wN4yelePhmO9orcT/wzGMIuyedrMpVtg0FhxpV6BQu0+TZ/ti3W4Kb97GWJsoHKXMoing9SnioKfVnBW6hw==",
"dev": true,
"requires": {}
},
"@tensorflow/tfjs-core": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-3.2.0.tgz",
"integrity": "sha512-MZnTk9wcJai5lTfkC8T1rr6/M9C4eO0DfojZghopZXDflCTndLPIKcudx6E8qfrmZOkRSqMIwB7A8UFs7f+3Kg==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-3.3.0.tgz",
"integrity": "sha512-6G+LcCiQBl4Kza5mDbWbf8QSWBTW3l7SDjGhQzMO1ITtQatHzxkuHGHcJ4CTUJvNA0JmKf4QJWOvlFqEmxwyLQ==",
"dev": true,
"requires": {
"@types/offscreencanvas": "~2019.3.0",
@ -4141,9 +4141,9 @@
}
},
"@tensorflow/tfjs-data": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-data/-/tfjs-data-3.2.0.tgz",
"integrity": "sha512-fG4rYJlxh/B9fzgc+/qdj5gPI485RsDUM99mErxovlh3UMIdRgMeHHdFse44VlyAShEAgsOehuWovhY5520kEw==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-data/-/tfjs-data-3.3.0.tgz",
"integrity": "sha512-0x28tRe6RJu5GmYq3IYN2GNnOgXU0nY+o6zZrlijkK+W3vjSTJlZzaBSifoeD6J8gzVpjs8W8qd/JKHQ1MQp8w==",
"dev": true,
"requires": {
"@types/node-fetch": "^2.1.2",
@ -4151,19 +4151,19 @@
}
},
"@tensorflow/tfjs-layers": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-3.2.0.tgz",
"integrity": "sha512-TgTpH6RI+NmL4s8pQ76wkq15p79SfSQLOfFL2rGmJgatQRuA/mxLlH5GLir5HwwER3a0Vj8lMbexxCAGTqr2Xg==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-3.3.0.tgz",
"integrity": "sha512-qO+TL2I29vWUiuFcQJXNyayWFYagwR+SIfbex8p5jjYaCGHGwE5GQcrH+ngoCgKZxm5tdMvYJsJPnih2M3fYzQ==",
"dev": true,
"requires": {}
},
"@tensorflow/tfjs-node": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node/-/tfjs-node-3.2.0.tgz",
"integrity": "sha512-4k8HvT+lFauy30EMoKhLvXykQ4xKfi5yTs0EdWue80z9XNNDIMG3932owBpWMeaRb5P0ONUuv9MSu+pi17rNnA==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node/-/tfjs-node-3.3.0.tgz",
"integrity": "sha512-grRgaXereQt5mQnu31gHCPkzA6SGReXW94b5FEMk1Psenmb0APnT7MGgZbujiMruQ81vG0/8gYA28uyZeZKcJw==",
"dev": true,
"requires": {
"@tensorflow/tfjs": "3.2.0",
"@tensorflow/tfjs": "3.3.0",
"adm-zip": "^0.4.11",
"google-protobuf": "^3.9.2",
"https-proxy-agent": "^2.2.1",
@ -4185,12 +4185,12 @@
}
},
"@tensorflow/tfjs-node-gpu": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node-gpu/-/tfjs-node-gpu-3.2.0.tgz",
"integrity": "sha512-zAQPT9RwA5KOFFtkRzUGXE+9loJeJWbxkw2OnIPdB8+18c8s6/ICsHpN9nYLhelR+9wl877aaN4wQVR5T7iQDw==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node-gpu/-/tfjs-node-gpu-3.3.0.tgz",
"integrity": "sha512-a641ugrLvVjz2p0eGD0V+jyh9mtxrUSxVvX+aH2aQvOnz4BTFv/zOlPPCI/7D8zIiLBzSJCXMB5DdI3qg92n8Q==",
"dev": true,
"requires": {
"@tensorflow/tfjs": "3.2.0",
"@tensorflow/tfjs": "3.3.0",
"adm-zip": "^0.4.11",
"google-protobuf": "^3.9.2",
"https-proxy-agent": "^2.2.1",

View File

@ -40,10 +40,10 @@
],
"peerDependencies": {},
"devDependencies": {
"@tensorflow/tfjs": "^3.2.0",
"@tensorflow/tfjs-backend-wasm": "^3.2.0",
"@tensorflow/tfjs-node": "^3.2.0",
"@tensorflow/tfjs-node-gpu": "^3.2.0",
"@tensorflow/tfjs": "^3.3.0",
"@tensorflow/tfjs-backend-wasm": "^3.3.0",
"@tensorflow/tfjs-node": "^3.3.0",
"@tensorflow/tfjs-node-gpu": "^3.3.0",
"@types/node": "^14.14.33",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",

View File

@ -4,20 +4,17 @@
/* eslint-disable node/no-unpublished-require */
/* eslint-disable node/shebang */
const fs = require('fs');
const esbuild = require('esbuild');
const ts = require('typescript');
const log = require('@vladmandic/pilogger');
// keeps esbuild service instance cached
let es;
const banner = `
const banner = { js: `
/*
Face-API
homepage: <https://github.com/vladmandic/face-api>
author: <https://github.com/vladmandic>'
*/
`;
` };
// tsc configuration
const tsconfig = {
@ -46,6 +43,7 @@ const common = {
minifySyntax: true,
bundle: true,
sourcemap: true,
metafile: true,
logLevel: 'error',
target: 'es2018',
// tsconfig: './tsconfig.json',
@ -56,7 +54,6 @@ const targets = {
tfjs: {
platform: 'node',
format: 'cjs',
metafile: 'dist/tfjs.esm.json',
entryPoints: ['src/tfjs/tf-node.ts'],
outfile: 'dist/tfjs.esm.js',
external: ['@tensorflow'],
@ -64,7 +61,6 @@ const targets = {
node: {
platform: 'node',
format: 'cjs',
metafile: 'dist/face-api.node.json',
entryPoints: ['src/index.ts'],
outfile: 'dist/face-api.node.js',
external: ['@tensorflow'],
@ -76,7 +72,6 @@ const targets = {
format: 'cjs',
entryPoints: ['src/tfjs/tf-node-gpu.ts'],
outfile: 'dist/tfjs.esm.js',
metafile: 'dist/tfjs.esm.json',
external: ['@tensorflow'],
},
node: {
@ -84,7 +79,6 @@ const targets = {
format: 'cjs',
entryPoints: ['src/index.ts'],
outfile: 'dist/face-api.node-gpu.js',
metafile: 'dist/face-api.node-gpu.json',
external: ['@tensorflow'],
},
},
@ -92,7 +86,6 @@ const targets = {
tfjs: {
platform: 'node',
format: 'cjs',
metafile: 'dist/tfjs.esm.json',
entryPoints: ['src/tfjs/tf-node-cpu.ts'],
outfile: 'dist/tfjs.esm.js',
external: ['@tensorflow'],
@ -100,7 +93,6 @@ const targets = {
node: {
platform: 'node',
format: 'cjs',
metafile: 'dist/face-api.node-cpu.json',
entryPoints: ['src/index.ts'],
outfile: 'dist/face-api.node-cpu.js',
external: ['@tensorflow'],
@ -112,7 +104,6 @@ const targets = {
format: 'esm',
entryPoints: ['src/tfjs/tf-browser.ts'],
outfile: 'dist/tfjs.esm.js',
metafile: 'dist/tfjs.esm.json',
external: ['fs', 'buffer', 'util', 'os', '@tensorflow'],
},
esm: {
@ -120,7 +111,6 @@ const targets = {
format: 'esm',
entryPoints: ['src/index.ts'],
outfile: 'dist/face-api.esm-nobundle.js',
metafile: 'dist/face-api.esm-nobundle.json',
external: ['fs', 'buffer', 'util', 'os', '@tensorflow', 'tfjs.esm.js'],
},
},
@ -130,7 +120,6 @@ const targets = {
format: 'esm',
entryPoints: ['src/tfjs/tf-browser.ts'],
outfile: 'dist/tfjs.esm.js',
metafile: 'dist/tfjs.esm.json',
external: ['fs', 'buffer', 'util', 'os'],
},
iife: {
@ -139,7 +128,6 @@ const targets = {
globalName: 'faceapi',
entryPoints: ['src/index.ts'],
outfile: 'dist/face-api.js',
metafile: 'dist/face-api.json',
external: ['fs', 'buffer', 'util', 'os'],
},
esm: {
@ -147,19 +135,15 @@ const targets = {
format: 'esm',
entryPoints: ['src/index.ts'],
outfile: 'dist/face-api.esm.js',
metafile: 'dist/face-api.esm.json',
external: ['fs', 'buffer', 'util', 'os'],
},
},
};
async function getStats(metafile) {
async function getStats(json) {
const stats = {};
if (!fs.existsSync(metafile)) return stats;
const data = fs.readFileSync(metafile);
const json = JSON.parse(data.toString());
if (json && json.inputs && json.outputs) {
for (const [key, val] of Object.entries(json.inputs)) {
if (json && json.metafile.inputs && json.metafile.outputs) {
for (const [key, val] of Object.entries(json.metafile.inputs)) {
if (key.startsWith('node_modules')) {
stats.modules = (stats.modules || 0) + 1;
stats.moduleBytes = (stats.moduleBytes || 0) + val.bytes;
@ -169,7 +153,7 @@ async function getStats(metafile) {
}
}
const files = [];
for (const [key, val] of Object.entries(json.outputs)) {
for (const [key, val] of Object.entries(json.metafile.outputs)) {
if (!key.endsWith('.map')) {
files.push(key);
stats.outputBytes = (stats.outputBytes || 0) + val.bytes;
@ -204,15 +188,15 @@ function compile(fileNames, options) {
// rebuild on file change
async function build(f, msg) {
log.info('Build: file', msg, f, 'target:', common.target);
if (!es) es = await esbuild.startService();
try {
// rebuild all target groups and types
for (const [targetGroupName, targetGroup] of Object.entries(targets)) {
for (const [targetName, targetOptions] of Object.entries(targetGroup)) {
// if triggered from watch mode, rebuild only browser bundle
if ((require.main !== module) && (targetGroupName !== 'browserBundle')) continue;
await es.build({ ...common, ...targetOptions });
const stats = await getStats(targetOptions.metafile);
// @ts-ignore
const meta = await esbuild.build({ ...common, ...targetOptions });
const stats = await getStats(meta);
log.state(`Build for: ${targetGroupName} type: ${targetName}:`, stats);
}
}

View File

@ -1,7 +1,10 @@
const fs = require('fs');
const path = require('path');
// eslint-disable-next-line node/no-unpublished-require, import/no-extraneous-dependencies
const dayjs = require('dayjs');
// eslint-disable-next-line node/no-unpublished-require, import/no-extraneous-dependencies
const simpleGit = require('simple-git/promise');
// eslint-disable-next-line node/no-unpublished-require, import/no-extraneous-dependencies
const logger = require('@vladmandic/pilogger');
const app = require('../package.json');