updated lint rules

pull/70/head
Vladimir Mandic 2021-02-13 09:16:41 -05:00
parent 96a2b0a1b0
commit ab4759bf18
26 changed files with 427 additions and 172 deletions

View File

@ -8,8 +8,11 @@
"jquery": true,
"es2020": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 2020 },
"plugins": [ ],
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:import/errors",
@ -17,6 +20,8 @@
"plugin:node/recommended",
"plugin:promise/recommended",
"plugin:json/recommended-with-comments",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"airbnb-base"
],
"ignorePatterns": [ "dist", "assets", "media", "models", "node_modules" ],
@ -29,6 +34,7 @@
"import/no-absolute-path": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
"import/no-unresolved": "off",
"max-len": [1, 275, 3],
"newline-per-chained-call": "off",
"no-async-promise-executor": "off",
@ -48,6 +54,10 @@
"node/no-unpublished-import": "off",
"node/no-unpublished-require": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-missing-import": ["error", {
"allowModules": [],
"tryExtensions": [".js", ".json", ".ts"]
}],
"node/shebang": "off",
"object-curly-newline": "off",
"prefer-destructuring": "off",
@ -55,6 +65,11 @@
"promise/always-return": "off",
"promise/catch-or-return": "off",
"promise/no-nesting": "off",
"radix": "off"
"radix": "off",
"lines-between-class-members": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}

View File

