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

View File

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

View File

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

View File

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