diff --git a/.eslintrc.json b/.eslintrc.json index 47a0e3fa..68c316b0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,6 +26,11 @@ ], "ignorePatterns": [ "dist", "assets", "media", "models", "node_modules" ], "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", "dot-notation": "off", "func-names": "off", @@ -33,8 +38,9 @@ "import/extensions": "off", "import/no-absolute-path": "off", "import/no-extraneous-dependencies": "off", - "import/prefer-default-export": "off", "import/no-unresolved": "off", + "import/prefer-default-export": "off", + "lines-between-class-members": "off", "max-len": [1, 275, 3], "newline-per-chained-call": "off", "no-async-promise-executor": "off", @@ -51,13 +57,10 @@ "no-restricted-syntax": "off", "no-return-assign": "off", "no-underscore-dangle": "off", + "node/no-missing-import": ["error", { "tryExtensions": [".js", ".json", ".ts"] }], "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", @@ -65,11 +68,6 @@ "promise/always-return": "off", "promise/catch-or-return": "off", "promise/no-nesting": "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" + "radix": "off" } } \ No newline at end of file diff --git a/src/handpose/handdetector.ts b/src/handpose/handdetector.ts index 043d945b..27d50a63 100644 --- a/src/handpose/handdetector.ts +++ b/src/handpose/handdetector.ts @@ -7,7 +7,7 @@ export class HandDetector { anchorsTensor: any; inputSizeTensor: any; doubleInputSizeTensor: any; - + constructor(model, inputSize, anchorsAnnotated) { this.model = model; this.anchors = anchorsAnnotated.map((anchor) => [anchor.x_center, anchor.y_center]); @@ -49,7 +49,7 @@ export class HandDetector { scoresT.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) { if (scores[index] >= config.hand.minConfidence) { 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 predictions = await this.getBoxes(image, config); image.dispose(); - const hands: Array<{}> = []; + const hands: Array<{}> = []; if (!predictions || predictions.length === 0) return hands; for (const prediction of predictions) { const boxes = prediction.box.dataSync();