@ -44,7 +44,9 @@ class GLBench {
constructor(gl, settings = {}) {
this.css = UICSS;
this.svg = UISVG;
// eslint-disable-next-line @typescript-eslint/no-empty-function
this.paramLogger = () => {};
// eslint-disable-next-line @typescript-eslint/no-empty-function
this.chartLogger = () => {};
this.chartLen = 20;
this.chartHz = 20;

File diff suppressed because one or more lines are too long

View File

@ -43,7 +43,7 @@
"imports": [],
"exports": [],
"inputs": {},
"bytes": 2020159
"bytes": 2020129
},
"dist/demo-browser-index.js": {
"imports": [],

File diff suppressed because one or more lines are too long

4
dist/human.esm.json vendored
View File

@ -417,7 +417,7 @@
"imports": []
},
"package.json": {
"bytes": 2403,
"bytes": 2437,
"imports": []
},
"src/human.ts": {
@ -499,7 +499,7 @@
"imports": [],
"exports": [],
"inputs": {},
"bytes": 1923329
"bytes": 1923299
},
"dist/human.esm.js": {
"imports": [],

2
dist/human.ts.map vendored

File diff suppressed because one or more lines are too long

4
dist/human.tson vendored
View File

@ -417,7 +417,7 @@
"imports": []
},
"package.json": {
"bytes": 2403,
"bytes": 2437,
"imports": []
},
"src/human.ts": {
@ -499,7 +499,7 @@
"imports": [],
"exports": [],
"inputs": {},
"bytes": 1923340
"bytes": 1923310
},
"dist/human.ts": {
"imports": [],

File diff suppressed because one or more lines are too long

50
dist/tfjs.esm.json vendored
View File

@ -416,7 +416,7 @@
}
]
},
"empty:/home/vlado/dev/human/node_modules/node-fetch/browser.js": {
"(disabled):node_modules/node-fetch/browser.js": {
"bytes": 0,
"imports": []
},
@ -428,7 +428,7 @@
"kind": "import-statement"
},
{
"path": "empty:/home/vlado/dev/human/node_modules/node-fetch/browser.js",
"path": "(disabled):node_modules/node-fetch/browser.js",
"kind": "require-call"
}
]
@ -3932,7 +3932,7 @@
"bytes": 2525,
"imports": []
},
"empty:crypto": {
"(disabled):crypto": {
"bytes": 0,
"imports": []
},
@ -3940,7 +3940,7 @@
"bytes": 8358,
"imports": [
{
"path": "empty:crypto",
"path": "(disabled):crypto",
"kind": "require-call"
}
]
@ -10517,7 +10517,7 @@
"bytes": 8358,
"imports": [
{
"path": "empty:crypto",
"path": "(disabled):crypto",
"kind": "require-call"
}
]
@ -17718,15 +17718,15 @@
}
]
},
"empty:path": {
"(disabled):path": {
"bytes": 0,
"imports": []
},
"empty:worker_threads": {
"(disabled):worker_threads": {
"bytes": 0,
"imports": []
},
"empty:perf_hooks": {
"(disabled):perf_hooks": {
"bytes": 0,
"imports": []
},
@ -17734,23 +17734,23 @@
"bytes": 74186,
"imports": [
{
"path": "empty:path",
"path": "(disabled):path",
"kind": "require-call"
},
{
"path": "empty:path",
"path": "(disabled):path",
"kind": "require-call"
},
{
"path": "empty:worker_threads",
"path": "(disabled):worker_threads",
"kind": "require-call"
},
{
"path": "empty:path",
"path": "(disabled):path",
"kind": "require-call"
},
{
"path": "empty:perf_hooks",
"path": "(disabled):perf_hooks",
"kind": "require-call"
}
]
@ -17763,11 +17763,11 @@
"bytes": 28523,
"imports": [
{
"path": "empty:path",
"path": "(disabled):path",
"kind": "require-call"
},
{
"path": "empty:path",
"path": "(disabled):path",
"kind": "require-call"
}
]
@ -25056,7 +25056,7 @@
"bytes": 8602,
"imports": [
{
"path": "empty:crypto",
"path": "(disabled):crypto",
"kind": "require-call"
}
]
@ -25244,7 +25244,7 @@
}
]
},
"empty:/home/vlado/dev/human/node_modules/string_decoder/lib/string_decoder.js": {
"(disabled):node_modules/string_decoder/lib/string_decoder.js": {
"bytes": 0,
"imports": []
},
@ -25264,7 +25264,7 @@
"kind": "import-statement"
},
{
"path": "empty:/home/vlado/dev/human/node_modules/string_decoder/lib/string_decoder.js",
"path": "(disabled):node_modules/string_decoder/lib/string_decoder.js",
"kind": "require-call"
}
]
@ -25478,7 +25478,7 @@
"imports": [],
"exports": [],
"inputs": {},
"bytes": 1206940
"bytes": 1206910
},
"dist/tfjs.esm.js": {
"imports": [],
@ -25958,7 +25958,7 @@
"zerosLike"
],
"inputs": {
"empty:/home/vlado/dev/human/node_modules/node-fetch/browser.js": {
"(disabled):node_modules/node-fetch/browser.js": {
"bytesInOutput": 18
},
"node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/lib/alea.js": {
@ -25979,7 +25979,7 @@
"node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/lib/tychei.js": {
"bytesInOutput": 885
},
"empty:crypto": {
"(disabled):crypto": {
"bytesInOutput": 18
},
"node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/seedrandom.js": {
@ -26012,13 +26012,13 @@
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/index.js": {
"bytesInOutput": 177
},
"empty:path": {
"(disabled):path": {
"bytesInOutput": 18
},
"empty:worker_threads": {
"(disabled):worker_threads": {
"bytesInOutput": 18
},
"empty:perf_hooks": {
"(disabled):perf_hooks": {
"bytesInOutput": 18
},
"node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js": {
@ -26051,7 +26051,7 @@
"node_modules/seedrandom/index.js": {
"bytesInOutput": 189
},
"empty:/home/vlado/dev/human/node_modules/string_decoder/lib/string_decoder.js": {
"(disabled):node_modules/string_decoder/lib/string_decoder.js": {
"bytesInOutput": 18
},
"node_modules/@tensorflow/tfjs/package.json": {

368
package-lock.json generated
View File

@ -5,12 +5,12 @@
"requires": true,
"dependencies": {
"@babel/code-frame": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
"integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
"version": "7.12.11",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
"integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
"dev": true,
"requires": {
"@babel/highlight": "^7.12.13"
"@babel/highlight": "^7.10.4"
}
},
"@babel/helper-validator-identifier": {
@ -155,6 +155,32 @@
"integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==",
"dev": true
},
"@nodelib/fs.scandir": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz",
"integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==",
"dev": true,
"requires": {
"@nodelib/fs.stat": "2.0.4",
"run-parallel": "^1.1.9"
}
},
"@nodelib/fs.stat": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz",
"integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==",
"dev": true
},
"@nodelib/fs.walk": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz",
"integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==",
"dev": true,
"requires": {
"@nodelib/fs.scandir": "2.1.4",
"fastq": "^1.6.0"
}
},
"@tensorflow/tfjs": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-3.0.0.tgz",
@ -329,6 +355,12 @@
"integrity": "sha512-QSb9ojDincskc+uKMI0KXp8e1NALFINCrMlp8VGKGcTSxeEyRTTKyjWw75NYrCZHUsVEEEpr1tYHpbtaC++/sQ==",
"dev": true
},
"@types/json-schema": {
"version": "7.0.7",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz",
"integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==",
"dev": true
},
"@types/json5": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
@ -336,9 +368,9 @@
"dev": true
},
"@types/node": {
"version": "14.14.25",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz",
"integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==",
"version": "14.14.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.27.tgz",
"integrity": "sha512-Ecfmo4YDQPwuqTCl1yBxLV5ihKfRlkBmzUEDcfIRvDxOTGQEeikr317Ln7Gcv0tjA8dVgKI3rniqW2G1OyKDng==",
"dev": true
},
"@types/node-fetch": {
@ -375,6 +407,158 @@
"integrity": "sha512-oGaKsBbxQOY5+aJFV3KECDhGaXt+yZJt2y/OZsnQGLRkH6Fvr7rv4pCt3SRH1somIHfej/c4u7NSpCyd9x+1Ow==",
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.15.0.tgz",
"integrity": "sha512-DJgdGZW+8CFUTz5C/dnn4ONcUm2h2T0itWD85Ob5/V27Ndie8hUoX5HKyGssvR8sUMkAIlUc/AMK67Lqa3kBIQ==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "4.15.0",
"@typescript-eslint/scope-manager": "4.15.0",
"debug": "^4.1.1",
"functional-red-black-tree": "^1.0.1",
"lodash": "^4.17.15",
"regexpp": "^3.0.0",
"semver": "^7.3.2",
"tsutils": "^3.17.1"
},
"dependencies": {
"debug": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
}
}
},
"@typescript-eslint/experimental-utils": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.15.0.tgz",
"integrity": "sha512-V4vaDWvxA2zgesg4KPgEGiomWEBpJXvY4ZX34Y3qxK8LUm5I87L+qGIOTd9tHZOARXNRt9pLbblSKiYBlGMawg==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/scope-manager": "4.15.0",
"@typescript-eslint/types": "4.15.0",
"@typescript-eslint/typescript-estree": "4.15.0",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
}
},
"@typescript-eslint/parser": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.15.0.tgz",
"integrity": "sha512-L6Dtbq8Bc7g2aZwnIBETpmUa9XDKCMzKVwAArnGp5Mn7PRNFjf3mUzq8UeBjL3K8t311hvevnyqXAMSmxO8Gpg==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "4.15.0",
"@typescript-eslint/types": "4.15.0",
"@typescript-eslint/typescript-estree": "4.15.0",
"debug": "^4.1.1"
},
"dependencies": {
"debug": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
}
}
},
"@typescript-eslint/scope-manager": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.15.0.tgz",
"integrity": "sha512-CSNBZnCC2jEA/a+pR9Ljh8Y+5TY5qgbPz7ICEk9WCpSEgT6Pi7H2RIjxfrrbUXvotd6ta+i27sssKEH8Azm75g==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.15.0",
"@typescript-eslint/visitor-keys": "4.15.0"
}
},
"@typescript-eslint/types": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.15.0.tgz",
"integrity": "sha512-su4RHkJhS+iFwyqyXHcS8EGPlUVoC+XREfy5daivjLur9JP8GhvTmDipuRpcujtGC4M+GYhUOJCPDE3rC5NJrg==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.0.tgz",
"integrity": "sha512-jG6xTmcNbi6xzZq0SdWh7wQ9cMb2pqXaUp6bUZOMsIlu5aOlxGxgE/t6L/gPybybQGvdguajXGkZKSndZJpksA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.15.0",
"@typescript-eslint/visitor-keys": "4.15.0",
"debug": "^4.1.1",
"globby": "^11.0.1",
"is-glob": "^4.0.1",
"semver": "^7.3.2",
"tsutils": "^3.17.1"
},
"dependencies": {
"debug": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
}
}
},
"@typescript-eslint/visitor-keys": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.0.tgz",
"integrity": "sha512-RnDtJwOwFucWFAMjG3ghCG/ikImFJFEg20DI7mn4pHEx3vC48lIAoyjhffvfHmErRDboUPC7p9Z2il4CLb7qxA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.15.0",
"eslint-visitor-keys": "^2.0.0"
}
},
"@vladmandic/pilogger": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/@vladmandic/pilogger/-/pilogger-0.2.14.tgz",
@ -495,6 +679,12 @@
"is-string": "^1.0.5"
}
},
"array-union": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true
},
"array.prototype.flat": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz",
@ -739,6 +929,23 @@
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
"dev": true
},
"dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
"integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
"dev": true,
"requires": {
"path-type": "^4.0.0"
},
"dependencies": {
"path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true
}
}
},
"doctrine": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
@ -821,9 +1028,9 @@
}
},
"esbuild": {
"version": "0.8.43",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.8.43.tgz",
"integrity": "sha512-ZVE2CpootS4jtnfV0bbtJdgRsHEXcMP0P7ZXGfTmNzzhBr2e5ag7Vp3ry0jmw8zduJz4iHzxg4m5jtPxWERz1w==",
"version": "0.8.45",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.8.45.tgz",
"integrity": "sha512-AhR+h/Kat9QMssi0rSJIei0yR+dJ0DQ5aDqnZy4VLu9kOBHdJh8vDSE2XzUlwnm4umvMFnfQTELZlsH7Zmvksw==",
"dev": true
},
"escalade": {
@ -839,12 +1046,12 @@
"dev": true
},
"eslint": {
"version": "7.19.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.19.0.tgz",
"integrity": "sha512-CGlMgJY56JZ9ZSYhJuhow61lMPPjUzWmChFya71Z/jilVos7mR/jPgaEfVGgMBY5DshbKdG8Ezb8FDCHcoMEMg==",
"version": "7.20.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.20.0.tgz",
"integrity": "sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"@babel/code-frame": "7.12.11",
"@eslint/eslintrc": "^0.3.0",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
@ -856,7 +1063,7 @@
"eslint-utils": "^2.1.0",
"eslint-visitor-keys": "^2.0.0",
"espree": "^7.3.1",
"esquery": "^1.2.0",
"esquery": "^1.4.0",
"esutils": "^2.0.2",
"file-entry-cache": "^6.0.0",
"functional-red-black-tree": "^1.0.1",
@ -1077,9 +1284,9 @@
}
},
"eslint-plugin-promise": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz",
"integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz",
"integrity": "sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ==",
"dev": true
},
"eslint-scope": {
@ -1192,6 +1399,20 @@
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"fast-glob": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
"integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==",
"dev": true,
"requires": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.0",
"merge2": "^1.3.0",
"micromatch": "^4.0.2",
"picomatch": "^2.2.1"
}
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
@ -1204,6 +1425,15 @@
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
"dev": true
},
"fastq": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.1.tgz",
"integrity": "sha512-AWuv6Ery3pM+dY7LYS8YIaCiQvUaos9OB1RyNgaOWnaX+Tik7Onvcsf8x8c+YtDeT0maYLniBip2hox5KtEXXA==",
"dev": true,
"requires": {
"reusify": "^1.0.4"
}
},
"file-entry-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz",
@ -1394,6 +1624,28 @@
"type-fest": "^0.8.1"
}
},
"globby": {
"version": "11.0.2",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz",
"integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==",
"dev": true,
"requires": {
"array-union": "^2.1.0",
"dir-glob": "^3.0.1",
"fast-glob": "^3.1.1",
"ignore": "^5.1.4",
"merge2": "^1.3.0",
"slash": "^3.0.0"
},
"dependencies": {
"ignore": {
"version": "5.1.8",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
}
}
},
"google-protobuf": {
"version": "3.14.0",
"resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.14.0.tgz",
@ -1714,6 +1966,22 @@
}
}
},
"merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
"dev": true
},
"micromatch": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true,
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.0.5"
}
},
"mime-db": {
"version": "1.45.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz",
@ -2121,6 +2389,12 @@
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
},
"queue-microtask": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz",
"integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==",
"dev": true
},
"rc": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
@ -2203,12 +2477,12 @@
"dev": true
},
"resolve": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
"integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
"dev": true,
"requires": {
"is-core-module": "^2.1.0",
"is-core-module": "^2.2.0",
"path-parse": "^1.0.6"
}
},
@ -2218,6 +2492,12 @@
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true
},
"reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
"integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
"dev": true
},
"rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
@ -2227,6 +2507,15 @@
"glob": "^7.1.3"
}
},
"run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"dev": true,
"requires": {
"queue-microtask": "^1.2.2"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
@ -2312,6 +2601,12 @@
}
}
},
"slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
"slice-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
@ -2444,9 +2739,9 @@
},
"dependencies": {
"ajv": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.4.tgz",
"integrity": "sha512-xzzzaqgEQfmuhbhAoqjJ8T/1okb6gAzXn/eQRNpAN1AEUoHJTNF9xCDRTtf/s3SKldtZfa+RJeTs+BQq+eZ/sw==",
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-7.1.0.tgz",
"integrity": "sha512-svS9uILze/cXbH0z2myCK2Brqprx/+JJYK5pHicT/GQiBfzzhUVAIT6MwqJg8y4xV/zoGsUeuPuwtoiKSGE15g==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
@ -2511,6 +2806,23 @@
"integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==",
"dev": true
},
"tsutils": {
"version": "3.20.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz",
"integrity": "sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@ -2527,9 +2839,9 @@
"dev": true
},
"typescript": {
"version": "4.2.0-dev.20210208",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.0-dev.20210208.tgz",
"integrity": "sha512-zZD4z9MS8iy9dPxwBeEcQDemi13rfdAk7oCyAaiMQXsw1rcdmdsNGjpaQ8OZiY3I5Y/vaoDCu7yBB1ZaNSemLA==",
"version": "4.3.0-dev.20210213",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.0-dev.20210213.tgz",
"integrity": "sha512-zJG5QIkviTzzYRmKylVXIG2YTV7P18rKLclZu67WypYhsPtaC3KSDD5mOiXJsurDw5rqTqN/OgjQ37cpc11P3A==",
"dev": true
},
"uri-js": {

View File

@ -32,25 +32,28 @@
"@tensorflow/tfjs-layers": "^3.0.0",
"@tensorflow/tfjs-node": "^3.0.0",
"@tensorflow/tfjs-node-gpu": "^3.0.0",
"@types/node": "^14.14.27",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"@vladmandic/pilogger": "^0.2.14",
"chokidar": "^3.5.1",
"dayjs": "^1.10.4",
"esbuild": "^0.8.43",
"eslint": "^7.19.0",
"esbuild": "^0.8.45",
"eslint": "^7.20.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-promise": "^4.3.1",
"rimraf": "^3.0.2",
"seedrandom": "^3.0.5",
"simple-git": "^2.34.2",
"tslib": "^2.1.0",
"typescript": "^4.2.0-dev.20210208"
"typescript": "^4.3.0-dev.20210213"
},
"scripts": {
"start": "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
"lint": "eslint src/*.js demo/*.js",
"lint": "eslint src demo server",
"dev": "npm install && node server/serve.js",
"build": "rimraf dist/* && rimraf types/* && node server/build.js && node server/changelog.js",
"update": "npm update --depth 20 --force && npm dedupe && npm prune && npm audit"

View File

@ -141,13 +141,18 @@ async function httpRequest(req, res) {
async function main() {
log.header();
await watch();
// @ts-ignore
const server1 = http.createServer(options, httpRequest);
server1.on('listening', () => log.state('HTTP server listening:', options.httpPort));
server1.listen(options.httpPort);
const server2 = http2.createSecureServer(options, httpRequest);
server2.on('listening', () => log.state('HTTP2 server listening:', options.httpsPort));
server2.listen(options.httpsPort);
if (options.httpPort && options.httpPort > 0) {
const server1 = http.createServer(options, httpRequest);
server1.on('listening', () => log.state('HTTP server listening:', options.httpPort));
server1.on('error', (err) => log.error('HTTP server:', err.message || err));
server1.listen(options.httpPort);
}
if (options.httpsPort && options.httpsPort > 0) {
const server2 = http2.createSecureServer(options, httpRequest);
server2.on('listening', () => log.state('HTTP2 server listening:', options.httpsPort));
server2.on('error', (err) => log.error('HTTP2 server:', err.message || err));
server2.listen(options.httpsPort);
}
await build.build('all', 'startup');
}

View File

@ -1,63 +0,0 @@
#!/usr/bin/env -S node --no-deprecation --trace-warnings
const fs = require('fs');
const path = require('path');
const log = require('@vladmandic/pilogger');
const tf = require('@tensorflow/tfjs-node');
async function analyzeGraph(modelPath) {
if (!fs.existsSync(modelPath)) log.warn('path does not exist:', modelPath);
const stat = fs.statSync(modelPath);
let model;
if (stat.isFile()) model = await tf.loadGraphModel(`file://${modelPath}`);
else model = await tf.loadGraphModel(`file://${path.join(modelPath, 'model.json')}`);
log.info('graph model:', modelPath, tf.memory());
// log(model.executor.graph.signature.inputs);
// log(model.executor.graph.inputs);
if (model.executor.graph.signature.inputs) {
const inputs = Object.values(model.executor.graph.signature.inputs)[0];
log.data('inputs:', { name: inputs.name, dtype: inputs.dtype, shape: inputs.tensorShape.dim });
} else {
const inputs = model.executor.graph.inputs[0];
log.data('inputs:', { name: inputs.name, dtype: inputs.attrParams.dtype.value, shape: inputs.attrParams.shape.value });
}
const outputs = [];
let i = 0;
if (model.executor.graph.signature.outputs) {
for (const [key, val] of Object.entries(model.executor.graph.signature.outputs)) {
outputs.push({ id: i++, name: key, dytpe: val.dtype, shape: val.tensorShape?.dim });
}
} else {
for (const out of model.executor.graph.outputs) {
outputs.push({ id: i++, name: out.name });
}
}
log.data('outputs:', outputs);
}
async function analyzeSaved(modelPath) {
const meta = await tf.node.getMetaGraphsFromSavedModel(modelPath);
log.info('saved model:', modelPath);
const sign = Object.values(meta[0].signatureDefs)[0];
log.data('tags:', meta[0].tags);
log.data('signature:', Object.keys(meta[0].signatureDefs));
const inputs = Object.values(sign.inputs)[0];
log.data('inputs:', { name: inputs.name, dtype: inputs.dtype, dimensions: inputs.shape?.length });
const outputs = [];
let i = 0;
for (const [key, val] of Object.entries(sign.outputs)) {
outputs.push({ id: i++, name: key, dytpe: val.dtype, dimensions: val.shape?.length });
}
log.data('outputs:', outputs);
}
async function main() {
log.header();
if (process.argv.length !== 3) log.error('path required');
else if (!fs.existsSync(process.argv[2])) log.error(`path does not exist: ${process.argv[2]}`);
else if (fs.existsSync(path.join(process.argv[2], '/saved_model.pb'))) analyzeSaved(process.argv[2]);
else if (fs.existsSync(path.join(process.argv[2], '/model.json')) || process.argv[2].endsWith('.json')) analyzeGraph(process.argv[2]);
else log.error('path does not contain valid model');
}
main();

View File

@ -1,6 +1,6 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as profile from '../profile.js';
import * as profile from '../profile';
let model;
let last = { age: 0 };

View File

@ -36,13 +36,6 @@ const createBox = (startEndTensor) => ({
endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),
});
const scaleBox = (box, factors) => {
const starts = tf.mul(box.startPoint, factors);
const ends = tf.mul(box.endPoint, factors);
const newCoordinates = tf.concat2d([starts, ends], 1);
return createBox(newCoordinates);
};
function decodeBounds(boxOutputs, anchors, inputSize) {
const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);
const centers = tf.add(boxStarts, anchors);
@ -58,13 +51,6 @@ function decodeBounds(boxOutputs, anchors, inputSize) {
return tf.concat2d([startNormalized, endNormalized], concatAxis);
}
function scaleBoxFromPrediction(face, scaleFactor) {
return tf.tidy(() => {
const box = face['box'] ? face['box'] : face;
return scaleBox(box, scaleFactor).startEndTensor.squeeze();
});
}
export class BlazeFaceModel {
blazeFaceModel: any;
width: number;

View File

@ -1,8 +1,8 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as blazeface from './blazeface.js';
import * as facepipeline from './facepipeline.js';
import * as coords from './coords.js';
import * as blazeface from './blazeface';
import * as facepipeline from './facepipeline';
import * as coords from './coords';
export class MediaPipeFaceMesh {
facePipeline: any;

View File

@ -2,9 +2,7 @@
import * as tf from '../../dist/tfjs.esm.js';
import * as bounding from './box';
import * as util from './util';
import * as coords from './coords.js';
// eslint-disable-next-line no-unused-vars
import { log } from '../log';
import * as coords from './coords';
const LANDMARKS_COUNT = 468;
const MESH_MOUTH_INDEX = 13;

View File

@ -1,6 +1,6 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as profile from '../profile.js';
import * as profile from '../profile';
// based on https://github.com/sirius-ai/MobileFaceNet_TF
// model converted from https://github.com/sirius-ai/MobileFaceNet_TF/files/3551493/FaceMobileNet192_train_false.zip

View File

@ -1,6 +1,6 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as profile from '../profile.js';
import * as profile from '../profile';
const annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral'];
let model;

View File

@ -1,6 +1,6 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as profile from '../profile.js';
import * as profile from '../profile';
export class FaceBoxes {
enlarge: number;
@ -44,14 +44,14 @@ export class FaceBoxes {
const crop = [boxes[i][0] / this.enlarge, boxes[i][1] / this.enlarge, boxes[i][2] * this.enlarge, boxes[i][3] * this.enlarge];
const boxRaw = [crop[1], crop[0], (crop[3]) - (crop[1]), (crop[2]) - (crop[0])];
const box = [
parseInt((boxRaw[0] * input.shape[2]).toString()),
parseInt((boxRaw[1] * input.shape[1]).toString()),
parseInt((boxRaw[0] * input.shape[2]).toString()),
parseInt((boxRaw[1] * input.shape[1]).toString()),
parseInt((boxRaw[2] * input.shape[2]).toString()),
parseInt((boxRaw[3] * input.shape[1]).toString())];
const resized = tf.image.cropAndResize(input, [crop], [0], [this.config.face.detector.inputSize, this.config.face.detector.inputSize]);
const image = resized.div([255]);
resized.dispose();
results.push({ confidence: scores[i], box, boxRaw: this.config.face.mesh.returnRawData ? boxRaw : null, image, });
results.push({ confidence: scores[i], box, boxRaw: this.config.face.mesh.returnRawData ? boxRaw : null, image });
// add mesh, meshRaw, annotations,
}
}

View File

@ -1,6 +1,6 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as profile from '../profile.js';
import * as profile from '../profile';
let model;
let last = { gender: '' };

View File

@ -62,7 +62,7 @@ export const hand = (res) => {
if (!res) return [];
const gestures: Array<{ hand: number, gesture: string }> = [];
for (let i = 0; i < res.length; i++) {
const fingers: Array<{ name: string, position: number }> = [];
const fingers: Array<{ name: string, position: number }> = [];
for (const [finger, pos] of Object.entries(res[i]['annotations'])) {
// @ts-ignore
if (finger !== 'palmBase') fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger

View File

@ -1,8 +1,6 @@
import * as tf from '../../dist/tfjs.esm.js';
import * as box from './box';
import * as util from './util';
// eslint-disable-next-line no-unused-vars
import { log } from '../log';
// const PALM_BOX_SHIFT_VECTOR = [0, -0.4];
const PALM_BOX_ENLARGE_FACTOR = 5; // default 3

View File

@ -15,7 +15,6 @@ import * as profile from './profile';
import * as config from '../config';
import * as sample from './sample';
import * as app from '../package.json';
import { NodeFileSystem } from '@tensorflow/tfjs-node/dist/io/file_system';
// helper function: gets elapsed time on both browser and nodejs
const now = () => {

View File

@ -2,7 +2,7 @@ import { log } from './log';
export const data = {};
export function run(name, raw) {
export function run(name: string, raw: any) {
if (!raw || !raw.kernels) return;
const maxResults = 5;
const time = raw.kernels