mirror of https://github.com/vladmandic/human
update lint rules
parent
ab4759bf18
commit
a7236700ce
|
@ -26,6 +26,11 @@
|
||||||
],
|
],
|
||||||
"ignorePatterns": [ "dist", "assets", "media", "models", "node_modules" ],
|
"ignorePatterns": [ "dist", "assets", "media", "models", "node_modules" ],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
|
"@typescript-eslint/ban-types": "off",
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
"camelcase": "off",
|
"camelcase": "off",
|
||||||
"dot-notation": "off",
|
"dot-notation": "off",
|
||||||
"func-names": "off",
|
"func-names": "off",
|
||||||
|
@ -33,8 +38,9 @@
|
||||||
"import/extensions": "off",
|
"import/extensions": "off",
|
||||||
"import/no-absolute-path": "off",
|
"import/no-absolute-path": "off",
|
||||||
"import/no-extraneous-dependencies": "off",
|
"import/no-extraneous-dependencies": "off",
|
||||||
"import/prefer-default-export": "off",
|
|
||||||
"import/no-unresolved": "off",
|
"import/no-unresolved": "off",
|
||||||
|
"import/prefer-default-export": "off",
|
||||||
|
"lines-between-class-members": "off",
|
||||||
"max-len": [1, 275, 3],
|
"max-len": [1, 275, 3],
|
||||||
"newline-per-chained-call": "off",
|
"newline-per-chained-call": "off",
|
||||||
"no-async-promise-executor": "off",
|
"no-async-promise-executor": "off",
|
||||||
|
@ -51,13 +57,10 @@
|
||||||
"no-restricted-syntax": "off",
|
"no-restricted-syntax": "off",
|
||||||
"no-return-assign": "off",
|
"no-return-assign": "off",
|
||||||
"no-underscore-dangle": "off",
|
"no-underscore-dangle": "off",
|
||||||
|
"node/no-missing-import": ["error", { "tryExtensions": [".js", ".json", ".ts"] }],
|
||||||
"node/no-unpublished-import": "off",
|
"node/no-unpublished-import": "off",
|
||||||
"node/no-unpublished-require": "off",
|
"node/no-unpublished-require": "off",
|
||||||
"node/no-unsupported-features/es-syntax": "off",
|
"node/no-unsupported-features/es-syntax": "off",
|
||||||
"node/no-missing-import": ["error", {
|
|
||||||
"allowModules": [],
|
|
||||||
"tryExtensions": [".js", ".json", ".ts"]
|
|
||||||
}],
|
|
||||||
"node/shebang": "off",
|
"node/shebang": "off",
|
||||||
"object-curly-newline": "off",
|
"object-curly-newline": "off",
|
||||||
"prefer-destructuring": "off",
|
"prefer-destructuring": "off",
|
||||||
|
@ -65,11 +68,6 @@
|
||||||
"promise/always-return": "off",
|
"promise/always-return": "off",
|
||||||
"promise/catch-or-return": "off",
|
"promise/catch-or-return": "off",
|
||||||
"promise/no-nesting": "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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@ export class HandDetector {
|
||||||
anchorsTensor: any;
|
anchorsTensor: any;
|
||||||
inputSizeTensor: any;
|
inputSizeTensor: any;
|
||||||
doubleInputSizeTensor: any;
|
doubleInputSizeTensor: any;
|
||||||
|
|
||||||
constructor(model, inputSize, anchorsAnnotated) {
|
constructor(model, inputSize, anchorsAnnotated) {
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.anchors = anchorsAnnotated.map((anchor) => [anchor.x_center, anchor.y_center]);
|
this.anchors = anchorsAnnotated.map((anchor) => [anchor.x_center, anchor.y_center]);
|
||||||
|
@ -49,7 +49,7 @@ export class HandDetector {
|
||||||
|
|
||||||
scoresT.dispose();
|
scoresT.dispose();
|
||||||
filteredT.dispose();
|
filteredT.dispose();
|
||||||
const hands: Array<{ box: any, palmLandmarks: any, confidence: number }> = [];
|
const hands: Array<{ box: any, palmLandmarks: any, confidence: number }> = [];
|
||||||
for (const index of filtered) {
|
for (const index of filtered) {
|
||||||
if (scores[index] >= config.hand.minConfidence) {
|
if (scores[index] >= config.hand.minConfidence) {
|
||||||
const matchingBox = tf.slice(boxes, [index, 0], [1, -1]);
|
const matchingBox = tf.slice(boxes, [index, 0], [1, -1]);
|
||||||
|
@ -70,7 +70,7 @@ export class HandDetector {
|
||||||
const image = tf.tidy(() => input.resizeBilinear([config.hand.inputSize, config.hand.inputSize]).div(127.5).sub(1));
|
const image = tf.tidy(() => input.resizeBilinear([config.hand.inputSize, config.hand.inputSize]).div(127.5).sub(1));
|
||||||
const predictions = await this.getBoxes(image, config);
|
const predictions = await this.getBoxes(image, config);
|
||||||
image.dispose();
|
image.dispose();
|
||||||
const hands: Array<{}> = [];
|
const hands: Array<{}> = [];
|
||||||
if (!predictions || predictions.length === 0) return hands;
|
if (!predictions || predictions.length === 0) return hands;
|
||||||
for (const prediction of predictions) {
|
for (const prediction of predictions) {
|
||||||
const boxes = prediction.box.dataSync();
|
const boxes = prediction.box.dataSync();
|
||||||
|
|
Loading…
Reference in New Issue