diff --git a/README.md b/README.md
index 8d2bdd37..7fd74db9 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@ Detailed configuration options are explained below, but they are best seen in th
## Installation
**Important**
-*The packaged (IIFE and ESM) version of `Human` includes `TensorFlow/JS (TFJS) 2.6.0` library which can be accessed via `human.tf`*
+*The packaged (IIFE and ESM) version of `Human` includes `TensorFlow/JS (TFJS) 2.7.0` library which can be accessed via `human.tf`*
*You should NOT manually load another instance of `tfjs`, but if you do, be aware of possible version conflicts*
There are multiple ways to use `Human` library, pick one that suits you:
@@ -253,6 +253,12 @@ config = {
filter: { // note: image filters are only available in Browser environments and not in NodeJS as they require WebGL for processing
enabled: true, // enable image pre-processing filters
return: true, // return processed canvas imagedata in result
+ width: 0, // resize input width
+ height: 0, // resize input height
+ // usefull on low-performance devices to reduce the size of processed input
+ // if both width and height are set to 0, there is no resizing
+ // if just one is set, second one is scaled automatically
+ // if both are set, values are used as-is
brightness: 0, // range: -1 (darken) to 1 (lighten)
contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)
sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)
@@ -436,7 +442,7 @@ Performance will vary depending on your hardware, but also on number of resoluti
For example, it can perform multiple face detections at 60+ FPS, but drops to ~15 FPS on a medium complex images if all modules are enabled
-### Performance per module on a **notebook** with nVidia GTX1050 GPU:
+### Performance per module on a **notebook** with nVidia GTX1050 GPU on a FullHD input:
- Enabled all: 15 FPS
- Image filters: 80 FPS (standalone)
@@ -449,7 +455,7 @@ For example, it can perform multiple face detections at 60+ FPS, but drops to ~1
- Hand: 40 FPS (standalone)
- Body: 50 FPS (standalone)
-### Performance per module on a **smartphone** with Snapdragon 855:
+### Performance per module on a **smartphone** with Snapdragon 855 on a FullHD input:
- Enabled all: 3 FPS
- Image filters: 30 FPS (standalone)
diff --git a/config.js b/config.js
index 01b59669..703a963c 100644
--- a/config.js
+++ b/config.js
@@ -10,6 +10,11 @@ export default {
videoOptimized: true, // perform additional optimizations when input is video, must be disabled for images
filter: {
enabled: true, // enable image pre-processing filters
+ width: 0, // resize input width
+ height: 0, // resize input height
+ // if both width and height are set to 0, there is no resizing
+ // if just one is set, second one is scaled automatically
+ // if both are set, values are used as-is
return: true, // return processed canvas imagedata in result
brightness: 0, // range: -1 (darken) to 1 (lighten)
contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)
diff --git a/demo/browser.js b/demo/browser.js
index d144ebb9..87bb7534 100644
--- a/demo/browser.js
+++ b/demo/browser.js
@@ -7,6 +7,7 @@ const human = new Human();
// ui options
const ui = {
baseColor: 'rgba(173, 216, 230, 0.3)', // this is 'lightblue', just with alpha channel
+ baseBackground: 'rgba(50, 50, 50, 1)', // this is 'lightblue', just with alpha channel
baseLabel: 'rgba(173, 216, 230, 0.9)',
baseFontProto: 'small-caps {size} "Segoe UI"',
baseLineWidth: 16,
@@ -29,7 +30,23 @@ const ui = {
// configuration overrides
const config = {
backend: 'webgl', // if you want to use 'wasm' backend, enable script load of tf and tf-backend-wasm in index.html
- filter: { enabled: true, brightness: 0, contrast: 0, sharpness: 0, blur: 0, saturation: 0, hue: 0, negative: false, sepia: false, vintage: false, kodachrome: false, technicolor: false, polaroid: false, pixelate: 0 },
+ filter: {
+ enabled: true,
+ width: 720,
+ height: 0,
+ brightness: 0,
+ contrast: 0,
+ sharpness: 0,
+ blur: 0,
+ saturation: 0,
+ hue: 0,
+ negative: false,
+ sepia: false,
+ vintage: false,
+ kodachrome: false,
+ technicolor: false,
+ polaroid: false,
+ pixelate: 0 },
videoOptimized: true,
face: {
enabled: true,
@@ -80,7 +97,9 @@ function drawResults(input, result, canvas) {
// draw image from video
const ctx = canvas.getContext('2d');
- if (result.canvas) ctx.drawImage(result.canvas, 0, 0, result.canvas.width, result.canvas.height, 0, 0, canvas.width, canvas.height);
+ ctx.fillStyle = ui.baseBackground;
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
+ if (result.canvas) ctx.drawImage(result.canvas, 0, 0, result.canvas.width, result.canvas.height, 0, 0, result.canvas.width, result.canvas.height);
else ctx.drawImage(input, 0, 0, input.width, input.height, 0, 0, canvas.width, canvas.height);
// draw all results
draw.face(result.face, canvas, ui, human.facemesh.triangulation);
@@ -130,8 +149,8 @@ async function setupCamera() {
video.onloadeddata = async () => {
video.width = video.videoWidth;
video.height = video.videoHeight;
- canvas.width = video.videoWidth;
- canvas.height = video.videoHeight;
+ canvas.width = video.width;
+ canvas.height = video.height;
if (live) video.play();
ui.busy = false;
// do once more because onresize events can be delayed or skipped
@@ -194,8 +213,8 @@ async function processImage(input) {
const canvas = document.getElementById('canvas');
image.width = image.naturalWidth;
image.height = image.naturalHeight;
- canvas.width = image.naturalWidth;
- canvas.height = image.naturalHeight;
+ canvas.width = config.filter.width && config.filter.width > 0 ? config.filter.width : image.naturalWidth;
+ canvas.height = config.filter.height && config.filter.height > 0 ? config.filter.height : image.naturalHeight;
const result = await human.detect(image, config);
drawResults(image, result, canvas);
const thumb = document.createElement('canvas');
@@ -302,6 +321,8 @@ function setupMenu() {
menuFX.addHTML('
');
menuFX.addLabel('Image Filters');
menuFX.addBool('Enabled', config.filter, 'enabled');
+ menuFX.addRange('Image width', config.filter, 'width', 100, 3840, 10, (val) => config.filter.width = parseInt(val));
+ menuFX.addRange('Image height', config.filter, 'height', 100, 2160, 10, (val) => config.filter.height = parseInt(val));
menuFX.addRange('Brightness', config.filter, 'brightness', -1.0, 1.0, 0.05, (val) => config.filter.brightness = parseFloat(val));
menuFX.addRange('Contrast', config.filter, 'contrast', -1.0, 1.0, 0.05, (val) => config.filter.contrast = parseFloat(val));
menuFX.addRange('Sharpness', config.filter, 'sharpness', 0, 1.0, 0.05, (val) => config.filter.sharpness = parseFloat(val));
diff --git a/dist/human.cjs b/dist/human.cjs
index b80957ed..6f74f996 100644
--- a/dist/human.cjs
+++ b/dist/human.cjs
@@ -1,4 +1,5 @@
-var __defineProperty = Object.defineProperty;
+var __defProp = Object.defineProperty;
+var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
var __commonJS = (callback, module2) => () => {
if (!module2) {
module2 = {exports: {}};
@@ -6,13 +7,10 @@ var __commonJS = (callback, module2) => () => {
}
return module2.exports;
};
-var __markAsModule = (target) => {
- return __defineProperty(target, "__esModule", {value: true});
-};
var __export = (target, all) => {
__markAsModule(target);
for (var name in all)
- __defineProperty(target, name, {get: all[name], enumerable: true});
+ __defProp(target, name, {get: all[name], enumerable: true});
};
// src/facemesh/blazeface.js
@@ -5688,6 +5686,8 @@ var require_config = __commonJS((exports2) => {
videoOptimized: true,
filter: {
enabled: true,
+ width: 0,
+ height: 0,
return: true,
brightness: 0,
contrast: 0,
@@ -5777,7 +5777,7 @@ var require_config = __commonJS((exports2) => {
var require_package = __commonJS((exports2, module2) => {
module2.exports = {
name: "@vladmandic/human",
- version: "0.4.2",
+ version: "0.4.3",
description: "human: 3D Face Detection, Iris Tracking and Age & Gender Prediction",
sideEffects: false,
main: "dist/human.cjs",
@@ -5799,19 +5799,19 @@ var require_package = __commonJS((exports2, module2) => {
dependencies: {},
peerDependencies: {},
devDependencies: {
+ "@tensorflow/tfjs": "^2.7.0",
+ "@tensorflow/tfjs-node": "^2.7.0",
"@vladmandic/pilogger": "^0.2.6",
- dayjs: "^1.9.3",
- "simple-git": "^2.21.0",
- "@tensorflow/tfjs": "^2.6.0",
- "@tensorflow/tfjs-node": "^2.6.0",
- esbuild: "^0.7.15",
- eslint: "^7.10.0",
+ dayjs: "^1.9.4",
+ esbuild: "^0.7.21",
+ eslint: "^7.12.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
- rimraf: "^3.0.2"
+ rimraf: "^3.0.2",
+ "simple-git": "^2.21.0"
},
scripts: {
start: "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
@@ -5962,14 +5962,24 @@ class Human {
tfImage(input) {
let filtered;
if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {
- const width = input.naturalWidth || input.videoWidth || input.width || input.shape && input.shape[1] > 0;
- const height = input.naturalHeight || input.videoHeight || input.height || input.shape && input.shape[2] > 0;
- const offscreenCanvas = new OffscreenCanvas(width, height);
+ const originalWidth = input.naturalWidth || input.videoWidth || input.width || input.shape && input.shape[1] > 0;
+ const originalHeight = input.naturalHeight || input.videoHeight || input.height || input.shape && input.shape[2] > 0;
+ let targetWidth = originalWidth;
+ if (this.config.filter.width > 0)
+ targetWidth = this.config.filter.width;
+ else if (this.config.filter.height > 0)
+ targetWidth = originalWidth * (this.config.filter.height / originalHeight);
+ let targetHeight = originalHeight;
+ if (this.config.filter.height > 0)
+ targetHeight = this.config.filter.height;
+ else if (this.config.filter.width > 0)
+ targetHeight = originalHeight * (this.config.filter.width / originalWidth);
+ const offscreenCanvas = new OffscreenCanvas(targetWidth, targetHeight);
const ctx = offscreenCanvas.getContext("2d");
if (input instanceof ImageData)
ctx.putImageData(input, 0, 0);
else
- ctx.drawImage(input, 0, 0, width, height, 0, 0, offscreenCanvas.width, offscreenCanvas.height);
+ ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, offscreenCanvas.width, offscreenCanvas.height);
this.fx.reset();
this.fx.addFilter("brightness", this.config.filter.brightness);
if (this.config.filter.contrast !== 0)
diff --git a/dist/human.cjs.json b/dist/human.cjs.json
index 2c233a35..5a94a24c 100644
--- a/dist/human.cjs.json
+++ b/dist/human.cjs.json
@@ -1,7 +1,7 @@
{
"inputs": {
"config.js": {
- "bytes": 5942,
+ "bytes": 6295,
"imports": []
},
"package.json": {
@@ -116,7 +116,7 @@
"imports": []
},
"src/human.js": {
- "bytes": 11355,
+ "bytes": 11887,
"imports": [
{
"path": "src/facemesh/facemesh.js"
@@ -260,7 +260,7 @@
"dist/human.cjs.map": {
"imports": [],
"inputs": {},
- "bytes": 263891
+ "bytes": 260858
},
"dist/human.cjs": {
"imports": [],
@@ -350,7 +350,7 @@
"bytesInOutput": 20197
},
"config.js": {
- "bytesInOutput": 2199
+ "bytesInOutput": 2232
},
"package.json": {
"bytesInOutput": 2750
@@ -359,10 +359,10 @@
"bytesInOutput": 47
},
"src/human.js": {
- "bytesInOutput": 10193
+ "bytesInOutput": 10755
}
},
- "bytes": 154534
+ "bytes": 155094
}
}
}
diff --git a/dist/human.cjs.map b/dist/human.cjs.map
index c7027ea6..18667c2a 100644
--- a/dist/human.cjs.map
+++ b/dist/human.cjs.map
@@ -1,7 +1,7 @@
{
"version": 3,
"sources": ["../src/facemesh/blazeface.js", "../src/facemesh/keypoints.js", "../src/facemesh/box.js", "../src/facemesh/util.js", "../src/facemesh/pipeline.js", "../src/facemesh/uvcoords.js", "../src/facemesh/triangulation.js", "../src/facemesh/facemesh.js", "../src/ssrnet/ssrnet.js", "../src/emotion/emotion.js", "../src/posenet/modelBase.js", "../src/posenet/modelMobileNet.js", "../src/posenet/heapSort.js", "../src/posenet/buildParts.js", "../src/posenet/keypoints.js", "../src/posenet/vectors.js", "../src/posenet/decodePose.js", "../src/posenet/decodeMultiple.js", "../src/posenet/util.js", "../src/posenet/modelPoseNet.js", "../src/posenet/posenet.js", "../src/handpose/box.js", "../src/handpose/handdetector.js", "../src/handpose/keypoints.js", "../src/handpose/util.js", "../src/handpose/pipeline.js", "../src/handpose/handpose.js", "../src/imagefx.js", "../config.js", "../src/human.js", "../src/human.js"],
- "sourcesContent": ["const tf = require('@tensorflow/tfjs');\n\nconst NUM_LANDMARKS = 6;\n\nfunction generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) {\n anchors.push([anchorX, anchorY]);\n }\n }\n }\n }\n return anchors;\n}\n\nconst disposeBox = (box) => {\n box.startEndTensor.dispose();\n box.startPoint.dispose();\n box.endPoint.dispose();\n};\n\nconst createBox = (startEndTensor) => ({\n startEndTensor,\n startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]),\n endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),\n});\n\nconst scaleBox = (box, factors) => {\n const starts = tf.mul(box.startPoint, factors);\n const ends = tf.mul(box.endPoint, factors);\n const newCoordinates = tf.concat2d([starts, ends], 1);\n return createBox(newCoordinates);\n};\n\nfunction decodeBounds(boxOutputs, anchors, inputSize) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nfunction scaleBoxFromPrediction(face, scaleFactor) {\n return tf.tidy(() => {\n const box = face['box'] ? face['box'] : face;\n return scaleBox(box, scaleFactor).startEndTensor.squeeze();\n });\n}\n\nclass BlazeFaceModel {\n constructor(model, config) {\n this.blazeFaceModel = model;\n this.width = config.detector.inputSize;\n this.height = config.detector.inputSize;\n this.maxFaces = config.detector.maxFaces;\n this.anchorsData = generateAnchors(config.detector.inputSize);\n this.anchors = tf.tensor2d(this.anchorsData);\n this.inputSize = tf.tensor1d([this.width, this.height]);\n this.iouThreshold = config.detector.iouThreshold;\n this.scaleFaces = 0.8;\n this.scoreThreshold = config.detector.scoreThreshold;\n }\n\n // toto blazeface leaks two tensors per run\n async getBoundingBoxes(inputImage) {\n // sanity check on input\n if ((!inputImage) || (inputImage.isDisposedInternal) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return null;\n const [detectedOutputs, boxes, scores] = tf.tidy(() => {\n const resizedImage = inputImage.resizeBilinear([this.width, this.height]);\n const normalizedImage = tf.mul(tf.sub(resizedImage.div(255), 0.5), 2);\n const batchedPrediction = this.blazeFaceModel.predict(normalizedImage);\n let prediction;\n // are we using tfhub or pinto converted model?\n if (Array.isArray(batchedPrediction)) {\n const sorted = batchedPrediction.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n prediction = concat.squeeze(0);\n } else {\n prediction = batchedPrediction.squeeze(); // when using tfhub model\n }\n const decodedBounds = decodeBounds(prediction, this.anchors, this.inputSize);\n const logits = tf.slice(prediction, [0, 0], [-1, 1]);\n const scoresOut = tf.sigmoid(logits).squeeze();\n return [prediction, decodedBounds, scoresOut];\n });\n const boxIndicesTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.maxFaces, this.iouThreshold, this.scoreThreshold);\n const boxIndices = await boxIndicesTensor.array();\n boxIndicesTensor.dispose();\n const boundingBoxesMap = boxIndices.map((boxIndex) => tf.slice(boxes, [boxIndex, 0], [1, -1]));\n const boundingBoxes = await Promise.all(boundingBoxesMap.map(async (boundingBox) => {\n const vals = await boundingBox.array();\n boundingBox.dispose();\n return vals;\n }));\n const annotatedBoxes = [];\n for (let i = 0; i < boundingBoxes.length; i++) {\n const boundingBox = boundingBoxes[i];\n const box = createBox(boundingBox);\n const boxIndex = boxIndices[i];\n const anchor = this.anchorsData[boxIndex];\n const sliced = tf.slice(detectedOutputs, [boxIndex, NUM_LANDMARKS - 1], [1, -1]);\n const squeezed = sliced.squeeze();\n const landmarks = squeezed.reshape([NUM_LANDMARKS, -1]);\n /*\n const landmarks = tf\n .slice(detectedOutputs, [boxIndex, NUM_LANDMARKS - 1], [1, -1])\n .squeeze()\n .reshape([NUM_LANDMARKS, -1]);\n */\n const probability = tf.slice(scores, [boxIndex], [1]);\n const annotatedBox = { box, landmarks, probability, anchor };\n annotatedBoxes.push(annotatedBox);\n sliced.dispose();\n squeezed.dispose();\n // landmarks.dispose();\n }\n detectedOutputs.dispose();\n boxes.dispose();\n scores.dispose();\n detectedOutputs.dispose();\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / this.width, inputImage.shape[1] / this.height],\n };\n }\n\n async estimateFaces(input) {\n const { boxes, scaleFactor } = await this.getBoundingBoxes(input);\n return Promise.all(boxes.map(async (face) => {\n const scaledBox = scaleBoxFromPrediction(face, scaleFactor);\n const [landmarkData, boxData, probabilityData] = await Promise.all([face.landmarks, scaledBox, face.probability].map(async (d) => d.array()));\n const anchor = face.anchor;\n const [scaleFactorX, scaleFactorY] = scaleFactor;\n const scaledLandmarks = landmarkData\n .map((landmark) => ([\n (landmark[0] + anchor[0]) * scaleFactorX,\n (landmark[1] + anchor[1]) * scaleFactorY,\n ]));\n const normalizedFace = {\n topLeft: boxData.slice(0, 2),\n bottomRight: boxData.slice(2),\n landmarks: scaledLandmarks,\n probability: probabilityData,\n };\n disposeBox(face.box);\n face.landmarks.dispose();\n face.probability.dispose();\n scaledBox.dispose();\n return normalizedFace;\n }));\n }\n}\n\nasync function load(config) {\n const blazeface = await tf.loadGraphModel(config.detector.modelPath, { fromTFHub: config.detector.modelPath.includes('tfhub.dev') });\n const model = new BlazeFaceModel(blazeface, config);\n return model;\n}\n\nexports.load = load;\nexports.BlazeFaceModel = BlazeFaceModel;\nexports.disposeBox = disposeBox;\n", "exports.MESH_ANNOTATIONS = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\nexports.MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n", "const tf = require('@tensorflow/tfjs');\n\nfunction scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n}\nexports.scaleBoxCoordinates = scaleBoxCoordinates;\nfunction getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\nexports.getBoxSize = getBoxSize;\nfunction getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\nexports.getBoxCenter = getBoxCenter;\nfunction cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\nexports.cutBoxFromImageAndResize = cutBoxFromImageAndResize;\nfunction enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\nexports.enlargeBox = enlargeBox;\nfunction squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\nexports.squarifyBox = squarifyBox;\n", "exports.IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n/**\n * Normalizes the provided angle to the range -pi to pi.\n * @param angle The angle in radians to be normalized.\n */\nfunction normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\nexports.normalizeRadians = normalizeRadians;\n/**\n * Computes the angle of rotation between two anchor points.\n * @param point1 First anchor point\n * @param point2 Second anchor point\n */\nfunction computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\nexports.computeRotation = computeRotation;\nfunction radToDegrees(rad) {\n return rad * 180 / Math.PI;\n}\nexports.radToDegrees = radToDegrees;\nfunction buildTranslationMatrix(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n}\nfunction dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\nexports.dot = dot;\nfunction getColumnFrom2DArr(arr, columnIndex) {\n const column = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\nexports.getColumnFrom2DArr = getColumnFrom2DArr;\nfunction multiplyTransformMatrices(mat1, mat2) {\n const product = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\nfunction buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\nexports.buildRotationMatrix = buildRotationMatrix;\nfunction invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\nexports.invertTransformMatrix = invertTransformMatrix;\nfunction rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\nexports.rotatePoint = rotatePoint;\nfunction xyDistanceBetweenPoints(a, b) {\n return Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n}\nexports.xyDistanceBetweenPoints = xyDistanceBetweenPoints;\n", "/* eslint-disable class-methods-use-this */\nconst tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\nconst keypoints = require('./keypoints');\nconst util = require('./util');\n\nconst LANDMARKS_COUNT = 468;\nconst UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD = 0.25;\nconst MESH_MOUTH_INDEX = 13;\nconst MESH_KEYPOINTS_LINE_OF_SYMMETRY_INDICES = [MESH_MOUTH_INDEX, keypoints.MESH_ANNOTATIONS['midwayBetweenEyes'][0]];\nconst BLAZEFACE_MOUTH_INDEX = 3;\nconst BLAZEFACE_NOSE_INDEX = 2;\nconst BLAZEFACE_KEYPOINTS_LINE_OF_SYMMETRY_INDICES = [BLAZEFACE_MOUTH_INDEX, BLAZEFACE_NOSE_INDEX];\nconst LEFT_EYE_OUTLINE = keypoints.MESH_ANNOTATIONS['leftEyeLower0'];\nconst LEFT_EYE_BOUNDS = [LEFT_EYE_OUTLINE[0], LEFT_EYE_OUTLINE[LEFT_EYE_OUTLINE.length - 1]];\nconst RIGHT_EYE_OUTLINE = keypoints.MESH_ANNOTATIONS['rightEyeLower0'];\nconst RIGHT_EYE_BOUNDS = [RIGHT_EYE_OUTLINE[0], RIGHT_EYE_OUTLINE[RIGHT_EYE_OUTLINE.length - 1]];\nconst IRIS_UPPER_CENTER_INDEX = 3;\nconst IRIS_LOWER_CENTER_INDEX = 4;\nconst IRIS_IRIS_INDEX = 71;\nconst IRIS_NUM_COORDINATES = 76;\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates. Update the z coordinate to be an average of the original and the new. This produces the best visual effect.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < keypoints.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = keypoints.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = keypoints.MESH_ANNOTATIONS[`${prefix}${key}`];\n const shouldReplaceAllKeys = keys == null;\n if (shouldReplaceAllKeys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n// The Pipeline coordinates between the bounding box and skeleton models.\nclass Pipeline {\n constructor(boundingBoxDetector, meshDetector, irisModel, config) {\n // An array of facial bounding boxes.\n this.regionsOfInterest = [];\n this.runsWithoutFaceDetector = 0;\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.irisModel = irisModel;\n this.meshWidth = config.mesh.inputSize;\n this.meshHeight = config.mesh.inputSize;\n this.irisSize = config.iris.inputSize;\n this.irisEnlarge = config.iris.enlargeFactor;\n }\n\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const scaleFactor = [boxSize[0] / this.meshWidth, boxSize[1] / this.meshHeight];\n const coordsScaled = rawCoords.map((coord) => ([\n scaleFactor[0] * (coord[0] - this.meshWidth / 2),\n scaleFactor[1] * (coord[1] - this.meshHeight / 2), coord[2],\n ]));\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => ([...util.rotatePoint(coord, coordsRotationMatrix), coord[2]]));\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => ([\n coord[0] + originalBoxCenter[0],\n coord[1] + originalBoxCenter[1], coord[2],\n ]));\n }\n\n getLeftToRightEyeDepthDifference(rawCoords) {\n const leftEyeZ = rawCoords[LEFT_EYE_BOUNDS[0]][2];\n const rightEyeZ = rawCoords[RIGHT_EYE_BOUNDS[0]][2];\n return leftEyeZ - rightEyeZ;\n }\n\n // Returns a box describing a cropped region around the eye fit for passing to the iris model.\n getEyeBox(rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false) {\n const box = bounding.squarifyBox(bounding.enlargeBox(this.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), this.irisEnlarge));\n const boxSize = bounding.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / this.meshHeight,\n box.startPoint[0] / this.meshWidth, box.endPoint[1] / this.meshHeight,\n box.endPoint[0] / this.meshWidth,\n ]], [0], [this.irisSize, this.irisSize]);\n if (flip) {\n crop = tf.image.flipLeftRight(crop);\n }\n return { box, boxSize, crop };\n }\n\n // Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\n getEyeCoords(eyeData, eyeBox, eyeBoxSize, flip = false) {\n const eyeRawCoords = [];\n for (let i = 0; i < IRIS_NUM_COORDINATES; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip\n ? (1 - (x / this.irisSize))\n : (x / this.irisSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / this.irisSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(IRIS_IRIS_INDEX) };\n }\n\n // The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n getAdjustedIrisCoords(rawCoords, irisCoords, direction) {\n const upperCenterZ = rawCoords[keypoints.MESH_ANNOTATIONS[`${direction}EyeUpper0`][IRIS_UPPER_CENTER_INDEX]][2];\n const lowerCenterZ = rawCoords[keypoints.MESH_ANNOTATIONS[`${direction}EyeLower0`][IRIS_LOWER_CENTER_INDEX]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n }\n\n async predict(input, config) {\n this.skipFrames = config.detector.skipFrames;\n this.maxFaces = config.detector.maxFaces;\n this.runsWithoutFaceDetector++;\n if (this.shouldUpdateRegionsOfInterest()) {\n const detector = await this.boundingBoxDetector.getBoundingBoxes(input);\n if (detector.boxes.length === 0) {\n this.regionsOfInterest = [];\n return null;\n }\n const scaledBoxes = detector.boxes.map((prediction) => {\n const startPoint = prediction.box.startPoint.squeeze();\n const endPoint = prediction.box.endPoint.squeeze();\n const predictionBox = {\n startPoint: startPoint.arraySync(),\n endPoint: endPoint.arraySync(),\n };\n startPoint.dispose();\n endPoint.dispose();\n const scaledBox = bounding.scaleBoxCoordinates(predictionBox, detector.scaleFactor);\n const enlargedBox = bounding.enlargeBox(scaledBox);\n const landmarks = prediction.landmarks.arraySync();\n prediction.box.startPoint.dispose();\n prediction.box.endPoint.dispose();\n prediction.landmarks.dispose();\n prediction.probability.dispose();\n return { ...enlargedBox, landmarks };\n });\n this.updateRegionsOfInterest(scaledBoxes);\n this.runsWithoutFaceDetector = 0;\n }\n const results = tf.tidy(() => this.regionsOfInterest.map((box, i) => {\n let angle = 0;\n // The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).\n const boxLandmarksFromMeshModel = box.landmarks.length >= LANDMARKS_COUNT;\n let [indexOfMouth, indexOfForehead] = MESH_KEYPOINTS_LINE_OF_SYMMETRY_INDICES;\n if (boxLandmarksFromMeshModel === false) {\n [indexOfMouth, indexOfForehead] = BLAZEFACE_KEYPOINTS_LINE_OF_SYMMETRY_INDICES;\n }\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n let rotatedImage = input;\n let rotationMatrix = util.IDENTITY_MATRIX;\n if (angle !== 0) {\n rotatedImage = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized);\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n }\n const boxCPU = { startPoint: box.startPoint, endPoint: box.endPoint };\n const face = bounding.cutBoxFromImageAndResize(boxCPU, rotatedImage, [this.meshHeight, this.meshWidth]).div(255);\n // The first returned tensor represents facial contours, which are included in the coordinates.\n const [, flag, coords] = this.meshDetector.predict(face);\n const coordsReshaped = tf.reshape(coords, [-1, 3]);\n let rawCoords = coordsReshaped.arraySync();\n if (config.iris.enabled) {\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = this.getEyeBox(rawCoords, face, LEFT_EYE_BOUNDS[0], LEFT_EYE_BOUNDS[1], true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = this.getEyeBox(rawCoords, face, RIGHT_EYE_BOUNDS[0], RIGHT_EYE_BOUNDS[1]);\n const eyePredictions = (this.irisModel.predict(tf.concat([leftEyeCrop, rightEyeCrop])));\n const eyePredictionsData = eyePredictions.dataSync();\n eyePredictions.dispose();\n const leftEyeData = eyePredictionsData.slice(0, IRIS_NUM_COORDINATES * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = this.getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(IRIS_NUM_COORDINATES * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = this.getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = this.getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left');\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right');\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged. So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = this.getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = this.getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n rawCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n }\n const transformedCoordsData = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n tf.dispose(rawCoords);\n const landmarksBox = bounding.enlargeBox(this.calculateLandmarksBoundingBox(transformedCoordsData));\n const confidence = flag.squeeze();\n tf.dispose(flag);\n if (config.mesh.enabled) {\n const transformedCoords = tf.tensor2d(transformedCoordsData);\n this.regionsOfInterest[i] = { ...landmarksBox, landmarks: transformedCoords.arraySync() };\n const prediction = {\n coords: transformedCoords,\n box: landmarksBox,\n confidence,\n image: face,\n };\n return prediction;\n }\n const prediction = {\n coords: null,\n box: landmarksBox,\n confidence,\n image: face,\n };\n return prediction;\n }));\n return results;\n }\n\n // Updates regions of interest if the intersection over union between the incoming and previous regions falls below a threshold.\n updateRegionsOfInterest(boxes) {\n for (let i = 0; i < boxes.length; i++) {\n const box = boxes[i];\n const previousBox = this.regionsOfInterest[i];\n let iou = 0;\n if (previousBox && previousBox.startPoint) {\n const [boxStartX, boxStartY] = box.startPoint;\n const [boxEndX, boxEndY] = box.endPoint;\n const [previousBoxStartX, previousBoxStartY] = previousBox.startPoint;\n const [previousBoxEndX, previousBoxEndY] = previousBox.endPoint;\n const xStartMax = Math.max(boxStartX, previousBoxStartX);\n const yStartMax = Math.max(boxStartY, previousBoxStartY);\n const xEndMin = Math.min(boxEndX, previousBoxEndX);\n const yEndMin = Math.min(boxEndY, previousBoxEndY);\n const intersection = (xEndMin - xStartMax) * (yEndMin - yStartMax);\n const boxArea = (boxEndX - boxStartX) * (boxEndY - boxStartY);\n const previousBoxArea = (previousBoxEndX - previousBoxStartX) * (previousBoxEndY - boxStartY);\n iou = intersection / (boxArea + previousBoxArea - intersection);\n }\n if (iou < UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD) {\n this.regionsOfInterest[i] = box;\n }\n }\n this.regionsOfInterest = this.regionsOfInterest.slice(0, boxes.length);\n }\n\n clearRegionOfInterest(index) {\n if (this.regionsOfInterest[index] != null) {\n this.regionsOfInterest = [\n ...this.regionsOfInterest.slice(0, index),\n ...this.regionsOfInterest.slice(index + 1),\n ];\n }\n }\n\n shouldUpdateRegionsOfInterest() {\n if (this.regionsOfInterest.length === 0) return true; // nothing detected, so run detector on the next frame\n return (this.regionsOfInterest.length !== this.maxFaces) && (this.runsWithoutFaceDetector >= this.skipFrames);\n }\n\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint, landmarks };\n }\n}\nexports.Pipeline = Pipeline;\n", "exports.UV_COORDS = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n", "export default [\n 127, 34, 139, 11, 0, 37, 232, 231, 120, 72, 37, 39, 128, 121, 47, 232, 121,\n 128, 104, 69, 67, 175, 171, 148, 157, 154, 155, 118, 50, 101, 73, 39, 40, 9,\n 151, 108, 48, 115, 131, 194, 204, 211, 74, 40, 185, 80, 42, 183, 40, 92,\n 186, 230, 229, 118, 202, 212, 214, 83, 18, 17, 76, 61, 146, 160, 29, 30, 56,\n 157, 173, 106, 204, 194, 135, 214, 192, 203, 165, 98, 21, 71, 68, 51, 45, 4,\n 144, 24, 23, 77, 146, 91, 205, 50, 187, 201, 200, 18, 91, 106, 182, 90, 91,\n 181, 85, 84, 17, 206, 203, 36, 148, 171, 140, 92, 40, 39, 193, 189, 244,\n 159, 158, 28, 247, 246, 161, 236, 3, 196, 54, 68, 104, 193, 168, 8, 117,\n 228, 31, 189, 193, 55, 98, 97, 99, 126, 47, 100, 166, 79, 218, 155, 154, 26,\n 209, 49, 131, 135, 136, 150, 47, 126, 217, 223, 52, 53, 45, 51, 134, 211,\n 170, 140, 67, 69, 108, 43, 106, 91, 230, 119, 120, 226, 130, 247, 63, 53,\n 52, 238, 20, 242, 46, 70, 156, 78, 62, 96, 46, 53, 63, 143, 34, 227, 173,\n 155, 133, 123, 117, 111, 44, 125, 19, 236, 134, 51, 216, 206, 205, 154, 153,\n 22, 39, 37, 167, 200, 201, 208, 36, 142, 100, 57, 212, 202, 20, 60, 99, 28,\n 158, 157, 35, 226, 113, 160, 159, 27, 204, 202, 210, 113, 225, 46, 43, 202,\n 204, 62, 76, 77, 137, 123, 116, 41, 38, 72, 203, 129, 142, 64, 98, 240, 49,\n 102, 64, 41, 73, 74, 212, 216, 207, 42, 74, 184, 169, 170, 211, 170, 149,\n 176, 105, 66, 69, 122, 6, 168, 123, 147, 187, 96, 77, 90, 65, 55, 107, 89,\n 90, 180, 101, 100, 120, 63, 105, 104, 93, 137, 227, 15, 86, 85, 129, 102,\n 49, 14, 87, 86, 55, 8, 9, 100, 47, 121, 145, 23, 22, 88, 89, 179, 6, 122,\n 196, 88, 95, 96, 138, 172, 136, 215, 58, 172, 115, 48, 219, 42, 80, 81, 195,\n 3, 51, 43, 146, 61, 171, 175, 199, 81, 82, 38, 53, 46, 225, 144, 163, 110,\n 246, 33, 7, 52, 65, 66, 229, 228, 117, 34, 127, 234, 107, 108, 69, 109, 108,\n 151, 48, 64, 235, 62, 78, 191, 129, 209, 126, 111, 35, 143, 163, 161, 246,\n 117, 123, 50, 222, 65, 52, 19, 125, 141, 221, 55, 65, 3, 195, 197, 25, 7,\n 33, 220, 237, 44, 70, 71, 139, 122, 193, 245, 247, 130, 33, 71, 21, 162,\n 153, 158, 159, 170, 169, 150, 188, 174, 196, 216, 186, 92, 144, 160, 161, 2,\n 97, 167, 141, 125, 241, 164, 167, 37, 72, 38, 12, 145, 159, 160, 38, 82, 13,\n 63, 68, 71, 226, 35, 111, 158, 153, 154, 101, 50, 205, 206, 92, 165, 209,\n 198, 217, 165, 167, 97, 220, 115, 218, 133, 112, 243, 239, 238, 241, 214,\n 135, 169, 190, 173, 133, 171, 208, 32, 125, 44, 237, 86, 87, 178, 85, 86,\n 179, 84, 85, 180, 83, 84, 181, 201, 83, 182, 137, 93, 132, 76, 62, 183, 61,\n 76, 184, 57, 61, 185, 212, 57, 186, 214, 207, 187, 34, 143, 156, 79, 239,\n 237, 123, 137, 177, 44, 1, 4, 201, 194, 32, 64, 102, 129, 213, 215, 138, 59,\n 166, 219, 242, 99, 97, 2, 94, 141, 75, 59, 235, 24, 110, 228, 25, 130, 226,\n 23, 24, 229, 22, 23, 230, 26, 22, 231, 112, 26, 232, 189, 190, 243, 221, 56,\n 190, 28, 56, 221, 27, 28, 222, 29, 27, 223, 30, 29, 224, 247, 30, 225, 238,\n 79, 20, 166, 59, 75, 60, 75, 240, 147, 177, 215, 20, 79, 166, 187, 147, 213,\n 112, 233, 244, 233, 128, 245, 128, 114, 188, 114, 217, 174, 131, 115, 220,\n 217, 198, 236, 198, 131, 134, 177, 132, 58, 143, 35, 124, 110, 163, 7, 228,\n 110, 25, 356, 389, 368, 11, 302, 267, 452, 350, 349, 302, 303, 269, 357,\n 343, 277, 452, 453, 357, 333, 332, 297, 175, 152, 377, 384, 398, 382, 347,\n 348, 330, 303, 304, 270, 9, 336, 337, 278, 279, 360, 418, 262, 431, 304,\n 408, 409, 310, 415, 407, 270, 409, 410, 450, 348, 347, 422, 430, 434, 313,\n 314, 17, 306, 307, 375, 387, 388, 260, 286, 414, 398, 335, 406, 418, 364,\n 367, 416, 423, 358, 327, 251, 284, 298, 281, 5, 4, 373, 374, 253, 307, 320,\n 321, 425, 427, 411, 421, 313, 18, 321, 405, 406, 320, 404, 405, 315, 16, 17,\n 426, 425, 266, 377, 400, 369, 322, 391, 269, 417, 465, 464, 386, 257, 258,\n 466, 260, 388, 456, 399, 419, 284, 332, 333, 417, 285, 8, 346, 340, 261,\n 413, 441, 285, 327, 460, 328, 355, 371, 329, 392, 439, 438, 382, 341, 256,\n 429, 420, 360, 364, 394, 379, 277, 343, 437, 443, 444, 283, 275, 440, 363,\n 431, 262, 369, 297, 338, 337, 273, 375, 321, 450, 451, 349, 446, 342, 467,\n 293, 334, 282, 458, 461, 462, 276, 353, 383, 308, 324, 325, 276, 300, 293,\n 372, 345, 447, 382, 398, 362, 352, 345, 340, 274, 1, 19, 456, 248, 281, 436,\n 427, 425, 381, 256, 252, 269, 391, 393, 200, 199, 428, 266, 330, 329, 287,\n 273, 422, 250, 462, 328, 258, 286, 384, 265, 353, 342, 387, 259, 257, 424,\n 431, 430, 342, 353, 276, 273, 335, 424, 292, 325, 307, 366, 447, 345, 271,\n 303, 302, 423, 266, 371, 294, 455, 460, 279, 278, 294, 271, 272, 304, 432,\n 434, 427, 272, 407, 408, 394, 430, 431, 395, 369, 400, 334, 333, 299, 351,\n 417, 168, 352, 280, 411, 325, 319, 320, 295, 296, 336, 319, 403, 404, 330,\n 348, 349, 293, 298, 333, 323, 454, 447, 15, 16, 315, 358, 429, 279, 14, 15,\n 316, 285, 336, 9, 329, 349, 350, 374, 380, 252, 318, 402, 403, 6, 197, 419,\n 318, 319, 325, 367, 364, 365, 435, 367, 397, 344, 438, 439, 272, 271, 311,\n 195, 5, 281, 273, 287, 291, 396, 428, 199, 311, 271, 268, 283, 444, 445,\n 373, 254, 339, 263, 466, 249, 282, 334, 296, 449, 347, 346, 264, 447, 454,\n 336, 296, 299, 338, 10, 151, 278, 439, 455, 292, 407, 415, 358, 371, 355,\n 340, 345, 372, 390, 249, 466, 346, 347, 280, 442, 443, 282, 19, 94, 370,\n 441, 442, 295, 248, 419, 197, 263, 255, 359, 440, 275, 274, 300, 383, 368,\n 351, 412, 465, 263, 467, 466, 301, 368, 389, 380, 374, 386, 395, 378, 379,\n 412, 351, 419, 436, 426, 322, 373, 390, 388, 2, 164, 393, 370, 462, 461,\n 164, 0, 267, 302, 11, 12, 374, 373, 387, 268, 12, 13, 293, 300, 301, 446,\n 261, 340, 385, 384, 381, 330, 266, 425, 426, 423, 391, 429, 355, 437, 391,\n 327, 326, 440, 457, 438, 341, 382, 362, 459, 457, 461, 434, 430, 394, 414,\n 463, 362, 396, 369, 262, 354, 461, 457, 316, 403, 402, 315, 404, 403, 314,\n 405, 404, 313, 406, 405, 421, 418, 406, 366, 401, 361, 306, 408, 407, 291,\n 409, 408, 287, 410, 409, 432, 436, 410, 434, 416, 411, 264, 368, 383, 309,\n 438, 457, 352, 376, 401, 274, 275, 4, 421, 428, 262, 294, 327, 358, 433,\n 416, 367, 289, 455, 439, 462, 370, 326, 2, 326, 370, 305, 460, 455, 254,\n 449, 448, 255, 261, 446, 253, 450, 449, 252, 451, 450, 256, 452, 451, 341,\n 453, 452, 413, 464, 463, 441, 413, 414, 258, 442, 441, 257, 443, 442, 259,\n 444, 443, 260, 445, 444, 467, 342, 445, 459, 458, 250, 289, 392, 290, 290,\n 328, 460, 376, 433, 435, 250, 290, 392, 411, 416, 433, 341, 463, 464, 453,\n 464, 465, 357, 465, 412, 343, 412, 399, 360, 363, 440, 437, 399, 456, 420,\n 456, 363, 401, 435, 288, 372, 383, 353, 339, 255, 249, 448, 261, 255, 133,\n 243, 190, 133, 155, 112, 33, 246, 247, 33, 130, 25, 398, 384, 286, 362, 398,\n 414, 362, 463, 341, 263, 359, 467, 263, 249, 255, 466, 467, 260, 75, 60,\n 166, 238, 239, 79, 162, 127, 139, 72, 11, 37, 121, 232, 120, 73, 72, 39,\n 114, 128, 47, 233, 232, 128, 103, 104, 67, 152, 175, 148, 173, 157, 155,\n 119, 118, 101, 74, 73, 40, 107, 9, 108, 49, 48, 131, 32, 194, 211, 184, 74,\n 185, 191, 80, 183, 185, 40, 186, 119, 230, 118, 210, 202, 214, 84, 83, 17,\n 77, 76, 146, 161, 160, 30, 190, 56, 173, 182, 106, 194, 138, 135, 192, 129,\n 203, 98, 54, 21, 68, 5, 51, 4, 145, 144, 23, 90, 77, 91, 207, 205, 187, 83,\n 201, 18, 181, 91, 182, 180, 90, 181, 16, 85, 17, 205, 206, 36, 176, 148,\n 140, 165, 92, 39, 245, 193, 244, 27, 159, 28, 30, 247, 161, 174, 236, 196,\n 103, 54, 104, 55, 193, 8, 111, 117, 31, 221, 189, 55, 240, 98, 99, 142, 126,\n 100, 219, 166, 218, 112, 155, 26, 198, 209, 131, 169, 135, 150, 114, 47,\n 217, 224, 223, 53, 220, 45, 134, 32, 211, 140, 109, 67, 108, 146, 43, 91,\n 231, 230, 120, 113, 226, 247, 105, 63, 52, 241, 238, 242, 124, 46, 156, 95,\n 78, 96, 70, 46, 63, 116, 143, 227, 116, 123, 111, 1, 44, 19, 3, 236, 51,\n 207, 216, 205, 26, 154, 22, 165, 39, 167, 199, 200, 208, 101, 36, 100, 43,\n 57, 202, 242, 20, 99, 56, 28, 157, 124, 35, 113, 29, 160, 27, 211, 204, 210,\n 124, 113, 46, 106, 43, 204, 96, 62, 77, 227, 137, 116, 73, 41, 72, 36, 203,\n 142, 235, 64, 240, 48, 49, 64, 42, 41, 74, 214, 212, 207, 183, 42, 184, 210,\n 169, 211, 140, 170, 176, 104, 105, 69, 193, 122, 168, 50, 123, 187, 89, 96,\n 90, 66, 65, 107, 179, 89, 180, 119, 101, 120, 68, 63, 104, 234, 93, 227, 16,\n 15, 85, 209, 129, 49, 15, 14, 86, 107, 55, 9, 120, 100, 121, 153, 145, 22,\n 178, 88, 179, 197, 6, 196, 89, 88, 96, 135, 138, 136, 138, 215, 172, 218,\n 115, 219, 41, 42, 81, 5, 195, 51, 57, 43, 61, 208, 171, 199, 41, 81, 38,\n 224, 53, 225, 24, 144, 110, 105, 52, 66, 118, 229, 117, 227, 34, 234, 66,\n 107, 69, 10, 109, 151, 219, 48, 235, 183, 62, 191, 142, 129, 126, 116, 111,\n 143, 7, 163, 246, 118, 117, 50, 223, 222, 52, 94, 19, 141, 222, 221, 65,\n 196, 3, 197, 45, 220, 44, 156, 70, 139, 188, 122, 245, 139, 71, 162, 145,\n 153, 159, 149, 170, 150, 122, 188, 196, 206, 216, 92, 163, 144, 161, 164, 2,\n 167, 242, 141, 241, 0, 164, 37, 11, 72, 12, 144, 145, 160, 12, 38, 13, 70,\n 63, 71, 31, 226, 111, 157, 158, 154, 36, 101, 205, 203, 206, 165, 126, 209,\n 217, 98, 165, 97, 237, 220, 218, 237, 239, 241, 210, 214, 169, 140, 171, 32,\n 241, 125, 237, 179, 86, 178, 180, 85, 179, 181, 84, 180, 182, 83, 181, 194,\n 201, 182, 177, 137, 132, 184, 76, 183, 185, 61, 184, 186, 57, 185, 216, 212,\n 186, 192, 214, 187, 139, 34, 156, 218, 79, 237, 147, 123, 177, 45, 44, 4,\n 208, 201, 32, 98, 64, 129, 192, 213, 138, 235, 59, 219, 141, 242, 97, 97, 2,\n 141, 240, 75, 235, 229, 24, 228, 31, 25, 226, 230, 23, 229, 231, 22, 230,\n 232, 26, 231, 233, 112, 232, 244, 189, 243, 189, 221, 190, 222, 28, 221,\n 223, 27, 222, 224, 29, 223, 225, 30, 224, 113, 247, 225, 99, 60, 240, 213,\n 147, 215, 60, 20, 166, 192, 187, 213, 243, 112, 244, 244, 233, 245, 245,\n 128, 188, 188, 114, 174, 134, 131, 220, 174, 217, 236, 236, 198, 134, 215,\n 177, 58, 156, 143, 124, 25, 110, 7, 31, 228, 25, 264, 356, 368, 0, 11, 267,\n 451, 452, 349, 267, 302, 269, 350, 357, 277, 350, 452, 357, 299, 333, 297,\n 396, 175, 377, 381, 384, 382, 280, 347, 330, 269, 303, 270, 151, 9, 337,\n 344, 278, 360, 424, 418, 431, 270, 304, 409, 272, 310, 407, 322, 270, 410,\n 449, 450, 347, 432, 422, 434, 18, 313, 17, 291, 306, 375, 259, 387, 260,\n 424, 335, 418, 434, 364, 416, 391, 423, 327, 301, 251, 298, 275, 281, 4,\n 254, 373, 253, 375, 307, 321, 280, 425, 411, 200, 421, 18, 335, 321, 406,\n 321, 320, 405, 314, 315, 17, 423, 426, 266, 396, 377, 369, 270, 322, 269,\n 413, 417, 464, 385, 386, 258, 248, 456, 419, 298, 284, 333, 168, 417, 8,\n 448, 346, 261, 417, 413, 285, 326, 327, 328, 277, 355, 329, 309, 392, 438,\n 381, 382, 256, 279, 429, 360, 365, 364, 379, 355, 277, 437, 282, 443, 283,\n 281, 275, 363, 395, 431, 369, 299, 297, 337, 335, 273, 321, 348, 450, 349,\n 359, 446, 467, 283, 293, 282, 250, 458, 462, 300, 276, 383, 292, 308, 325,\n 283, 276, 293, 264, 372, 447, 346, 352, 340, 354, 274, 19, 363, 456, 281,\n 426, 436, 425, 380, 381, 252, 267, 269, 393, 421, 200, 428, 371, 266, 329,\n 432, 287, 422, 290, 250, 328, 385, 258, 384, 446, 265, 342, 386, 387, 257,\n 422, 424, 430, 445, 342, 276, 422, 273, 424, 306, 292, 307, 352, 366, 345,\n 268, 271, 302, 358, 423, 371, 327, 294, 460, 331, 279, 294, 303, 271, 304,\n 436, 432, 427, 304, 272, 408, 395, 394, 431, 378, 395, 400, 296, 334, 299,\n 6, 351, 168, 376, 352, 411, 307, 325, 320, 285, 295, 336, 320, 319, 404,\n 329, 330, 349, 334, 293, 333, 366, 323, 447, 316, 15, 315, 331, 358, 279,\n 317, 14, 316, 8, 285, 9, 277, 329, 350, 253, 374, 252, 319, 318, 403, 351,\n 6, 419, 324, 318, 325, 397, 367, 365, 288, 435, 397, 278, 344, 439, 310,\n 272, 311, 248, 195, 281, 375, 273, 291, 175, 396, 199, 312, 311, 268, 276,\n 283, 445, 390, 373, 339, 295, 282, 296, 448, 449, 346, 356, 264, 454, 337,\n 336, 299, 337, 338, 151, 294, 278, 455, 308, 292, 415, 429, 358, 355, 265,\n 340, 372, 388, 390, 466, 352, 346, 280, 295, 442, 282, 354, 19, 370, 285,\n 441, 295, 195, 248, 197, 457, 440, 274, 301, 300, 368, 417, 351, 465, 251,\n 301, 389, 385, 380, 386, 394, 395, 379, 399, 412, 419, 410, 436, 322, 387,\n 373, 388, 326, 2, 393, 354, 370, 461, 393, 164, 267, 268, 302, 12, 386, 374,\n 387, 312, 268, 13, 298, 293, 301, 265, 446, 340, 380, 385, 381, 280, 330,\n 425, 322, 426, 391, 420, 429, 437, 393, 391, 326, 344, 440, 438, 458, 459,\n 461, 364, 434, 394, 428, 396, 262, 274, 354, 457, 317, 316, 402, 316, 315,\n 403, 315, 314, 404, 314, 313, 405, 313, 421, 406, 323, 366, 361, 292, 306,\n 407, 306, 291, 408, 291, 287, 409, 287, 432, 410, 427, 434, 411, 372, 264,\n 383, 459, 309, 457, 366, 352, 401, 1, 274, 4, 418, 421, 262, 331, 294, 358,\n 435, 433, 367, 392, 289, 439, 328, 462, 326, 94, 2, 370, 289, 305, 455, 339,\n 254, 448, 359, 255, 446, 254, 253, 449, 253, 252, 450, 252, 256, 451, 256,\n 341, 452, 414, 413, 463, 286, 441, 414, 286, 258, 441, 258, 257, 442, 257,\n 259, 443, 259, 260, 444, 260, 467, 445, 309, 459, 250, 305, 289, 290, 305,\n 290, 460, 401, 376, 435, 309, 250, 392, 376, 411, 433, 453, 341, 464, 357,\n 453, 465, 343, 357, 412, 437, 343, 399, 344, 360, 440, 420, 437, 456, 360,\n 420, 363, 361, 401, 288, 265, 372, 353, 390, 339, 249, 339, 448, 255];\n", "const tf = require('@tensorflow/tfjs');\nconst blazeface = require('./blazeface');\nconst keypoints = require('./keypoints');\nconst pipe = require('./pipeline');\nconst uv_coords = require('./uvcoords');\nconst triangulation = require('./triangulation').default;\n\nclass MediaPipeFaceMesh {\n constructor(blazeFace, blazeMeshModel, irisModel, config) {\n this.pipeline = new pipe.Pipeline(blazeFace, blazeMeshModel, irisModel, config);\n if (config) this.config = config;\n }\n\n async estimateFaces(input, config) {\n if (config) this.config = config;\n const predictions = await this.pipeline.predict(input, config);\n const results = [];\n for (const prediction of (predictions || [])) {\n // guard against disposed tensors on long running operations such as pause in middle of processing\n if (prediction.isDisposedInternal) continue;\n const confidence = prediction.confidence.arraySync();\n if (confidence >= this.config.detector.minConfidence) {\n const mesh = prediction.coords ? prediction.coords.arraySync() : null;\n const annotations = {};\n if (mesh && mesh.length > 0) {\n for (const key in keypoints.MESH_ANNOTATIONS) {\n if (this.config.iris.enabled || key.includes('Iris') === false) {\n annotations[key] = keypoints.MESH_ANNOTATIONS[key].map((index) => mesh[index]);\n }\n }\n }\n results.push({\n confidence: confidence || 0,\n box: prediction.box ? [prediction.box.startPoint[0], prediction.box.startPoint[1], prediction.box.endPoint[0] - prediction.box.startPoint[0], prediction.box.endPoint[1] - prediction.box.startPoint[1]] : 0,\n mesh,\n annotations,\n image: prediction.image ? tf.clone(prediction.image) : null,\n });\n }\n if (prediction.confidence) prediction.confidence.dispose();\n if (prediction.coords) prediction.coords.dispose();\n if (prediction.image) prediction.image.dispose();\n }\n return results;\n }\n}\n\nasync function load(config) {\n const models = await Promise.all([\n blazeface.load(config),\n tf.loadGraphModel(config.mesh.modelPath, { fromTFHub: config.mesh.modelPath.includes('tfhub.dev') }),\n tf.loadGraphModel(config.iris.modelPath, { fromTFHub: config.iris.modelPath.includes('tfhub.dev') }),\n ]);\n const faceMesh = new MediaPipeFaceMesh(models[0], models[1], models[2], config);\n return faceMesh;\n}\n\nexports.load = load;\nexports.MediaPipeFaceMesh = MediaPipeFaceMesh;\nexports.uv_coords = uv_coords;\nexports.triangulation = triangulation;\n", "const tf = require('@tensorflow/tfjs');\n\nconst models = {};\nlet last = { age: 0, gender: '' };\nlet frame = 0;\n\nasync function loadAge(config) {\n if (!models.age) models.age = await tf.loadGraphModel(config.face.age.modelPath);\n return models.age;\n}\n\nasync function loadGender(config) {\n if (!models.gender) models.gender = await tf.loadGraphModel(config.face.gender.modelPath);\n return models.gender;\n}\n\nasync function predict(image, config) {\n if (frame < config.face.age.skipFrames) {\n frame += 1;\n return last;\n }\n frame = 0;\n const resize = tf.image.resizeBilinear(image, [config.face.age.inputSize, config.face.age.inputSize], false);\n const enhance = tf.mul(resize, [255.0]);\n tf.dispose(resize);\n\n const promises = [];\n let ageT;\n let genderT;\n if (config.face.age.enabled) promises.push(ageT = models.age.predict(enhance));\n if (config.face.gender.enabled) promises.push(genderT = models.gender.predict(enhance));\n await Promise.all(promises);\n\n const obj = {};\n if (ageT) {\n const data = await ageT.data();\n obj.age = Math.trunc(10 * data[0]) / 10;\n tf.dispose(ageT);\n }\n if (genderT) {\n const data = await genderT.data();\n const confidence = Math.trunc(Math.abs(1.9 * 100 * (data[0] - 0.5))) / 100;\n if (confidence > config.face.gender.minConfidence) {\n obj.gender = data[0] <= 0.5 ? 'female' : 'male';\n obj.confidence = confidence;\n }\n tf.dispose(genderT);\n }\n\n tf.dispose(enhance);\n last = obj;\n return obj;\n}\n\nexports.predict = predict;\nexports.loadAge = loadAge;\nexports.loadGender = loadGender;\n", "const tf = require('@tensorflow/tfjs');\n\nconst annotations = ['angry', 'discust', 'fear', 'happy', 'sad', 'surpise', 'neutral'];\nconst models = {};\nlet last = [];\nlet frame = 0;\nconst multiplier = 1.5;\n\nasync function load(config) {\n if (!models.emotion) models.emotion = await tf.loadGraphModel(config.face.emotion.modelPath);\n return models.emotion;\n}\n\nasync function predict(image, config) {\n if (frame < config.face.emotion.skipFrames) {\n frame += 1;\n return last;\n }\n frame = 0;\n const resize = tf.image.resizeBilinear(image, [config.face.emotion.inputSize, config.face.emotion.inputSize], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n resize.dispose();\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, [0.2989]);\n const greenNorm = tf.mul(green, [0.5870]);\n const blueNorm = tf.mul(blue, [0.1140]);\n red.dispose();\n green.dispose();\n blue.dispose();\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n redNorm.dispose();\n greenNorm.dispose();\n blueNorm.dispose();\n const obj = [];\n if (config.face.emotion.enabled) {\n const emotionT = await models.emotion.predict(grayscale);\n const data = await emotionT.data();\n for (let i = 0; i < data.length; i++) {\n if (multiplier * data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * multiplier * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n tf.dispose(emotionT);\n }\n tf.dispose(grayscale);\n last = obj;\n return obj;\n}\n\nexports.predict = predict;\nexports.load = load;\n", "const tf = require('@tensorflow/tfjs');\n\nclass BaseModel {\n constructor(model, outputStride) {\n this.model = model;\n this.outputStride = outputStride;\n const inputShape = this.model.inputs[0].shape;\n tf.util.assert((inputShape[1] === -1) && (inputShape[2] === -1), () => `Input shape [${inputShape[1]}, ${inputShape[2]}] must both be equal to or -1`);\n }\n\n /**\n * Predicts intermediate Tensor representations.\n *\n * @param input The input RGB image of the base model.\n * A Tensor of shape: [`inputResolution`, `inputResolution`, 3].\n *\n * @return A dictionary of base model's intermediate predictions.\n * The returned dictionary should contains the following elements:\n * heatmapScores: A Tensor3D that represents the heatmapScores.\n * offsets: A Tensor3D that represents the offsets.\n * displacementFwd: A Tensor3D that represents the forward displacement.\n * displacementBwd: A Tensor3D that represents the backward displacement.\n */\n predict(input) {\n return tf.tidy(() => {\n const asFloat = this.preprocessInput(input.toFloat());\n const asBatch = asFloat.expandDims(0);\n const results = this.model.predict(asBatch);\n const results3d = results.map((y) => y.squeeze([0]));\n const namedResults = this.nameOutputResults(results3d);\n return {\n heatmapScores: namedResults.heatmap.sigmoid(),\n offsets: namedResults.offsets,\n displacementFwd: namedResults.displacementFwd,\n displacementBwd: namedResults.displacementBwd,\n };\n });\n }\n\n /**\n * Releases the CPU and GPU memory allocated by the model.\n */\n dispose() {\n this.model.dispose();\n }\n}\nexports.BaseModel = BaseModel;\n", "const tf = require('@tensorflow/tfjs');\nconst modelBase = require('./modelBase');\n\nclass MobileNet extends modelBase.BaseModel {\n // eslint-disable-next-line class-methods-use-this\n preprocessInput(input) {\n // Normalize the pixels [0, 255] to be between [-1, 1].\n return tf.tidy(() => tf.div(input, 127.5).sub(1.0));\n }\n\n // eslint-disable-next-line class-methods-use-this\n nameOutputResults(results) {\n const [offsets, heatmap, displacementFwd, displacementBwd] = results;\n return { offsets, heatmap, displacementFwd, displacementBwd };\n }\n}\nexports.MobileNet = MobileNet;\n", "// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nfunction half(k) {\n return Math.floor(k / 2);\n}\nclass MaxHeap {\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() {\n return this.numberOfElements === -1;\n }\n\n size() {\n return this.numberOfElements + 1;\n }\n\n all() {\n return this.priorityQueue.slice(0, this.numberOfElements + 1);\n }\n\n max() {\n return this.priorityQueue[0];\n }\n\n swim(k) {\n while (k > 0 && this.less(half(k), k)) {\n this.exchange(k, half(k));\n k = half(k);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\nexports.MaxHeap = MaxHeap;\n", "const heapSort = require('./heapSort');\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, localMaximumRadius, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) {\n break;\n }\n }\n return localMaximum;\n}\n/**\n * Builds a priority queue with part candidate positions for a specific image in\n * the batch. For this we find all local maxima in the score maps with score\n * values above a threshold. We create a single priority queue across all parts.\n */\nfunction buildPartWithScoreQueue(scoreThreshold, localMaximumRadius, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new heapSort.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < scoreThreshold) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, localMaximumRadius, scores)) {\n queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n }\n return queue;\n}\nexports.buildPartWithScoreQueue = buildPartWithScoreQueue;\n", "exports.partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\nexports.NUM_KEYPOINTS = exports.partNames.length;\nexports.partIds = exports.partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\n/*\n * Define the skeleton. This defines the parent->child relationships of our\n * tree. Arbitrarily this defines the nose as the root of the tree, however\n * since we will infer the displacement for both parent->child and\n * child->parent, we can define the tree root as any node.\n */\nexports.poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\nexports.connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([exports.partIds[jointNameA], exports.partIds[jointNameB]]));\nexports.partChannels = [\n 'left_face',\n 'right_face',\n 'right_upper_leg_front',\n 'right_lower_leg_back',\n 'right_upper_leg_back',\n 'left_lower_leg_front',\n 'left_upper_leg_front',\n 'left_upper_leg_back',\n 'left_lower_leg_back',\n 'right_feet',\n 'right_lower_leg_front',\n 'left_feet',\n 'torso_front',\n 'torso_back',\n 'right_upper_arm_front',\n 'right_upper_arm_back',\n 'right_lower_arm_back',\n 'left_lower_arm_front',\n 'left_upper_arm_front',\n 'left_upper_arm_back',\n 'left_lower_arm_back',\n 'right_hand',\n 'right_lower_arm_front',\n 'left_hand',\n];\n", "const kpt = require('./keypoints');\n\nfunction getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + kpt.NUM_KEYPOINTS),\n };\n}\nexports.getOffsetPoint = getOffsetPoint;\n\nfunction getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\nexports.getImageCoords = getImageCoords;\n\nfunction fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\nexports.fillArray = fillArray;\n\nfunction clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\nexports.clamp = clamp;\n\nfunction squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\nexports.squaredDistance = squaredDistance;\n\nfunction addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\nexports.addVectors = addVectors;\n\nfunction clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\nexports.clampVector = clampVector;\n", "const keypoints = require('./keypoints');\nconst vectors = require('./vectors');\n\nconst parentChildrenTuples = keypoints.poseChain.map(([parentJoinName, childJoinName]) => ([keypoints.partIds[parentJoinName], keypoints.partIds[childJoinName]]));\nconst parentToChildEdges = parentChildrenTuples.map(([, childJointId]) => childJointId);\nconst childToParentEdges = parentChildrenTuples.map(([parentJointId]) => parentJointId);\nfunction getDisplacement(edgeId, point, displacements) {\n const numEdges = displacements.shape[2] / 2;\n return {\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, numEdges + edgeId),\n };\n}\nfunction getStridedIndexNearPoint(point, outputStride, height, width) {\n return {\n y: vectors.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: vectors.clamp(Math.round(point.x / outputStride), 0, width - 1),\n };\n}\n/**\n * We get a new keypoint along the `edgeId` for the pose instance, assuming\n * that the position of the `idSource` part is already known. For this, we\n * follow the displacement vector from the source to target part (stored in\n * the `i`-t channel of the displacement tensor). The displaced keypoint\n * vector is refined using the offset vector by `offsetRefineStep` times.\n */\nfunction traverseToTargetKeypoint(edgeId, sourceKeypoint, targetKeypointId, scoresBuffer, offsets, outputStride, displacements, offsetRefineStep = 2) {\n const [height, width] = scoresBuffer.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, outputStride, height, width);\n const displacement = getDisplacement(edgeId, sourceKeypointIndices, displacements);\n const displacedPoint = vectors.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, outputStride, height, width);\n const offsetPoint = vectors.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetKeypointId, offsets);\n targetKeypoint = vectors.addVectors({\n x: targetKeypointIndices.x * outputStride,\n y: targetKeypointIndices.y * outputStride,\n }, { x: offsetPoint.x, y: offsetPoint.y });\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, outputStride, height, width);\n const score = scoresBuffer.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetKeypointId);\n return { position: targetKeypoint, part: keypoints.partNames[targetKeypointId], score };\n}\n/**\n * Follows the displacement fields to decode the full pose of the object\n * instance given the position of a part that acts as root.\n *\n * @return An array of decoded keypoints and their scores for a single pose\n */\nfunction decodePose(root, scores, offsets, outputStride, displacementsFwd, displacementsBwd) {\n const numParts = scores.shape[2];\n const numEdges = parentToChildEdges.length;\n const instanceKeypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const { part: rootPart, score: rootScore } = root;\n const rootPoint = vectors.getImageCoords(rootPart, outputStride, offsets);\n instanceKeypoints[rootPart.id] = {\n score: rootScore,\n part: keypoints.partNames[rootPart.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward\n // displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceKeypointId = parentToChildEdges[edge];\n const targetKeypointId = childToParentEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward\n // displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceKeypointId = childToParentEdges[edge];\n const targetKeypointId = parentToChildEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsFwd);\n }\n }\n return instanceKeypoints;\n}\nexports.decodePose = decodePose;\n", "const buildParts = require('./buildParts');\nconst decodePose = require('./decodePose');\nconst vectors = require('./vectors');\n\nfunction withinNmsRadiusOfCorrespondingPoint(poses, squaredNmsRadius, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId].position;\n return vectors.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n/* Score the newly proposed object instance without taking into account\n * the scores of the parts that overlap with any previously detected\n * instance.\n */\nfunction getInstanceScore(existingPoses, squaredNmsRadius, instanceKeypoints) {\n const notOverlappedKeypointScores = instanceKeypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinNmsRadiusOfCorrespondingPoint(existingPoses, squaredNmsRadius, position, keypointId)) {\n result += score;\n }\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / instanceKeypoints.length;\n}\n// A point (y, x) is considered as root part candidate if its score is a\n// maximum in a window |y - y'| <= kLocalMaximumRadius, |x - x'| <=\n// kLocalMaximumRadius.\nconst kLocalMaximumRadius = 1;\n/**\n * Detects multiple poses and finds their parts from part scores and\n * displacement vectors. It returns up to `maxDetections` object instance\n * detections in decreasing root score order. It works as follows: We first\n * create a priority queue with local part score maxima above\n * `scoreThreshold`, considering all parts at the same time. Then we\n * iteratively pull the top element of the queue (in decreasing score order)\n * and treat it as a root candidate for a new object instance. To avoid\n * duplicate detections, we reject the root candidate if it is within a disk\n * of `nmsRadius` pixels from the corresponding part of a previously detected\n * instance, which is a form of part-based non-maximum suppression (NMS). If\n * the root candidate passes the NMS check, we start a new object instance\n * detection, treating the corresponding part as root and finding the\n * positions of the remaining parts by following the displacement vectors\n * along the tree-structured part graph. We assign to the newly detected\n * instance a score equal to the sum of scores of its parts which have not\n * been claimed by a previous instance (i.e., those at least `nmsRadius`\n * pixels away from the corresponding part of all previously detected\n * instances), divided by the total number of parts `numParts`.\n *\n * @param heatmapScores 3-D tensor with shape `[height, width, numParts]`.\n * The value of heatmapScores[y, x, k]` is the score of placing the `k`-th\n * object part at position `(y, x)`.\n *\n * @param offsets 3-D tensor with shape `[height, width, numParts * 2]`.\n * The value of [offsets[y, x, k], offsets[y, x, k + numParts]]` is the\n * short range offset vector of the `k`-th object part at heatmap\n * position `(y, x)`.\n *\n * @param displacementsFwd 3-D tensor of shape\n * `[height, width, 2 * num_edges]`, where `num_edges = num_parts - 1` is the\n * number of edges (parent-child pairs) in the tree. It contains the forward\n * displacements between consecutive part from the root towards the leaves.\n *\n * @param displacementsBwd 3-D tensor of shape\n * `[height, width, 2 * num_edges]`, where `num_edges = num_parts - 1` is the\n * number of edges (parent-child pairs) in the tree. It contains the backward\n * displacements between consecutive part from the root towards the leaves.\n *\n * @param outputStride The output stride that was used when feed-forwarding\n * through the PoseNet model. Must be 32, 16, or 8.\n *\n * @param maxPoseDetections Maximum number of returned instance detections per\n * image.\n *\n * @param scoreThreshold Only return instance detections that have root part\n * score greater or equal to this value. Defaults to 0.5.\n *\n * @param nmsRadius Non-maximum suppression part distance. It needs to be\n * strictly positive. Two parts suppress each other if they are less than\n * `nmsRadius` pixels away. Defaults to 20.\n *\n * @return An array of poses and their scores, each containing keypoints and\n * the corresponding keypoint scores.\n */\nfunction decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer, outputStride, maxPoseDetections, scoreThreshold = 0.5, nmsRadius = 20) {\n const poses = [];\n const queue = buildParts.buildPartWithScoreQueue(scoreThreshold, kLocalMaximumRadius, scoresBuffer);\n const squaredNmsRadius = nmsRadius * nmsRadius;\n // Generate at most maxDetections object instances per image in\n // decreasing root part score order.\n while (poses.length < maxPoseDetections && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it\n // is within a disk of `nmsRadius` pixels from the corresponding part of\n // a previously detected instance.\n const rootImageCoords = vectors.getImageCoords(root.part, outputStride, offsetsBuffer);\n if (withinNmsRadiusOfCorrespondingPoint(poses, squaredNmsRadius, rootImageCoords, root.part.id)) continue;\n // Start a new detection instance at the position of the root.\n const keypoints = decodePose.decodePose(root, scoresBuffer, offsetsBuffer, outputStride, displacementsFwdBuffer, displacementsBwdBuffer);\n const score = getInstanceScore(poses, squaredNmsRadius, keypoints);\n poses.push({ keypoints, score });\n }\n return poses;\n}\nexports.decodeMultiplePoses = decodeMultiplePoses;\n", "const kpt = require('./keypoints');\n\nfunction eitherPointDoesntMeetConfidence(a, b, minConfidence) {\n return (a < minConfidence || b < minConfidence);\n}\n\nfunction getAdjacentKeyPoints(keypoints, minConfidence) {\n return kpt.connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\nexports.getAdjacentKeyPoints = getAdjacentKeyPoints;\n\nconst { NEGATIVE_INFINITY, POSITIVE_INFINITY } = Number;\nfunction getBoundingBox(keypoints) {\n return keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: NEGATIVE_INFINITY,\n maxY: NEGATIVE_INFINITY,\n minX: POSITIVE_INFINITY,\n minY: POSITIVE_INFINITY,\n });\n}\nexports.getBoundingBox = getBoundingBox;\nfunction getBoundingBoxPoints(keypoints) {\n const { minX, minY, maxX, maxY } = getBoundingBox(keypoints);\n return [{ x: minX, y: minY }, { x: maxX, y: minY }, { x: maxX, y: maxY }, { x: minX, y: maxY }];\n}\nexports.getBoundingBoxPoints = getBoundingBoxPoints;\nasync function toTensorBuffers3D(tensors) {\n return Promise.all(tensors.map((tensor) => tensor.buffer()));\n}\nexports.toTensorBuffers3D = toTensorBuffers3D;\n\nfunction scalePose(pose, scaleY, scaleX) {\n return {\n score: pose.score,\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: { x: position.x * scaleX, y: position.y * scaleY },\n })),\n };\n}\nexports.scalePose = scalePose;\n\nfunction resizeTo(image, [targetH, targetW]) {\n const input = image.squeeze(0);\n const resized = input.resizeBilinear([targetH, targetW]);\n input.dispose();\n return resized;\n}\nexports.resizeTo = resizeTo;\n\nfunction scaleAndFlipPoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]) {\n const scaledPoses = poses.map((pose) => scalePose(pose, height / inputResolutionHeight, width / inputResolutionWidth));\n return scaledPoses;\n}\nexports.scaleAndFlipPoses = scaleAndFlipPoses;\n", "const tf = require('@tensorflow/tfjs');\nconst modelMobileNet = require('./modelMobileNet');\nconst decodeMultiple = require('./decodeMultiple');\nconst util = require('./util');\n\nclass PoseNet {\n constructor(net) {\n this.baseModel = net;\n }\n\n /**\n * Infer through PoseNet, and estimates multiple poses using the outputs.\n * This does standard ImageNet pre-processing before inferring through the\n * model. The image should pixels should have values [0-255]. It detects\n * multiple poses and finds their parts from part scores and displacement\n * vectors using a fast greedy decoding algorithm. It returns up to\n * `config.maxDetections` object instance detections in decreasing root\n * score order.\n *\n * @param input\n * ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement) The input\n * image to feed through the network.\n *\n * @param config MultiPoseEstimationConfig object that contains parameters\n * for the PoseNet inference using multiple pose estimation.\n *\n * @return An array of poses and their scores, each containing keypoints and\n * the corresponding keypoint scores. The positions of the keypoints are\n * in the same scale as the original image\n */\n async estimatePoses(input, config) {\n const outputStride = config.outputStride;\n // const inputResolution = config.inputResolution;\n const height = input.shape[1];\n const width = input.shape[2];\n const resized = util.resizeTo(input, [config.inputResolution, config.inputResolution]);\n const { heatmapScores, offsets, displacementFwd, displacementBwd } = this.baseModel.predict(resized);\n const allTensorBuffers = await util.toTensorBuffers3D([heatmapScores, offsets, displacementFwd, displacementBwd]);\n const scoresBuffer = allTensorBuffers[0];\n const offsetsBuffer = allTensorBuffers[1];\n const displacementsFwdBuffer = allTensorBuffers[2];\n const displacementsBwdBuffer = allTensorBuffers[3];\n const poses = await decodeMultiple.decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer, outputStride, config.maxDetections, config.scoreThreshold, config.nmsRadius);\n const resultPoses = util.scaleAndFlipPoses(poses, [height, width], [config.inputResolution, config.inputResolution]);\n heatmapScores.dispose();\n offsets.dispose();\n displacementFwd.dispose();\n displacementBwd.dispose();\n resized.dispose();\n return resultPoses;\n }\n\n dispose() {\n this.baseModel.dispose();\n }\n}\nexports.PoseNet = PoseNet;\nasync function loadMobileNet(config) {\n const graphModel = await tf.loadGraphModel(config.modelPath);\n const mobilenet = new modelMobileNet.MobileNet(graphModel, config.outputStride);\n return new PoseNet(mobilenet);\n}\n/**\n * Loads the PoseNet model instance from a checkpoint, with the MobileNet architecture. The model to be loaded is configurable using the\n * config dictionary ModelConfig. Please find more details in the documentation of the ModelConfig.\n *\n * @param config ModelConfig dictionary that contains parameters for\n * the PoseNet loading process. Please find more details of each parameters\n * in the documentation of the ModelConfig interface. The predefined\n * `MOBILENET_V1_CONFIG` and `RESNET_CONFIG` can also be used as references\n * for defining your customized config.\n */\nasync function load(config) {\n return loadMobileNet(config);\n}\nexports.load = load;\n", "const modelMobileNet = require('./modelMobileNet');\nconst modelPoseNet = require('./modelPoseNet');\nconst decodeMultiple = require('./decodeMultiple');\nconst keypoints = require('./keypoints');\nconst util = require('./util');\n\nexports.load = modelPoseNet.load;\nexports.PoseNet = modelPoseNet.PoseNet;\n\nexports.MobileNet = modelMobileNet.MobileNet;\nexports.decodeMultiplePoses = decodeMultiple.decodeMultiplePoses;\nexports.partChannels = keypoints.partChannels;\nexports.partIds = keypoints.partIds;\nexports.partNames = keypoints.partNames;\nexports.poseChain = keypoints.poseChain;\nexports.getAdjacentKeyPoints = util.getAdjacentKeyPoints;\nexports.getBoundingBox = util.getBoundingBox;\nexports.getBoundingBoxPoints = util.getBoundingBoxPoints;\nexports.scaleAndFlipPoses = util.scaleAndFlipPoses;\nexports.scalePose = util.scalePose;\n", "const tf = require('@tensorflow/tfjs');\n\nfunction getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\nexports.getBoxSize = getBoxSize;\n\nfunction getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\nexports.getBoxCenter = getBoxCenter;\n\nfunction cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\nexports.cutBoxFromImageAndResize = cutBoxFromImageAndResize;\n\nfunction scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks };\n}\nexports.scaleBoxCoordinates = scaleBoxCoordinates;\n\nfunction enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.enlargeBox = enlargeBox;\n\nfunction squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.squarifyBox = squarifyBox;\n\nfunction shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0], box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.shiftBox = shiftBox;\n", "const tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\n\nclass HandDetector {\n constructor(model, anchors, config) {\n this.model = model;\n this.width = config.inputSize;\n this.height = config.inputSize;\n this.anchors = anchors.map((anchor) => [anchor.x_center, anchor.y_center]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n this.inputSizeTensor = tf.tensor1d([config.inputSize, config.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([config.inputSize * 2, config.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(rawPalmLandmarks.reshape([-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoundingBoxes(input) {\n const batchedPrediction = this.model.predict(input);\n const prediction = batchedPrediction.squeeze();\n // Regression score for each anchor point.\n const scores = tf.tidy(() => tf.sigmoid(tf.slice(prediction, [0, 0], [-1, 1])).squeeze());\n // Bounding box for each anchor point.\n const rawBoxes = tf.slice(prediction, [0, 1], [-1, 4]);\n const boxes = this.normalizeBoxes(rawBoxes);\n const boxesWithHandsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.maxHands, this.iouThreshold, this.scoreThreshold);\n const boxesWithHands = await boxesWithHandsTensor.array();\n const toDispose = [batchedPrediction, boxesWithHandsTensor, prediction, boxes, rawBoxes, scores];\n const detectedHands = tf.tidy(() => {\n const detectedBoxes = [];\n for (const i in boxesWithHands) {\n const boxIndex = boxesWithHands[i];\n const matchingBox = tf.slice(boxes, [boxIndex, 0], [1, -1]);\n const rawPalmLandmarks = tf.slice(prediction, [boxIndex, 5], [1, 14]);\n const palmLandmarks = tf.tidy(() => this.normalizeLandmarks(rawPalmLandmarks, boxIndex).reshape([-1, 2]));\n detectedBoxes.push({ boxes: matchingBox, palmLandmarks });\n }\n return detectedBoxes;\n });\n toDispose.forEach((tensor) => tensor.dispose());\n return detectedHands;\n }\n\n /**\n * Returns a Box identifying the bounding box of a hand within the image.\n * Returns null if there is no hand in the image.\n *\n * @param input The image to classify.\n */\n async estimateHandBounds(input, config) {\n // const inputHeight = input.shape[2];\n // const inputWidth = input.shape[1];\n this.iouThreshold = config.iouThreshold;\n this.scoreThreshold = config.scoreThreshold;\n this.maxHands = config.maxHands;\n const resized = input.resizeBilinear([this.width, this.height]);\n const divided = resized.div(255);\n const normalized = divided.sub(0.5);\n const image = normalized.mul(2.0);\n resized.dispose();\n divided.dispose();\n normalized.dispose();\n const predictions = await this.getBoundingBoxes(image);\n image.dispose();\n if (!predictions || (predictions.length === 0)) return null;\n const hands = [];\n for (const i in predictions) {\n const prediction = predictions[i];\n const boundingBoxes = await prediction.boxes.array();\n const startPoint = boundingBoxes[0].slice(0, 2);\n const endPoint = boundingBoxes[0].slice(2, 4);\n const palmLandmarks = await prediction.palmLandmarks.array();\n prediction.boxes.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(bounding.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks }, [input.shape[2] / this.width, input.shape[1] / this.height]));\n }\n return hands;\n }\n}\nexports.HandDetector = HandDetector;\n", "exports.MESH_ANNOTATIONS = {\n thumb: [1, 2, 3, 4],\n indexFinger: [5, 6, 7, 8],\n middleFinger: [9, 10, 11, 12],\n ringFinger: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palmBase: [0],\n};\n", "function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\nexports.normalizeRadians = normalizeRadians;\n\nfunction computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\nexports.computeRotation = computeRotation;\n\nconst buildTranslationMatrix = (x, y) => ([[1, 0, x], [0, 1, y], [0, 0, 1]]);\nfunction dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\nexports.dot = dot;\n\nfunction getColumnFrom2DArr(arr, columnIndex) {\n const column = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\nexports.getColumnFrom2DArr = getColumnFrom2DArr;\n\nfunction multiplyTransformMatrices(mat1, mat2) {\n const product = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\nfunction buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\nexports.buildRotationMatrix = buildRotationMatrix;\n\nfunction invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\nexports.invertTransformMatrix = invertTransformMatrix;\n\nfunction rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\nexports.rotatePoint = rotatePoint;\n", "const tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\nconst util = require('./util');\n\nconst UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD = 0.8;\nconst PALM_BOX_SHIFT_VECTOR = [0, -0.4];\nconst HAND_BOX_SHIFT_VECTOR = [0, -0.1];\nconst HAND_BOX_ENLARGE_FACTOR = 1.65;\nconst PALM_LANDMARK_IDS = [0, 5, 9, 13, 17, 1, 2];\nconst PALM_LANDMARKS_INDEX_OF_PALM_BASE = 0;\nconst PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE = 2;\n\n// The Pipeline coordinates between the bounding box and skeleton models.\nclass HandPipeline {\n constructor(boundingBoxDetector, meshDetector, config) {\n this.regionsOfInterest = [];\n this.runsWithoutHandDetector = 0;\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.meshWidth = config.inputSize;\n this.meshHeight = config.inputSize;\n this.enlargeFactor = config.enlargeFactor;\n }\n\n // Get the bounding box surrounding the hand, given palm landmarks.\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => {\n const homogeneousCoordinate = [...coord, 1];\n return util.rotatePoint(homogeneousCoordinate, rotationMatrix);\n });\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n // boxAroundPalm only surrounds the palm - therefore we shift it\n // upwards so it will capture fingers once enlarged + squarified.\n return bounding.enlargeBox(bounding.squarifyBox(bounding.shiftBox(boxAroundPalm, PALM_BOX_SHIFT_VECTOR)), this.enlargeFactor);\n }\n\n // Get the bounding box surrounding the hand, given all hand landmarks.\n getBoxForHandLandmarks(landmarks) {\n // The MediaPipe hand mesh model is trained on hands with empty space\n // around them, so we still need to shift / enlarge boxAroundHand even\n // though it surrounds the entire hand.\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = bounding.enlargeBox(bounding.squarifyBox(bounding.shiftBox(boundingBox, HAND_BOX_SHIFT_VECTOR)), HAND_BOX_ENLARGE_FACTOR);\n const palmLandmarks = [];\n for (let i = 0; i < PALM_LANDMARK_IDS.length; i++) {\n palmLandmarks.push(landmarks[PALM_LANDMARK_IDS[i]].slice(0, 2));\n }\n boxAroundHand.palmLandmarks = palmLandmarks;\n return boxAroundHand;\n }\n\n // Scale, rotate, and translate raw keypoints from the model so they map to\n // the input coordinates.\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize(box);\n const scaleFactor = [boxSize[0] / this.meshWidth, boxSize[1] / this.meshHeight];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.meshWidth / 2),\n scaleFactor[1] * (coord[1] - this.meshHeight / 2), coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...bounding.getBoxCenter(box), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n coord[0] + originalBoxCenter[0], coord[1] + originalBoxCenter[1],\n coord[2],\n ]);\n }\n\n async estimateHands(image, config) {\n this.skipFrames = config.skipFrames;\n this.detectionConfidence = config.minConfidence;\n this.maxHands = config.maxHands;\n this.runsWithoutHandDetector++;\n const useFreshBox = this.shouldUpdateRegionsOfInterest();\n if (useFreshBox === true) {\n const boundingBoxPredictions = await this.boundingBoxDetector.estimateHandBounds(image, config);\n this.regionsOfInterest = [];\n for (const i in boundingBoxPredictions) {\n this.updateRegionsOfInterest(boundingBoxPredictions[i], true /* force update */, i);\n }\n this.runsWithoutHandDetector = 0;\n }\n // Rotate input so the hand is vertically oriented.\n const hands = [];\n if (!this.regionsOfInterest) return hands;\n for (const i in this.regionsOfInterest) {\n const currentBox = this.regionsOfInterest[i][0];\n if (!currentBox) return hands;\n const angle = util.computeRotation(currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_PALM_BASE], currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE]);\n const palmCenter = bounding.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized);\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const box = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = bounding.cutBoxFromImageAndResize(box, rotatedImage, [this.meshWidth, this.meshHeight]);\n const handImage = croppedInput.div(255);\n croppedInput.dispose();\n rotatedImage.dispose();\n const prediction = this.meshDetector.predict(handImage);\n const [flag, keypoints] = prediction;\n handImage.dispose();\n const flagValue = flag.dataSync()[0];\n flag.dispose();\n if (flagValue < config.minConfidence) {\n keypoints.dispose();\n this.regionsOfInterest[i] = [];\n return hands;\n }\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = await keypointsReshaped.array();\n keypoints.dispose();\n keypointsReshaped.dispose();\n const coords = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.updateRegionsOfInterest(nextBoundingBox, false /* force replace */, i);\n const result = {\n landmarks: coords,\n confidence: flagValue,\n box: {\n topLeft: nextBoundingBox.startPoint,\n bottomRight: nextBoundingBox.endPoint,\n },\n };\n hands.push(result);\n }\n return hands;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n\n // Updates regions of interest if the intersection over union between\n // the incoming and previous regions falls below a threshold.\n updateRegionsOfInterest(box, forceUpdate, index) {\n if (forceUpdate) {\n this.regionsOfInterest[index] = [box];\n } else {\n const previousBox = this.regionsOfInterest[index][0];\n let iou = 0;\n if (previousBox != null && previousBox.startPoint != null) {\n const [boxStartX, boxStartY] = box.startPoint;\n const [boxEndX, boxEndY] = box.endPoint;\n const [previousBoxStartX, previousBoxStartY] = previousBox.startPoint;\n const [previousBoxEndX, previousBoxEndY] = previousBox.endPoint;\n const xStartMax = Math.max(boxStartX, previousBoxStartX);\n const yStartMax = Math.max(boxStartY, previousBoxStartY);\n const xEndMin = Math.min(boxEndX, previousBoxEndX);\n const yEndMin = Math.min(boxEndY, previousBoxEndY);\n const intersection = (xEndMin - xStartMax) * (yEndMin - yStartMax);\n const boxArea = (boxEndX - boxStartX) * (boxEndY - boxStartY);\n const previousBoxArea = (previousBoxEndX - previousBoxStartX) * (previousBoxEndY - boxStartY);\n iou = intersection / (boxArea + previousBoxArea - intersection);\n }\n this.regionsOfInterest[index][0] = iou > UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD ? previousBox : box;\n }\n }\n\n shouldUpdateRegionsOfInterest() {\n return !this.regionsOfInterest || (this.regionsOfInterest.length === 0) || (this.runsWithoutHandDetector >= this.skipFrames);\n }\n}\nexports.HandPipeline = HandPipeline;\n", "const tf = require('@tensorflow/tfjs');\nconst hand = require('./handdetector');\nconst keypoints = require('./keypoints');\nconst pipe = require('./pipeline');\n\nclass HandPose {\n constructor(pipeline) {\n this.pipeline = pipeline;\n }\n\n async estimateHands(input, config) {\n this.skipFrames = config.skipFrames;\n this.detectionConfidence = config.minConfidence;\n this.maxHands = config.maxHands;\n const predictions = await this.pipeline.estimateHands(input, config);\n const hands = [];\n if (!predictions) return hands;\n for (const prediction of predictions) {\n if (!prediction) return [];\n const annotations = {};\n for (const key of Object.keys(keypoints.MESH_ANNOTATIONS)) {\n annotations[key] = keypoints.MESH_ANNOTATIONS[key].map((index) => prediction.landmarks[index]);\n }\n hands.push({\n confidence: prediction.confidence || 0,\n box: prediction.box ? [prediction.box.topLeft[0], prediction.box.topLeft[1], prediction.box.bottomRight[0] - prediction.box.topLeft[0], prediction.box.bottomRight[1] - prediction.box.topLeft[1]] : 0,\n landmarks: prediction.landmarks,\n annotations,\n });\n }\n return hands;\n }\n}\nexports.HandPose = HandPose;\n\nasync function loadAnchors(url) {\n if (tf.env().features.IS_NODE) {\n // eslint-disable-next-line global-require\n const fs = require('fs');\n const data = await fs.readFileSync(url.replace('file://', ''));\n return JSON.parse(data);\n }\n return tf.util.fetch(url).then((d) => d.json());\n}\n\nasync function load(config) {\n const [anchors, handDetectorModel, handPoseModel] = await Promise.all([\n loadAnchors(config.detector.anchors),\n tf.loadGraphModel(config.detector.modelPath, { fromTFHub: config.detector.modelPath.includes('tfhub.dev') }),\n tf.loadGraphModel(config.skeleton.modelPath, { fromTFHub: config.skeleton.modelPath.includes('tfhub.dev') }),\n ]);\n const detector = new hand.HandDetector(handDetectorModel, anchors, config);\n const pipeline = new pipe.HandPipeline(detector, handPoseModel, config);\n const handpose = new HandPose(pipeline);\n return handpose;\n}\nexports.load = load;\n", "/* eslint-disable no-shadow */\n/* eslint-disable prefer-rest-params */\n/* eslint-disable no-sequences */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-use-before-define */\n/*\nWebGLImageFilter - MIT Licensed\n2013, Dominic Szablewski - phoboslab.org\n*/\n\nconst WebGLProgram = function (gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (gl, source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n throw new Error('Filter: GL compile failed', gl.getShaderInfoLog(shader));\n }\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n\n const _vsh = _compile(gl, vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(gl, fragmentSource, gl.FRAGMENT_SHADER);\n\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) {\n throw new Error('Filter: GL link failed', gl.getProgramInfoLog(this.id));\n }\n\n gl.useProgram(this.id);\n\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) {\n this.attribute[a] = gl.getAttribLocation(this.id, a);\n }\n\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) {\n this.uniform[u] = gl.getUniformLocation(this.id, u);\n }\n};\n\nconst WebGLImageFilter = function (params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _canvas = params.canvas || document.createElement('canvas');\n\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n\n const gl = _canvas.getContext('webgl') || _canvas.getContext('experimental-webgl');\n if (!gl) throw new Error('Filter: getContext() failed');\n\n this.addFilter = function (name) {\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n\n // No filters? Just draw\n if (_filterChain.length === 0) {\n const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n\n return _canvas;\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n\n _canvas.width = _width = width;\n _canvas.height = _height = height;\n\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n _vertexBuffer = gl.createBuffer(),\n gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n\n // Note sure if this is a good idea; at least it makes texture loading\n // in Ejecta instant.\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n\n gl.viewport(0, 0, _width, _height);\n\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index]\n || _createFramebufferTexture(_width, _height);\n\n return _tempFramebuffers[index];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n return { fbo, texture };\n };\n\n const _draw = function (flags) {\n let source = null;\n let target = null;\n let flipY = false;\n\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex).texture;\n }\n _drawCount++;\n\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex).fbo;\n }\n\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n\n // Compile shaders\n _currentProgram = new WebGLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n let DRAW = { INTERMEDIATE: 1 };\n\n let SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n\n let _filter = {};\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n\n const program = _compileShader(_filter.blur.SHADER);\n\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n\n const program = _compileShader(_filter.pixelate.SHADER);\n\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n};\n\nexports.Canvas = WebGLImageFilter;\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\nexport default {\n backend: 'webgl', // select tfjs backend to use\n console: true, // enable debugging output to console\n scoped: false, // enable scoped runs\n // some models *may* have memory leaks, this wrapps everything in a local scope at a cost of performance\n // typically not needed\n videoOptimized: true, // perform additional optimizations when input is video, must be disabled for images\n filter: {\n enabled: true, // enable image pre-processing filters\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models: detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: '../models/blazeface/back/model.json', // can be 'front' or 'back'.\n // 'front' is optimized for large faces such as front-facing camera and 'back' is optimized for distanct faces.\n inputSize: 256, // fixed value: 128 for front and 256 for 'back'\n maxFaces: 10, // maximum number of faces detected in the input, should be set to the minimum number for performance\n skipFrames: 10, // how many frames to go without re-running the face bounding box detector, only used for video inputs\n // if model is running st 25 FPS, we can re-use existing bounding box for updated face mesh analysis\n // as face probably hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.3, // threshold for deciding whether boxes overlap too much in non-maximum suppression\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n },\n mesh: {\n enabled: true,\n modelPath: '../models/facemesh/model.json',\n inputSize: 192, // fixed value\n },\n iris: {\n enabled: true,\n modelPath: '../models/iris/model.json',\n enlargeFactor: 2.3, // empiric tuning\n inputSize: 64, // fixed value\n },\n age: {\n enabled: true,\n modelPath: '../models/ssrnet-age/imdb/model.json', // can be 'imdb' or 'wiki'\n // which determines training set for model\n inputSize: 64, // fixed value\n skipFrames: 10, // how many frames to go without re-running the detector, only used for video inputs\n },\n gender: {\n enabled: true,\n minConfidence: 0.8, // threshold for discarding a prediction\n modelPath: '../models/ssrnet-gender/imdb/model.json',\n },\n emotion: {\n enabled: true,\n inputSize: 64, // fixed value\n minConfidence: 0.5, // threshold for discarding a prediction\n skipFrames: 10, // how many frames to go without re-running the detector\n modelPath: '../models/emotion/model.json',\n },\n },\n body: {\n enabled: true,\n modelPath: '../models/posenet/model.json',\n inputResolution: 257, // fixed value\n outputStride: 16, // fixed value\n maxDetections: 10, // maximum number of people detected in the input, should be set to the minimum number for performance\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n nmsRadius: 20, // radius for deciding points are too close in non-maximum suppression\n },\n hand: {\n enabled: true,\n inputSize: 256, // fixed value\n skipFrames: 10, // how many frames to go without re-running the hand bounding box detector, only used for video inputs\n // if model is running st 25 FPS, we can re-use existing bounding box for updated hand skeleton analysis\n // as the hand probably hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.3, // threshold for deciding whether boxes overlap too much in non-maximum suppression\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n enlargeFactor: 1.65, // empiric tuning as skeleton prediction prefers hand box with some whitespace\n maxHands: 10, // maximum number of hands detected in the input, should be set to the minimum number for performance\n detector: {\n anchors: '../models/handdetect/anchors.json',\n modelPath: '../models/handdetect/model.json',\n },\n skeleton: {\n modelPath: '../models/handskeleton/model.json',\n },\n },\n};\n", "const tf = require('@tensorflow/tfjs');\nconst facemesh = require('./facemesh/facemesh.js');\nconst ssrnet = require('./ssrnet/ssrnet.js');\nconst emotion = require('./emotion/emotion.js');\nconst posenet = require('./posenet/posenet.js');\nconst handpose = require('./handpose/handpose.js');\nconst fxImage = require('./imagefx.js');\nconst defaults = require('../config.js').default;\nconst app = require('../package.json');\n\nlet first = true;\n\n// static config override for non-video detection\nconst override = {\n face: { detector: { skipFrames: 0 }, age: { skipFrames: 0 }, emotion: { skipFrames: 0 } },\n hand: { skipFrames: 0 },\n};\n\n// helper function: gets elapsed time on both browser and nodejs\nconst now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt(Number(process.hrtime.bigint()) / 1000 / 1000);\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nfunction mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) {\n prev[key] = pVal.concat(...oVal);\n } else if (isObject(pVal) && isObject(oVal)) {\n prev[key] = mergeDeep(pVal, oVal);\n } else {\n prev[key] = oVal;\n }\n });\n return prev;\n }, {});\n}\n\nfunction sanity(input) {\n if (!input) return 'input is not defined';\n if (tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) {\n return 'input must be a tensor';\n }\n try {\n tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n}\n\nclass Human {\n constructor() {\n this.tf = tf;\n this.version = app.version;\n this.defaults = defaults;\n this.config = defaults;\n this.fx = (tf.ENV.flags.IS_BROWSER && (typeof document !== 'undefined')) ? new fxImage.Canvas() : null;\n this.state = 'idle';\n this.numTensors = 0;\n this.analyzeMemoryLeaks = false;\n // object that contains all initialized models\n this.models = {\n facemesh: null,\n posenet: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n };\n // export raw access to underlying models\n this.facemesh = facemesh;\n this.ssrnet = ssrnet;\n this.emotion = emotion;\n this.posenet = posenet;\n this.handpose = handpose;\n }\n\n // helper function: wrapper around console output\n log(...msg) {\n // eslint-disable-next-line no-console\n if (msg && this.config.console) console.log(...msg);\n }\n\n // helper function: measure tensor leak\n analyze(...msg) {\n if (!this.analyzeMemoryLeaks) return;\n const current = tf.engine().state.numTensors;\n const previous = this.numTensors;\n this.numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) this.log(...msg, leaked);\n }\n\n async load(userConfig) {\n if (userConfig) this.config = mergeDeep(defaults, userConfig);\n if (this.config.face.enabled && !this.models.facemesh) {\n this.log('Load model: Face');\n this.models.facemesh = await facemesh.load(this.config.face);\n }\n if (this.config.body.enabled && !this.models.posenet) {\n this.log('Load model: Body');\n this.models.posenet = await posenet.load(this.config.body);\n }\n if (this.config.hand.enabled && !this.models.handpose) {\n this.log('Load model: Hand');\n this.models.handpose = await handpose.load(this.config.hand);\n }\n if (this.config.face.enabled && this.config.face.age.enabled && !this.models.age) {\n this.log('Load model: Age');\n this.models.age = await ssrnet.loadAge(this.config);\n }\n if (this.config.face.enabled && this.config.face.gender.enabled && !this.models.gender) {\n this.log('Load model: Gender');\n this.models.gender = await ssrnet.loadGender(this.config);\n }\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) {\n this.log('Load model: Emotion');\n this.models.emotion = await emotion.load(this.config);\n }\n }\n\n tfImage(input) {\n // let imageData;\n let filtered;\n if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {\n const width = input.naturalWidth || input.videoWidth || input.width || (input.shape && (input.shape[1] > 0));\n const height = input.naturalHeight || input.videoHeight || input.height || (input.shape && (input.shape[2] > 0));\n const offscreenCanvas = new OffscreenCanvas(width, height);\n const ctx = offscreenCanvas.getContext('2d');\n if (input instanceof ImageData) ctx.putImageData(input, 0, 0);\n else ctx.drawImage(input, 0, 0, width, height, 0, 0, offscreenCanvas.width, offscreenCanvas.height);\n this.fx.reset();\n this.fx.addFilter('brightness', this.config.filter.brightness); // must have at least one filter enabled\n if (this.config.filter.contrast !== 0) this.fx.addFilter('contrast', this.config.filter.contrast);\n if (this.config.filter.sharpness !== 0) this.fx.addFilter('sharpen', this.config.filter.sharpness);\n if (this.config.filter.blur !== 0) this.fx.addFilter('blur', this.config.filter.blur);\n if (this.config.filter.saturation !== 0) this.fx.addFilter('saturation', this.config.filter.saturation);\n if (this.config.filter.hue !== 0) this.fx.addFilter('hue', this.config.filter.hue);\n if (this.config.filter.negative) this.fx.addFilter('negative');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.vintage) this.fx.addFilter('brownie');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.kodachrome) this.fx.addFilter('kodachrome');\n if (this.config.filter.technicolor) this.fx.addFilter('technicolor');\n if (this.config.filter.polaroid) this.fx.addFilter('polaroid');\n if (this.config.filter.pixelate !== 0) this.fx.addFilter('pixelate', this.config.filter.pixelate);\n filtered = this.fx.apply(offscreenCanvas);\n }\n let tensor;\n if (input instanceof tf.Tensor) {\n tensor = tf.clone(input);\n } else {\n const pixels = tf.browser.fromPixels(filtered || input);\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n return { tensor, canvas: this.config.filter.return ? filtered : null };\n }\n\n async detect(input, userConfig = {}) {\n this.state = 'config';\n const perf = {};\n let timeStamp;\n\n timeStamp = now();\n this.config = mergeDeep(defaults, userConfig);\n if (!this.config.videoOptimized) this.config = mergeDeep(this.config, override);\n perf.config = Math.trunc(now() - timeStamp);\n\n // sanity checks\n timeStamp = now();\n this.state = 'check';\n const error = sanity(input);\n if (error) {\n this.log(error, input);\n return { error };\n }\n perf.sanity = Math.trunc(now() - timeStamp);\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve) => {\n const timeStart = now();\n\n // configure backend\n timeStamp = now();\n if (tf.getBackend() !== this.config.backend) {\n this.state = 'backend';\n this.log('Human library setting backend:', this.config.backend);\n await tf.setBackend(this.config.backend);\n await tf.ready();\n }\n perf.backend = Math.trunc(now() - timeStamp);\n\n // check number of loaded models\n if (first) {\n this.log('Human library starting');\n this.log('Configuration:', this.config);\n this.log('Flags:', tf.ENV.flags);\n first = false;\n }\n\n // load models if enabled\n timeStamp = now();\n this.state = 'load';\n await this.load();\n perf.load = Math.trunc(now() - timeStamp);\n\n if (this.config.scoped) tf.engine().startScope();\n\n this.analyze('Start Detect:');\n\n timeStamp = now();\n const image = this.tfImage(input);\n perf.image = Math.trunc(now() - timeStamp);\n const imageTensor = image.tensor;\n\n // run posenet\n this.state = 'run:body';\n timeStamp = now();\n this.analyze('Start PoseNet');\n const poseRes = this.config.body.enabled ? await this.models.posenet.estimatePoses(imageTensor, this.config.body) : [];\n this.analyze('End PoseNet:');\n perf.body = Math.trunc(now() - timeStamp);\n\n // run handpose\n this.state = 'run:hand';\n timeStamp = now();\n this.analyze('Start HandPose:');\n const handRes = this.config.hand.enabled ? await this.models.handpose.estimateHands(imageTensor, this.config.hand) : [];\n this.analyze('End HandPose:');\n perf.hand = Math.trunc(now() - timeStamp);\n\n // run facemesh, includes blazeface and iris\n const faceRes = [];\n if (this.config.face.enabled) {\n this.state = 'run:face';\n timeStamp = now();\n this.analyze('Start FaceMesh:');\n const faces = await this.models.facemesh.estimateFaces(imageTensor, this.config.face);\n perf.face = Math.trunc(now() - timeStamp);\n for (const face of faces) {\n // is something went wrong, skip the face\n if (!face.image || face.image.isDisposedInternal) {\n this.log('face object is disposed:', face.image);\n continue;\n }\n // run ssr-net age & gender, inherits face from blazeface\n this.state = 'run:agegender';\n timeStamp = now();\n const ssrData = (this.config.face.age.enabled || this.config.face.gender.enabled) ? await ssrnet.predict(face.image, this.config) : {};\n perf.agegender = Math.trunc(now() - timeStamp);\n // run emotion, inherits face from blazeface\n this.state = 'run:emotion';\n timeStamp = now();\n const emotionData = this.config.face.emotion.enabled ? await emotion.predict(face.image, this.config) : {};\n perf.emotion = Math.trunc(now() - timeStamp);\n\n // dont need face anymore\n face.image.dispose();\n // calculate iris distance\n // iris: array[ bottom, left, top, right, center ]\n const iris = (face.annotations.leftEyeIris && face.annotations.rightEyeIris)\n ? Math.max(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0], face.annotations.rightEyeIris[3][0] - face.annotations.rightEyeIris[1][0])\n : 0;\n faceRes.push({\n confidence: face.confidence,\n box: face.box,\n mesh: face.mesh,\n annotations: face.annotations,\n age: ssrData.age,\n gender: ssrData.gender,\n agConfidence: ssrData.confidence,\n emotion: emotionData,\n iris: (iris !== 0) ? Math.trunc(100 * 11.7 /* human iris size in mm */ / iris) / 100 : 0,\n });\n this.analyze('End FaceMesh:');\n }\n }\n\n imageTensor.dispose();\n this.state = 'idle';\n\n if (this.config.scoped) tf.engine().endScope();\n this.analyze('End Scope:');\n\n perf.total = Math.trunc(now() - timeStart);\n resolve({ face: faceRes, body: poseRes, hand: handRes, performance: perf, canvas: image.canvas });\n });\n }\n}\n\nexport { Human as default };\n", "const tf = require('@tensorflow/tfjs');\nconst facemesh = require('./facemesh/facemesh.js');\nconst ssrnet = require('./ssrnet/ssrnet.js');\nconst emotion = require('./emotion/emotion.js');\nconst posenet = require('./posenet/posenet.js');\nconst handpose = require('./handpose/handpose.js');\nconst fxImage = require('./imagefx.js');\nconst defaults = require('../config.js').default;\nconst app = require('../package.json');\n\nlet first = true;\n\n// static config override for non-video detection\nconst override = {\n face: { detector: { skipFrames: 0 }, age: { skipFrames: 0 }, emotion: { skipFrames: 0 } },\n hand: { skipFrames: 0 },\n};\n\n// helper function: gets elapsed time on both browser and nodejs\nconst now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt(Number(process.hrtime.bigint()) / 1000 / 1000);\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nfunction mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) {\n prev[key] = pVal.concat(...oVal);\n } else if (isObject(pVal) && isObject(oVal)) {\n prev[key] = mergeDeep(pVal, oVal);\n } else {\n prev[key] = oVal;\n }\n });\n return prev;\n }, {});\n}\n\nfunction sanity(input) {\n if (!input) return 'input is not defined';\n if (tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) {\n return 'input must be a tensor';\n }\n try {\n tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n}\n\nclass Human {\n constructor() {\n this.tf = tf;\n this.version = app.version;\n this.defaults = defaults;\n this.config = defaults;\n this.fx = (tf.ENV.flags.IS_BROWSER && (typeof document !== 'undefined')) ? new fxImage.Canvas() : null;\n this.state = 'idle';\n this.numTensors = 0;\n this.analyzeMemoryLeaks = false;\n // object that contains all initialized models\n this.models = {\n facemesh: null,\n posenet: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n };\n // export raw access to underlying models\n this.facemesh = facemesh;\n this.ssrnet = ssrnet;\n this.emotion = emotion;\n this.posenet = posenet;\n this.handpose = handpose;\n }\n\n // helper function: wrapper around console output\n log(...msg) {\n // eslint-disable-next-line no-console\n if (msg && this.config.console) console.log(...msg);\n }\n\n // helper function: measure tensor leak\n analyze(...msg) {\n if (!this.analyzeMemoryLeaks) return;\n const current = tf.engine().state.numTensors;\n const previous = this.numTensors;\n this.numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) this.log(...msg, leaked);\n }\n\n async load(userConfig) {\n if (userConfig) this.config = mergeDeep(defaults, userConfig);\n if (this.config.face.enabled && !this.models.facemesh) {\n this.log('Load model: Face');\n this.models.facemesh = await facemesh.load(this.config.face);\n }\n if (this.config.body.enabled && !this.models.posenet) {\n this.log('Load model: Body');\n this.models.posenet = await posenet.load(this.config.body);\n }\n if (this.config.hand.enabled && !this.models.handpose) {\n this.log('Load model: Hand');\n this.models.handpose = await handpose.load(this.config.hand);\n }\n if (this.config.face.enabled && this.config.face.age.enabled && !this.models.age) {\n this.log('Load model: Age');\n this.models.age = await ssrnet.loadAge(this.config);\n }\n if (this.config.face.enabled && this.config.face.gender.enabled && !this.models.gender) {\n this.log('Load model: Gender');\n this.models.gender = await ssrnet.loadGender(this.config);\n }\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) {\n this.log('Load model: Emotion');\n this.models.emotion = await emotion.load(this.config);\n }\n }\n\n tfImage(input) {\n // let imageData;\n let filtered;\n if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {\n const width = input.naturalWidth || input.videoWidth || input.width || (input.shape && (input.shape[1] > 0));\n const height = input.naturalHeight || input.videoHeight || input.height || (input.shape && (input.shape[2] > 0));\n const offscreenCanvas = new OffscreenCanvas(width, height);\n const ctx = offscreenCanvas.getContext('2d');\n if (input instanceof ImageData) ctx.putImageData(input, 0, 0);\n else ctx.drawImage(input, 0, 0, width, height, 0, 0, offscreenCanvas.width, offscreenCanvas.height);\n this.fx.reset();\n this.fx.addFilter('brightness', this.config.filter.brightness); // must have at least one filter enabled\n if (this.config.filter.contrast !== 0) this.fx.addFilter('contrast', this.config.filter.contrast);\n if (this.config.filter.sharpness !== 0) this.fx.addFilter('sharpen', this.config.filter.sharpness);\n if (this.config.filter.blur !== 0) this.fx.addFilter('blur', this.config.filter.blur);\n if (this.config.filter.saturation !== 0) this.fx.addFilter('saturation', this.config.filter.saturation);\n if (this.config.filter.hue !== 0) this.fx.addFilter('hue', this.config.filter.hue);\n if (this.config.filter.negative) this.fx.addFilter('negative');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.vintage) this.fx.addFilter('brownie');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.kodachrome) this.fx.addFilter('kodachrome');\n if (this.config.filter.technicolor) this.fx.addFilter('technicolor');\n if (this.config.filter.polaroid) this.fx.addFilter('polaroid');\n if (this.config.filter.pixelate !== 0) this.fx.addFilter('pixelate', this.config.filter.pixelate);\n filtered = this.fx.apply(offscreenCanvas);\n }\n let tensor;\n if (input instanceof tf.Tensor) {\n tensor = tf.clone(input);\n } else {\n const pixels = tf.browser.fromPixels(filtered || input);\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n return { tensor, canvas: this.config.filter.return ? filtered : null };\n }\n\n async detect(input, userConfig = {}) {\n this.state = 'config';\n const perf = {};\n let timeStamp;\n\n timeStamp = now();\n this.config = mergeDeep(defaults, userConfig);\n if (!this.config.videoOptimized) this.config = mergeDeep(this.config, override);\n perf.config = Math.trunc(now() - timeStamp);\n\n // sanity checks\n timeStamp = now();\n this.state = 'check';\n const error = sanity(input);\n if (error) {\n this.log(error, input);\n return { error };\n }\n perf.sanity = Math.trunc(now() - timeStamp);\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve) => {\n const timeStart = now();\n\n // configure backend\n timeStamp = now();\n if (tf.getBackend() !== this.config.backend) {\n this.state = 'backend';\n this.log('Human library setting backend:', this.config.backend);\n await tf.setBackend(this.config.backend);\n await tf.ready();\n }\n perf.backend = Math.trunc(now() - timeStamp);\n\n // check number of loaded models\n if (first) {\n this.log('Human library starting');\n this.log('Configuration:', this.config);\n this.log('Flags:', tf.ENV.flags);\n first = false;\n }\n\n // load models if enabled\n timeStamp = now();\n this.state = 'load';\n await this.load();\n perf.load = Math.trunc(now() - timeStamp);\n\n if (this.config.scoped) tf.engine().startScope();\n\n this.analyze('Start Detect:');\n\n timeStamp = now();\n const image = this.tfImage(input);\n perf.image = Math.trunc(now() - timeStamp);\n const imageTensor = image.tensor;\n\n // run posenet\n this.state = 'run:body';\n timeStamp = now();\n this.analyze('Start PoseNet');\n const poseRes = this.config.body.enabled ? await this.models.posenet.estimatePoses(imageTensor, this.config.body) : [];\n this.analyze('End PoseNet:');\n perf.body = Math.trunc(now() - timeStamp);\n\n // run handpose\n this.state = 'run:hand';\n timeStamp = now();\n this.analyze('Start HandPose:');\n const handRes = this.config.hand.enabled ? await this.models.handpose.estimateHands(imageTensor, this.config.hand) : [];\n this.analyze('End HandPose:');\n perf.hand = Math.trunc(now() - timeStamp);\n\n // run facemesh, includes blazeface and iris\n const faceRes = [];\n if (this.config.face.enabled) {\n this.state = 'run:face';\n timeStamp = now();\n this.analyze('Start FaceMesh:');\n const faces = await this.models.facemesh.estimateFaces(imageTensor, this.config.face);\n perf.face = Math.trunc(now() - timeStamp);\n for (const face of faces) {\n // is something went wrong, skip the face\n if (!face.image || face.image.isDisposedInternal) {\n this.log('face object is disposed:', face.image);\n continue;\n }\n // run ssr-net age & gender, inherits face from blazeface\n this.state = 'run:agegender';\n timeStamp = now();\n const ssrData = (this.config.face.age.enabled || this.config.face.gender.enabled) ? await ssrnet.predict(face.image, this.config) : {};\n perf.agegender = Math.trunc(now() - timeStamp);\n // run emotion, inherits face from blazeface\n this.state = 'run:emotion';\n timeStamp = now();\n const emotionData = this.config.face.emotion.enabled ? await emotion.predict(face.image, this.config) : {};\n perf.emotion = Math.trunc(now() - timeStamp);\n\n // dont need face anymore\n face.image.dispose();\n // calculate iris distance\n // iris: array[ bottom, left, top, right, center ]\n const iris = (face.annotations.leftEyeIris && face.annotations.rightEyeIris)\n ? Math.max(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0], face.annotations.rightEyeIris[3][0] - face.annotations.rightEyeIris[1][0])\n : 0;\n faceRes.push({\n confidence: face.confidence,\n box: face.box,\n mesh: face.mesh,\n annotations: face.annotations,\n age: ssrData.age,\n gender: ssrData.gender,\n agConfidence: ssrData.confidence,\n emotion: emotionData,\n iris: (iris !== 0) ? Math.trunc(100 * 11.7 /* human iris size in mm */ / iris) / 100 : 0,\n });\n this.analyze('End FaceMesh:');\n }\n }\n\n imageTensor.dispose();\n this.state = 'idle';\n\n if (this.config.scoped) tf.engine().endScope();\n this.analyze('End Scope:');\n\n perf.total = Math.trunc(now() - timeStart);\n resolve({ face: faceRes, body: poseRes, hand: handRes, performance: perf, canvas: image.canvas });\n });\n }\n}\n\nexport { Human as default };\n"],
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA,QAAM,MAAK;AAEX,QAAM,gBAAgB;AAEtB,2BAAyB;AACvB,UAAM,OAAO,CAAE,SAAS,CAAC,YAAY,IAAI,YAAY,IAAI,SAAS,CAAC,GAAG;AACtE,UAAM,UAAU;AAChB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,QAAQ;AACvC,YAAM,SAAS,KAAK,QAAQ;AAC5B,YAAM,WAAW,KAAK,MAAO,aAAY,SAAS,KAAK;AACvD,YAAM,WAAW,KAAK,MAAO,aAAY,SAAS,KAAK;AACvD,YAAM,aAAa,KAAK,QAAQ;AACh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AAK,MAAM;AAGX,gBAAM,OAAQ,KAAK,YAAY,eAAe,KAAK,YAAY,eAC3D,KAAK,IAAI,KAAK,YAAY,YAAY,GAAG,KAAK,KAAK,YAAY,YAAY,GAAG,IAAI,KAAK,YAAY,aAAa,GAAG,KAAK,KAAK,YAAY,aAAa,GAAG,MACzJ;AACJ,kBAAQ,KAAK;AAAA,YACX,YAAY,KAAK;AAAA,YACjB,KAAK,KAAK;AAAA,YACV,MAAM,KAAK;AAAA,YACX,aAAa,KAAK;AAAA,YAClB,KAAK,QAAQ;AAAA,YACb,QAAQ,QAAQ;AAAA,YAChB,cAAc,QAAQ;AAAA,YACtB,SAAS;AAAA,YACT,MAAO,SAAS,IAAK,KAAK,MAAM,MAAM,OAAmC,QAAQ,MAAM;AAAA;AAEzF,eAAK,QAAQ;AAAA;AAAA;AAIjB,kBAAY;AACZ,WAAK,QAAQ;AAEb,UAAI,KAAK,OAAO;AAAQ,WAAG,SAAS;AACpC,WAAK,QAAQ;AAEb,WAAK,QAAQ,KAAK,MAAM,QAAQ;AAChC,cAAQ,CAAE,MAAM,SAAS,MAAM,SAAS,MAAM,SAAS,aAAa,MAAM,QAAQ,MAAM;AAAA;AAAA;AAAA;",
+ "sourcesContent": ["const tf = require('@tensorflow/tfjs');\n\nconst NUM_LANDMARKS = 6;\n\nfunction generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) {\n anchors.push([anchorX, anchorY]);\n }\n }\n }\n }\n return anchors;\n}\n\nconst disposeBox = (box) => {\n box.startEndTensor.dispose();\n box.startPoint.dispose();\n box.endPoint.dispose();\n};\n\nconst createBox = (startEndTensor) => ({\n startEndTensor,\n startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]),\n endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),\n});\n\nconst scaleBox = (box, factors) => {\n const starts = tf.mul(box.startPoint, factors);\n const ends = tf.mul(box.endPoint, factors);\n const newCoordinates = tf.concat2d([starts, ends], 1);\n return createBox(newCoordinates);\n};\n\nfunction decodeBounds(boxOutputs, anchors, inputSize) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nfunction scaleBoxFromPrediction(face, scaleFactor) {\n return tf.tidy(() => {\n const box = face['box'] ? face['box'] : face;\n return scaleBox(box, scaleFactor).startEndTensor.squeeze();\n });\n}\n\nclass BlazeFaceModel {\n constructor(model, config) {\n this.blazeFaceModel = model;\n this.width = config.detector.inputSize;\n this.height = config.detector.inputSize;\n this.maxFaces = config.detector.maxFaces;\n this.anchorsData = generateAnchors(config.detector.inputSize);\n this.anchors = tf.tensor2d(this.anchorsData);\n this.inputSize = tf.tensor1d([this.width, this.height]);\n this.iouThreshold = config.detector.iouThreshold;\n this.scaleFaces = 0.8;\n this.scoreThreshold = config.detector.scoreThreshold;\n }\n\n // toto blazeface leaks two tensors per run\n async getBoundingBoxes(inputImage) {\n // sanity check on input\n if ((!inputImage) || (inputImage.isDisposedInternal) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return null;\n const [detectedOutputs, boxes, scores] = tf.tidy(() => {\n const resizedImage = inputImage.resizeBilinear([this.width, this.height]);\n const normalizedImage = tf.mul(tf.sub(resizedImage.div(255), 0.5), 2);\n const batchedPrediction = this.blazeFaceModel.predict(normalizedImage);\n let prediction;\n // are we using tfhub or pinto converted model?\n if (Array.isArray(batchedPrediction)) {\n const sorted = batchedPrediction.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n prediction = concat.squeeze(0);\n } else {\n prediction = batchedPrediction.squeeze(); // when using tfhub model\n }\n const decodedBounds = decodeBounds(prediction, this.anchors, this.inputSize);\n const logits = tf.slice(prediction, [0, 0], [-1, 1]);\n const scoresOut = tf.sigmoid(logits).squeeze();\n return [prediction, decodedBounds, scoresOut];\n });\n const boxIndicesTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.maxFaces, this.iouThreshold, this.scoreThreshold);\n const boxIndices = await boxIndicesTensor.array();\n boxIndicesTensor.dispose();\n const boundingBoxesMap = boxIndices.map((boxIndex) => tf.slice(boxes, [boxIndex, 0], [1, -1]));\n const boundingBoxes = await Promise.all(boundingBoxesMap.map(async (boundingBox) => {\n const vals = await boundingBox.array();\n boundingBox.dispose();\n return vals;\n }));\n const annotatedBoxes = [];\n for (let i = 0; i < boundingBoxes.length; i++) {\n const boundingBox = boundingBoxes[i];\n const box = createBox(boundingBox);\n const boxIndex = boxIndices[i];\n const anchor = this.anchorsData[boxIndex];\n const sliced = tf.slice(detectedOutputs, [boxIndex, NUM_LANDMARKS - 1], [1, -1]);\n const squeezed = sliced.squeeze();\n const landmarks = squeezed.reshape([NUM_LANDMARKS, -1]);\n /*\n const landmarks = tf\n .slice(detectedOutputs, [boxIndex, NUM_LANDMARKS - 1], [1, -1])\n .squeeze()\n .reshape([NUM_LANDMARKS, -1]);\n */\n const probability = tf.slice(scores, [boxIndex], [1]);\n const annotatedBox = { box, landmarks, probability, anchor };\n annotatedBoxes.push(annotatedBox);\n sliced.dispose();\n squeezed.dispose();\n // landmarks.dispose();\n }\n detectedOutputs.dispose();\n boxes.dispose();\n scores.dispose();\n detectedOutputs.dispose();\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / this.width, inputImage.shape[1] / this.height],\n };\n }\n\n async estimateFaces(input) {\n const { boxes, scaleFactor } = await this.getBoundingBoxes(input);\n return Promise.all(boxes.map(async (face) => {\n const scaledBox = scaleBoxFromPrediction(face, scaleFactor);\n const [landmarkData, boxData, probabilityData] = await Promise.all([face.landmarks, scaledBox, face.probability].map(async (d) => d.array()));\n const anchor = face.anchor;\n const [scaleFactorX, scaleFactorY] = scaleFactor;\n const scaledLandmarks = landmarkData\n .map((landmark) => ([\n (landmark[0] + anchor[0]) * scaleFactorX,\n (landmark[1] + anchor[1]) * scaleFactorY,\n ]));\n const normalizedFace = {\n topLeft: boxData.slice(0, 2),\n bottomRight: boxData.slice(2),\n landmarks: scaledLandmarks,\n probability: probabilityData,\n };\n disposeBox(face.box);\n face.landmarks.dispose();\n face.probability.dispose();\n scaledBox.dispose();\n return normalizedFace;\n }));\n }\n}\n\nasync function load(config) {\n const blazeface = await tf.loadGraphModel(config.detector.modelPath, { fromTFHub: config.detector.modelPath.includes('tfhub.dev') });\n const model = new BlazeFaceModel(blazeface, config);\n return model;\n}\n\nexports.load = load;\nexports.BlazeFaceModel = BlazeFaceModel;\nexports.disposeBox = disposeBox;\n", "exports.MESH_ANNOTATIONS = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\nexports.MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n", "const tf = require('@tensorflow/tfjs');\n\nfunction scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n}\nexports.scaleBoxCoordinates = scaleBoxCoordinates;\nfunction getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\nexports.getBoxSize = getBoxSize;\nfunction getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\nexports.getBoxCenter = getBoxCenter;\nfunction cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\nexports.cutBoxFromImageAndResize = cutBoxFromImageAndResize;\nfunction enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\nexports.enlargeBox = enlargeBox;\nfunction squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\nexports.squarifyBox = squarifyBox;\n", "exports.IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n/**\n * Normalizes the provided angle to the range -pi to pi.\n * @param angle The angle in radians to be normalized.\n */\nfunction normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\nexports.normalizeRadians = normalizeRadians;\n/**\n * Computes the angle of rotation between two anchor points.\n * @param point1 First anchor point\n * @param point2 Second anchor point\n */\nfunction computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\nexports.computeRotation = computeRotation;\nfunction radToDegrees(rad) {\n return rad * 180 / Math.PI;\n}\nexports.radToDegrees = radToDegrees;\nfunction buildTranslationMatrix(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n}\nfunction dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\nexports.dot = dot;\nfunction getColumnFrom2DArr(arr, columnIndex) {\n const column = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\nexports.getColumnFrom2DArr = getColumnFrom2DArr;\nfunction multiplyTransformMatrices(mat1, mat2) {\n const product = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\nfunction buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\nexports.buildRotationMatrix = buildRotationMatrix;\nfunction invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\nexports.invertTransformMatrix = invertTransformMatrix;\nfunction rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\nexports.rotatePoint = rotatePoint;\nfunction xyDistanceBetweenPoints(a, b) {\n return Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n}\nexports.xyDistanceBetweenPoints = xyDistanceBetweenPoints;\n", "/* eslint-disable class-methods-use-this */\nconst tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\nconst keypoints = require('./keypoints');\nconst util = require('./util');\n\nconst LANDMARKS_COUNT = 468;\nconst UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD = 0.25;\nconst MESH_MOUTH_INDEX = 13;\nconst MESH_KEYPOINTS_LINE_OF_SYMMETRY_INDICES = [MESH_MOUTH_INDEX, keypoints.MESH_ANNOTATIONS['midwayBetweenEyes'][0]];\nconst BLAZEFACE_MOUTH_INDEX = 3;\nconst BLAZEFACE_NOSE_INDEX = 2;\nconst BLAZEFACE_KEYPOINTS_LINE_OF_SYMMETRY_INDICES = [BLAZEFACE_MOUTH_INDEX, BLAZEFACE_NOSE_INDEX];\nconst LEFT_EYE_OUTLINE = keypoints.MESH_ANNOTATIONS['leftEyeLower0'];\nconst LEFT_EYE_BOUNDS = [LEFT_EYE_OUTLINE[0], LEFT_EYE_OUTLINE[LEFT_EYE_OUTLINE.length - 1]];\nconst RIGHT_EYE_OUTLINE = keypoints.MESH_ANNOTATIONS['rightEyeLower0'];\nconst RIGHT_EYE_BOUNDS = [RIGHT_EYE_OUTLINE[0], RIGHT_EYE_OUTLINE[RIGHT_EYE_OUTLINE.length - 1]];\nconst IRIS_UPPER_CENTER_INDEX = 3;\nconst IRIS_LOWER_CENTER_INDEX = 4;\nconst IRIS_IRIS_INDEX = 71;\nconst IRIS_NUM_COORDINATES = 76;\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates. Update the z coordinate to be an average of the original and the new. This produces the best visual effect.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < keypoints.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = keypoints.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = keypoints.MESH_ANNOTATIONS[`${prefix}${key}`];\n const shouldReplaceAllKeys = keys == null;\n if (shouldReplaceAllKeys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n// The Pipeline coordinates between the bounding box and skeleton models.\nclass Pipeline {\n constructor(boundingBoxDetector, meshDetector, irisModel, config) {\n // An array of facial bounding boxes.\n this.regionsOfInterest = [];\n this.runsWithoutFaceDetector = 0;\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.irisModel = irisModel;\n this.meshWidth = config.mesh.inputSize;\n this.meshHeight = config.mesh.inputSize;\n this.irisSize = config.iris.inputSize;\n this.irisEnlarge = config.iris.enlargeFactor;\n }\n\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const scaleFactor = [boxSize[0] / this.meshWidth, boxSize[1] / this.meshHeight];\n const coordsScaled = rawCoords.map((coord) => ([\n scaleFactor[0] * (coord[0] - this.meshWidth / 2),\n scaleFactor[1] * (coord[1] - this.meshHeight / 2), coord[2],\n ]));\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => ([...util.rotatePoint(coord, coordsRotationMatrix), coord[2]]));\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => ([\n coord[0] + originalBoxCenter[0],\n coord[1] + originalBoxCenter[1], coord[2],\n ]));\n }\n\n getLeftToRightEyeDepthDifference(rawCoords) {\n const leftEyeZ = rawCoords[LEFT_EYE_BOUNDS[0]][2];\n const rightEyeZ = rawCoords[RIGHT_EYE_BOUNDS[0]][2];\n return leftEyeZ - rightEyeZ;\n }\n\n // Returns a box describing a cropped region around the eye fit for passing to the iris model.\n getEyeBox(rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false) {\n const box = bounding.squarifyBox(bounding.enlargeBox(this.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), this.irisEnlarge));\n const boxSize = bounding.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / this.meshHeight,\n box.startPoint[0] / this.meshWidth, box.endPoint[1] / this.meshHeight,\n box.endPoint[0] / this.meshWidth,\n ]], [0], [this.irisSize, this.irisSize]);\n if (flip) {\n crop = tf.image.flipLeftRight(crop);\n }\n return { box, boxSize, crop };\n }\n\n // Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\n getEyeCoords(eyeData, eyeBox, eyeBoxSize, flip = false) {\n const eyeRawCoords = [];\n for (let i = 0; i < IRIS_NUM_COORDINATES; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip\n ? (1 - (x / this.irisSize))\n : (x / this.irisSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / this.irisSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(IRIS_IRIS_INDEX) };\n }\n\n // The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n getAdjustedIrisCoords(rawCoords, irisCoords, direction) {\n const upperCenterZ = rawCoords[keypoints.MESH_ANNOTATIONS[`${direction}EyeUpper0`][IRIS_UPPER_CENTER_INDEX]][2];\n const lowerCenterZ = rawCoords[keypoints.MESH_ANNOTATIONS[`${direction}EyeLower0`][IRIS_LOWER_CENTER_INDEX]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n }\n\n async predict(input, config) {\n this.skipFrames = config.detector.skipFrames;\n this.maxFaces = config.detector.maxFaces;\n this.runsWithoutFaceDetector++;\n if (this.shouldUpdateRegionsOfInterest()) {\n const detector = await this.boundingBoxDetector.getBoundingBoxes(input);\n if (detector.boxes.length === 0) {\n this.regionsOfInterest = [];\n return null;\n }\n const scaledBoxes = detector.boxes.map((prediction) => {\n const startPoint = prediction.box.startPoint.squeeze();\n const endPoint = prediction.box.endPoint.squeeze();\n const predictionBox = {\n startPoint: startPoint.arraySync(),\n endPoint: endPoint.arraySync(),\n };\n startPoint.dispose();\n endPoint.dispose();\n const scaledBox = bounding.scaleBoxCoordinates(predictionBox, detector.scaleFactor);\n const enlargedBox = bounding.enlargeBox(scaledBox);\n const landmarks = prediction.landmarks.arraySync();\n prediction.box.startPoint.dispose();\n prediction.box.endPoint.dispose();\n prediction.landmarks.dispose();\n prediction.probability.dispose();\n return { ...enlargedBox, landmarks };\n });\n this.updateRegionsOfInterest(scaledBoxes);\n this.runsWithoutFaceDetector = 0;\n }\n const results = tf.tidy(() => this.regionsOfInterest.map((box, i) => {\n let angle = 0;\n // The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).\n const boxLandmarksFromMeshModel = box.landmarks.length >= LANDMARKS_COUNT;\n let [indexOfMouth, indexOfForehead] = MESH_KEYPOINTS_LINE_OF_SYMMETRY_INDICES;\n if (boxLandmarksFromMeshModel === false) {\n [indexOfMouth, indexOfForehead] = BLAZEFACE_KEYPOINTS_LINE_OF_SYMMETRY_INDICES;\n }\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n let rotatedImage = input;\n let rotationMatrix = util.IDENTITY_MATRIX;\n if (angle !== 0) {\n rotatedImage = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized);\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n }\n const boxCPU = { startPoint: box.startPoint, endPoint: box.endPoint };\n const face = bounding.cutBoxFromImageAndResize(boxCPU, rotatedImage, [this.meshHeight, this.meshWidth]).div(255);\n // The first returned tensor represents facial contours, which are included in the coordinates.\n const [, flag, coords] = this.meshDetector.predict(face);\n const coordsReshaped = tf.reshape(coords, [-1, 3]);\n let rawCoords = coordsReshaped.arraySync();\n if (config.iris.enabled) {\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = this.getEyeBox(rawCoords, face, LEFT_EYE_BOUNDS[0], LEFT_EYE_BOUNDS[1], true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = this.getEyeBox(rawCoords, face, RIGHT_EYE_BOUNDS[0], RIGHT_EYE_BOUNDS[1]);\n const eyePredictions = (this.irisModel.predict(tf.concat([leftEyeCrop, rightEyeCrop])));\n const eyePredictionsData = eyePredictions.dataSync();\n eyePredictions.dispose();\n const leftEyeData = eyePredictionsData.slice(0, IRIS_NUM_COORDINATES * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = this.getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(IRIS_NUM_COORDINATES * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = this.getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = this.getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left');\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right');\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged. So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = this.getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = this.getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n rawCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n }\n const transformedCoordsData = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n tf.dispose(rawCoords);\n const landmarksBox = bounding.enlargeBox(this.calculateLandmarksBoundingBox(transformedCoordsData));\n const confidence = flag.squeeze();\n tf.dispose(flag);\n if (config.mesh.enabled) {\n const transformedCoords = tf.tensor2d(transformedCoordsData);\n this.regionsOfInterest[i] = { ...landmarksBox, landmarks: transformedCoords.arraySync() };\n const prediction = {\n coords: transformedCoords,\n box: landmarksBox,\n confidence,\n image: face,\n };\n return prediction;\n }\n const prediction = {\n coords: null,\n box: landmarksBox,\n confidence,\n image: face,\n };\n return prediction;\n }));\n return results;\n }\n\n // Updates regions of interest if the intersection over union between the incoming and previous regions falls below a threshold.\n updateRegionsOfInterest(boxes) {\n for (let i = 0; i < boxes.length; i++) {\n const box = boxes[i];\n const previousBox = this.regionsOfInterest[i];\n let iou = 0;\n if (previousBox && previousBox.startPoint) {\n const [boxStartX, boxStartY] = box.startPoint;\n const [boxEndX, boxEndY] = box.endPoint;\n const [previousBoxStartX, previousBoxStartY] = previousBox.startPoint;\n const [previousBoxEndX, previousBoxEndY] = previousBox.endPoint;\n const xStartMax = Math.max(boxStartX, previousBoxStartX);\n const yStartMax = Math.max(boxStartY, previousBoxStartY);\n const xEndMin = Math.min(boxEndX, previousBoxEndX);\n const yEndMin = Math.min(boxEndY, previousBoxEndY);\n const intersection = (xEndMin - xStartMax) * (yEndMin - yStartMax);\n const boxArea = (boxEndX - boxStartX) * (boxEndY - boxStartY);\n const previousBoxArea = (previousBoxEndX - previousBoxStartX) * (previousBoxEndY - boxStartY);\n iou = intersection / (boxArea + previousBoxArea - intersection);\n }\n if (iou < UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD) {\n this.regionsOfInterest[i] = box;\n }\n }\n this.regionsOfInterest = this.regionsOfInterest.slice(0, boxes.length);\n }\n\n clearRegionOfInterest(index) {\n if (this.regionsOfInterest[index] != null) {\n this.regionsOfInterest = [\n ...this.regionsOfInterest.slice(0, index),\n ...this.regionsOfInterest.slice(index + 1),\n ];\n }\n }\n\n shouldUpdateRegionsOfInterest() {\n if (this.regionsOfInterest.length === 0) return true; // nothing detected, so run detector on the next frame\n return (this.regionsOfInterest.length !== this.maxFaces) && (this.runsWithoutFaceDetector >= this.skipFrames);\n }\n\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint, landmarks };\n }\n}\nexports.Pipeline = Pipeline;\n", "exports.UV_COORDS = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n", "export default [\n 127, 34, 139, 11, 0, 37, 232, 231, 120, 72, 37, 39, 128, 121, 47, 232, 121,\n 128, 104, 69, 67, 175, 171, 148, 157, 154, 155, 118, 50, 101, 73, 39, 40, 9,\n 151, 108, 48, 115, 131, 194, 204, 211, 74, 40, 185, 80, 42, 183, 40, 92,\n 186, 230, 229, 118, 202, 212, 214, 83, 18, 17, 76, 61, 146, 160, 29, 30, 56,\n 157, 173, 106, 204, 194, 135, 214, 192, 203, 165, 98, 21, 71, 68, 51, 45, 4,\n 144, 24, 23, 77, 146, 91, 205, 50, 187, 201, 200, 18, 91, 106, 182, 90, 91,\n 181, 85, 84, 17, 206, 203, 36, 148, 171, 140, 92, 40, 39, 193, 189, 244,\n 159, 158, 28, 247, 246, 161, 236, 3, 196, 54, 68, 104, 193, 168, 8, 117,\n 228, 31, 189, 193, 55, 98, 97, 99, 126, 47, 100, 166, 79, 218, 155, 154, 26,\n 209, 49, 131, 135, 136, 150, 47, 126, 217, 223, 52, 53, 45, 51, 134, 211,\n 170, 140, 67, 69, 108, 43, 106, 91, 230, 119, 120, 226, 130, 247, 63, 53,\n 52, 238, 20, 242, 46, 70, 156, 78, 62, 96, 46, 53, 63, 143, 34, 227, 173,\n 155, 133, 123, 117, 111, 44, 125, 19, 236, 134, 51, 216, 206, 205, 154, 153,\n 22, 39, 37, 167, 200, 201, 208, 36, 142, 100, 57, 212, 202, 20, 60, 99, 28,\n 158, 157, 35, 226, 113, 160, 159, 27, 204, 202, 210, 113, 225, 46, 43, 202,\n 204, 62, 76, 77, 137, 123, 116, 41, 38, 72, 203, 129, 142, 64, 98, 240, 49,\n 102, 64, 41, 73, 74, 212, 216, 207, 42, 74, 184, 169, 170, 211, 170, 149,\n 176, 105, 66, 69, 122, 6, 168, 123, 147, 187, 96, 77, 90, 65, 55, 107, 89,\n 90, 180, 101, 100, 120, 63, 105, 104, 93, 137, 227, 15, 86, 85, 129, 102,\n 49, 14, 87, 86, 55, 8, 9, 100, 47, 121, 145, 23, 22, 88, 89, 179, 6, 122,\n 196, 88, 95, 96, 138, 172, 136, 215, 58, 172, 115, 48, 219, 42, 80, 81, 195,\n 3, 51, 43, 146, 61, 171, 175, 199, 81, 82, 38, 53, 46, 225, 144, 163, 110,\n 246, 33, 7, 52, 65, 66, 229, 228, 117, 34, 127, 234, 107, 108, 69, 109, 108,\n 151, 48, 64, 235, 62, 78, 191, 129, 209, 126, 111, 35, 143, 163, 161, 246,\n 117, 123, 50, 222, 65, 52, 19, 125, 141, 221, 55, 65, 3, 195, 197, 25, 7,\n 33, 220, 237, 44, 70, 71, 139, 122, 193, 245, 247, 130, 33, 71, 21, 162,\n 153, 158, 159, 170, 169, 150, 188, 174, 196, 216, 186, 92, 144, 160, 161, 2,\n 97, 167, 141, 125, 241, 164, 167, 37, 72, 38, 12, 145, 159, 160, 38, 82, 13,\n 63, 68, 71, 226, 35, 111, 158, 153, 154, 101, 50, 205, 206, 92, 165, 209,\n 198, 217, 165, 167, 97, 220, 115, 218, 133, 112, 243, 239, 238, 241, 214,\n 135, 169, 190, 173, 133, 171, 208, 32, 125, 44, 237, 86, 87, 178, 85, 86,\n 179, 84, 85, 180, 83, 84, 181, 201, 83, 182, 137, 93, 132, 76, 62, 183, 61,\n 76, 184, 57, 61, 185, 212, 57, 186, 214, 207, 187, 34, 143, 156, 79, 239,\n 237, 123, 137, 177, 44, 1, 4, 201, 194, 32, 64, 102, 129, 213, 215, 138, 59,\n 166, 219, 242, 99, 97, 2, 94, 141, 75, 59, 235, 24, 110, 228, 25, 130, 226,\n 23, 24, 229, 22, 23, 230, 26, 22, 231, 112, 26, 232, 189, 190, 243, 221, 56,\n 190, 28, 56, 221, 27, 28, 222, 29, 27, 223, 30, 29, 224, 247, 30, 225, 238,\n 79, 20, 166, 59, 75, 60, 75, 240, 147, 177, 215, 20, 79, 166, 187, 147, 213,\n 112, 233, 244, 233, 128, 245, 128, 114, 188, 114, 217, 174, 131, 115, 220,\n 217, 198, 236, 198, 131, 134, 177, 132, 58, 143, 35, 124, 110, 163, 7, 228,\n 110, 25, 356, 389, 368, 11, 302, 267, 452, 350, 349, 302, 303, 269, 357,\n 343, 277, 452, 453, 357, 333, 332, 297, 175, 152, 377, 384, 398, 382, 347,\n 348, 330, 303, 304, 270, 9, 336, 337, 278, 279, 360, 418, 262, 431, 304,\n 408, 409, 310, 415, 407, 270, 409, 410, 450, 348, 347, 422, 430, 434, 313,\n 314, 17, 306, 307, 375, 387, 388, 260, 286, 414, 398, 335, 406, 418, 364,\n 367, 416, 423, 358, 327, 251, 284, 298, 281, 5, 4, 373, 374, 253, 307, 320,\n 321, 425, 427, 411, 421, 313, 18, 321, 405, 406, 320, 404, 405, 315, 16, 17,\n 426, 425, 266, 377, 400, 369, 322, 391, 269, 417, 465, 464, 386, 257, 258,\n 466, 260, 388, 456, 399, 419, 284, 332, 333, 417, 285, 8, 346, 340, 261,\n 413, 441, 285, 327, 460, 328, 355, 371, 329, 392, 439, 438, 382, 341, 256,\n 429, 420, 360, 364, 394, 379, 277, 343, 437, 443, 444, 283, 275, 440, 363,\n 431, 262, 369, 297, 338, 337, 273, 375, 321, 450, 451, 349, 446, 342, 467,\n 293, 334, 282, 458, 461, 462, 276, 353, 383, 308, 324, 325, 276, 300, 293,\n 372, 345, 447, 382, 398, 362, 352, 345, 340, 274, 1, 19, 456, 248, 281, 436,\n 427, 425, 381, 256, 252, 269, 391, 393, 200, 199, 428, 266, 330, 329, 287,\n 273, 422, 250, 462, 328, 258, 286, 384, 265, 353, 342, 387, 259, 257, 424,\n 431, 430, 342, 353, 276, 273, 335, 424, 292, 325, 307, 366, 447, 345, 271,\n 303, 302, 423, 266, 371, 294, 455, 460, 279, 278, 294, 271, 272, 304, 432,\n 434, 427, 272, 407, 408, 394, 430, 431, 395, 369, 400, 334, 333, 299, 351,\n 417, 168, 352, 280, 411, 325, 319, 320, 295, 296, 336, 319, 403, 404, 330,\n 348, 349, 293, 298, 333, 323, 454, 447, 15, 16, 315, 358, 429, 279, 14, 15,\n 316, 285, 336, 9, 329, 349, 350, 374, 380, 252, 318, 402, 403, 6, 197, 419,\n 318, 319, 325, 367, 364, 365, 435, 367, 397, 344, 438, 439, 272, 271, 311,\n 195, 5, 281, 273, 287, 291, 396, 428, 199, 311, 271, 268, 283, 444, 445,\n 373, 254, 339, 263, 466, 249, 282, 334, 296, 449, 347, 346, 264, 447, 454,\n 336, 296, 299, 338, 10, 151, 278, 439, 455, 292, 407, 415, 358, 371, 355,\n 340, 345, 372, 390, 249, 466, 346, 347, 280, 442, 443, 282, 19, 94, 370,\n 441, 442, 295, 248, 419, 197, 263, 255, 359, 440, 275, 274, 300, 383, 368,\n 351, 412, 465, 263, 467, 466, 301, 368, 389, 380, 374, 386, 395, 378, 379,\n 412, 351, 419, 436, 426, 322, 373, 390, 388, 2, 164, 393, 370, 462, 461,\n 164, 0, 267, 302, 11, 12, 374, 373, 387, 268, 12, 13, 293, 300, 301, 446,\n 261, 340, 385, 384, 381, 330, 266, 425, 426, 423, 391, 429, 355, 437, 391,\n 327, 326, 440, 457, 438, 341, 382, 362, 459, 457, 461, 434, 430, 394, 414,\n 463, 362, 396, 369, 262, 354, 461, 457, 316, 403, 402, 315, 404, 403, 314,\n 405, 404, 313, 406, 405, 421, 418, 406, 366, 401, 361, 306, 408, 407, 291,\n 409, 408, 287, 410, 409, 432, 436, 410, 434, 416, 411, 264, 368, 383, 309,\n 438, 457, 352, 376, 401, 274, 275, 4, 421, 428, 262, 294, 327, 358, 433,\n 416, 367, 289, 455, 439, 462, 370, 326, 2, 326, 370, 305, 460, 455, 254,\n 449, 448, 255, 261, 446, 253, 450, 449, 252, 451, 450, 256, 452, 451, 341,\n 453, 452, 413, 464, 463, 441, 413, 414, 258, 442, 441, 257, 443, 442, 259,\n 444, 443, 260, 445, 444, 467, 342, 445, 459, 458, 250, 289, 392, 290, 290,\n 328, 460, 376, 433, 435, 250, 290, 392, 411, 416, 433, 341, 463, 464, 453,\n 464, 465, 357, 465, 412, 343, 412, 399, 360, 363, 440, 437, 399, 456, 420,\n 456, 363, 401, 435, 288, 372, 383, 353, 339, 255, 249, 448, 261, 255, 133,\n 243, 190, 133, 155, 112, 33, 246, 247, 33, 130, 25, 398, 384, 286, 362, 398,\n 414, 362, 463, 341, 263, 359, 467, 263, 249, 255, 466, 467, 260, 75, 60,\n 166, 238, 239, 79, 162, 127, 139, 72, 11, 37, 121, 232, 120, 73, 72, 39,\n 114, 128, 47, 233, 232, 128, 103, 104, 67, 152, 175, 148, 173, 157, 155,\n 119, 118, 101, 74, 73, 40, 107, 9, 108, 49, 48, 131, 32, 194, 211, 184, 74,\n 185, 191, 80, 183, 185, 40, 186, 119, 230, 118, 210, 202, 214, 84, 83, 17,\n 77, 76, 146, 161, 160, 30, 190, 56, 173, 182, 106, 194, 138, 135, 192, 129,\n 203, 98, 54, 21, 68, 5, 51, 4, 145, 144, 23, 90, 77, 91, 207, 205, 187, 83,\n 201, 18, 181, 91, 182, 180, 90, 181, 16, 85, 17, 205, 206, 36, 176, 148,\n 140, 165, 92, 39, 245, 193, 244, 27, 159, 28, 30, 247, 161, 174, 236, 196,\n 103, 54, 104, 55, 193, 8, 111, 117, 31, 221, 189, 55, 240, 98, 99, 142, 126,\n 100, 219, 166, 218, 112, 155, 26, 198, 209, 131, 169, 135, 150, 114, 47,\n 217, 224, 223, 53, 220, 45, 134, 32, 211, 140, 109, 67, 108, 146, 43, 91,\n 231, 230, 120, 113, 226, 247, 105, 63, 52, 241, 238, 242, 124, 46, 156, 95,\n 78, 96, 70, 46, 63, 116, 143, 227, 116, 123, 111, 1, 44, 19, 3, 236, 51,\n 207, 216, 205, 26, 154, 22, 165, 39, 167, 199, 200, 208, 101, 36, 100, 43,\n 57, 202, 242, 20, 99, 56, 28, 157, 124, 35, 113, 29, 160, 27, 211, 204, 210,\n 124, 113, 46, 106, 43, 204, 96, 62, 77, 227, 137, 116, 73, 41, 72, 36, 203,\n 142, 235, 64, 240, 48, 49, 64, 42, 41, 74, 214, 212, 207, 183, 42, 184, 210,\n 169, 211, 140, 170, 176, 104, 105, 69, 193, 122, 168, 50, 123, 187, 89, 96,\n 90, 66, 65, 107, 179, 89, 180, 119, 101, 120, 68, 63, 104, 234, 93, 227, 16,\n 15, 85, 209, 129, 49, 15, 14, 86, 107, 55, 9, 120, 100, 121, 153, 145, 22,\n 178, 88, 179, 197, 6, 196, 89, 88, 96, 135, 138, 136, 138, 215, 172, 218,\n 115, 219, 41, 42, 81, 5, 195, 51, 57, 43, 61, 208, 171, 199, 41, 81, 38,\n 224, 53, 225, 24, 144, 110, 105, 52, 66, 118, 229, 117, 227, 34, 234, 66,\n 107, 69, 10, 109, 151, 219, 48, 235, 183, 62, 191, 142, 129, 126, 116, 111,\n 143, 7, 163, 246, 118, 117, 50, 223, 222, 52, 94, 19, 141, 222, 221, 65,\n 196, 3, 197, 45, 220, 44, 156, 70, 139, 188, 122, 245, 139, 71, 162, 145,\n 153, 159, 149, 170, 150, 122, 188, 196, 206, 216, 92, 163, 144, 161, 164, 2,\n 167, 242, 141, 241, 0, 164, 37, 11, 72, 12, 144, 145, 160, 12, 38, 13, 70,\n 63, 71, 31, 226, 111, 157, 158, 154, 36, 101, 205, 203, 206, 165, 126, 209,\n 217, 98, 165, 97, 237, 220, 218, 237, 239, 241, 210, 214, 169, 140, 171, 32,\n 241, 125, 237, 179, 86, 178, 180, 85, 179, 181, 84, 180, 182, 83, 181, 194,\n 201, 182, 177, 137, 132, 184, 76, 183, 185, 61, 184, 186, 57, 185, 216, 212,\n 186, 192, 214, 187, 139, 34, 156, 218, 79, 237, 147, 123, 177, 45, 44, 4,\n 208, 201, 32, 98, 64, 129, 192, 213, 138, 235, 59, 219, 141, 242, 97, 97, 2,\n 141, 240, 75, 235, 229, 24, 228, 31, 25, 226, 230, 23, 229, 231, 22, 230,\n 232, 26, 231, 233, 112, 232, 244, 189, 243, 189, 221, 190, 222, 28, 221,\n 223, 27, 222, 224, 29, 223, 225, 30, 224, 113, 247, 225, 99, 60, 240, 213,\n 147, 215, 60, 20, 166, 192, 187, 213, 243, 112, 244, 244, 233, 245, 245,\n 128, 188, 188, 114, 174, 134, 131, 220, 174, 217, 236, 236, 198, 134, 215,\n 177, 58, 156, 143, 124, 25, 110, 7, 31, 228, 25, 264, 356, 368, 0, 11, 267,\n 451, 452, 349, 267, 302, 269, 350, 357, 277, 350, 452, 357, 299, 333, 297,\n 396, 175, 377, 381, 384, 382, 280, 347, 330, 269, 303, 270, 151, 9, 337,\n 344, 278, 360, 424, 418, 431, 270, 304, 409, 272, 310, 407, 322, 270, 410,\n 449, 450, 347, 432, 422, 434, 18, 313, 17, 291, 306, 375, 259, 387, 260,\n 424, 335, 418, 434, 364, 416, 391, 423, 327, 301, 251, 298, 275, 281, 4,\n 254, 373, 253, 375, 307, 321, 280, 425, 411, 200, 421, 18, 335, 321, 406,\n 321, 320, 405, 314, 315, 17, 423, 426, 266, 396, 377, 369, 270, 322, 269,\n 413, 417, 464, 385, 386, 258, 248, 456, 419, 298, 284, 333, 168, 417, 8,\n 448, 346, 261, 417, 413, 285, 326, 327, 328, 277, 355, 329, 309, 392, 438,\n 381, 382, 256, 279, 429, 360, 365, 364, 379, 355, 277, 437, 282, 443, 283,\n 281, 275, 363, 395, 431, 369, 299, 297, 337, 335, 273, 321, 348, 450, 349,\n 359, 446, 467, 283, 293, 282, 250, 458, 462, 300, 276, 383, 292, 308, 325,\n 283, 276, 293, 264, 372, 447, 346, 352, 340, 354, 274, 19, 363, 456, 281,\n 426, 436, 425, 380, 381, 252, 267, 269, 393, 421, 200, 428, 371, 266, 329,\n 432, 287, 422, 290, 250, 328, 385, 258, 384, 446, 265, 342, 386, 387, 257,\n 422, 424, 430, 445, 342, 276, 422, 273, 424, 306, 292, 307, 352, 366, 345,\n 268, 271, 302, 358, 423, 371, 327, 294, 460, 331, 279, 294, 303, 271, 304,\n 436, 432, 427, 304, 272, 408, 395, 394, 431, 378, 395, 400, 296, 334, 299,\n 6, 351, 168, 376, 352, 411, 307, 325, 320, 285, 295, 336, 320, 319, 404,\n 329, 330, 349, 334, 293, 333, 366, 323, 447, 316, 15, 315, 331, 358, 279,\n 317, 14, 316, 8, 285, 9, 277, 329, 350, 253, 374, 252, 319, 318, 403, 351,\n 6, 419, 324, 318, 325, 397, 367, 365, 288, 435, 397, 278, 344, 439, 310,\n 272, 311, 248, 195, 281, 375, 273, 291, 175, 396, 199, 312, 311, 268, 276,\n 283, 445, 390, 373, 339, 295, 282, 296, 448, 449, 346, 356, 264, 454, 337,\n 336, 299, 337, 338, 151, 294, 278, 455, 308, 292, 415, 429, 358, 355, 265,\n 340, 372, 388, 390, 466, 352, 346, 280, 295, 442, 282, 354, 19, 370, 285,\n 441, 295, 195, 248, 197, 457, 440, 274, 301, 300, 368, 417, 351, 465, 251,\n 301, 389, 385, 380, 386, 394, 395, 379, 399, 412, 419, 410, 436, 322, 387,\n 373, 388, 326, 2, 393, 354, 370, 461, 393, 164, 267, 268, 302, 12, 386, 374,\n 387, 312, 268, 13, 298, 293, 301, 265, 446, 340, 380, 385, 381, 280, 330,\n 425, 322, 426, 391, 420, 429, 437, 393, 391, 326, 344, 440, 438, 458, 459,\n 461, 364, 434, 394, 428, 396, 262, 274, 354, 457, 317, 316, 402, 316, 315,\n 403, 315, 314, 404, 314, 313, 405, 313, 421, 406, 323, 366, 361, 292, 306,\n 407, 306, 291, 408, 291, 287, 409, 287, 432, 410, 427, 434, 411, 372, 264,\n 383, 459, 309, 457, 366, 352, 401, 1, 274, 4, 418, 421, 262, 331, 294, 358,\n 435, 433, 367, 392, 289, 439, 328, 462, 326, 94, 2, 370, 289, 305, 455, 339,\n 254, 448, 359, 255, 446, 254, 253, 449, 253, 252, 450, 252, 256, 451, 256,\n 341, 452, 414, 413, 463, 286, 441, 414, 286, 258, 441, 258, 257, 442, 257,\n 259, 443, 259, 260, 444, 260, 467, 445, 309, 459, 250, 305, 289, 290, 305,\n 290, 460, 401, 376, 435, 309, 250, 392, 376, 411, 433, 453, 341, 464, 357,\n 453, 465, 343, 357, 412, 437, 343, 399, 344, 360, 440, 420, 437, 456, 360,\n 420, 363, 361, 401, 288, 265, 372, 353, 390, 339, 249, 339, 448, 255];\n", "const tf = require('@tensorflow/tfjs');\nconst blazeface = require('./blazeface');\nconst keypoints = require('./keypoints');\nconst pipe = require('./pipeline');\nconst uv_coords = require('./uvcoords');\nconst triangulation = require('./triangulation').default;\n\nclass MediaPipeFaceMesh {\n constructor(blazeFace, blazeMeshModel, irisModel, config) {\n this.pipeline = new pipe.Pipeline(blazeFace, blazeMeshModel, irisModel, config);\n if (config) this.config = config;\n }\n\n async estimateFaces(input, config) {\n if (config) this.config = config;\n const predictions = await this.pipeline.predict(input, config);\n const results = [];\n for (const prediction of (predictions || [])) {\n // guard against disposed tensors on long running operations such as pause in middle of processing\n if (prediction.isDisposedInternal) continue;\n const confidence = prediction.confidence.arraySync();\n if (confidence >= this.config.detector.minConfidence) {\n const mesh = prediction.coords ? prediction.coords.arraySync() : null;\n const annotations = {};\n if (mesh && mesh.length > 0) {\n for (const key in keypoints.MESH_ANNOTATIONS) {\n if (this.config.iris.enabled || key.includes('Iris') === false) {\n annotations[key] = keypoints.MESH_ANNOTATIONS[key].map((index) => mesh[index]);\n }\n }\n }\n results.push({\n confidence: confidence || 0,\n box: prediction.box ? [prediction.box.startPoint[0], prediction.box.startPoint[1], prediction.box.endPoint[0] - prediction.box.startPoint[0], prediction.box.endPoint[1] - prediction.box.startPoint[1]] : 0,\n mesh,\n annotations,\n image: prediction.image ? tf.clone(prediction.image) : null,\n });\n }\n if (prediction.confidence) prediction.confidence.dispose();\n if (prediction.coords) prediction.coords.dispose();\n if (prediction.image) prediction.image.dispose();\n }\n return results;\n }\n}\n\nasync function load(config) {\n const models = await Promise.all([\n blazeface.load(config),\n tf.loadGraphModel(config.mesh.modelPath, { fromTFHub: config.mesh.modelPath.includes('tfhub.dev') }),\n tf.loadGraphModel(config.iris.modelPath, { fromTFHub: config.iris.modelPath.includes('tfhub.dev') }),\n ]);\n const faceMesh = new MediaPipeFaceMesh(models[0], models[1], models[2], config);\n return faceMesh;\n}\n\nexports.load = load;\nexports.MediaPipeFaceMesh = MediaPipeFaceMesh;\nexports.uv_coords = uv_coords;\nexports.triangulation = triangulation;\n", "const tf = require('@tensorflow/tfjs');\n\nconst models = {};\nlet last = { age: 0, gender: '' };\nlet frame = 0;\n\nasync function loadAge(config) {\n if (!models.age) models.age = await tf.loadGraphModel(config.face.age.modelPath);\n return models.age;\n}\n\nasync function loadGender(config) {\n if (!models.gender) models.gender = await tf.loadGraphModel(config.face.gender.modelPath);\n return models.gender;\n}\n\nasync function predict(image, config) {\n if (frame < config.face.age.skipFrames) {\n frame += 1;\n return last;\n }\n frame = 0;\n const resize = tf.image.resizeBilinear(image, [config.face.age.inputSize, config.face.age.inputSize], false);\n const enhance = tf.mul(resize, [255.0]);\n tf.dispose(resize);\n\n const promises = [];\n let ageT;\n let genderT;\n if (config.face.age.enabled) promises.push(ageT = models.age.predict(enhance));\n if (config.face.gender.enabled) promises.push(genderT = models.gender.predict(enhance));\n await Promise.all(promises);\n\n const obj = {};\n if (ageT) {\n const data = await ageT.data();\n obj.age = Math.trunc(10 * data[0]) / 10;\n tf.dispose(ageT);\n }\n if (genderT) {\n const data = await genderT.data();\n const confidence = Math.trunc(Math.abs(1.9 * 100 * (data[0] - 0.5))) / 100;\n if (confidence > config.face.gender.minConfidence) {\n obj.gender = data[0] <= 0.5 ? 'female' : 'male';\n obj.confidence = confidence;\n }\n tf.dispose(genderT);\n }\n\n tf.dispose(enhance);\n last = obj;\n return obj;\n}\n\nexports.predict = predict;\nexports.loadAge = loadAge;\nexports.loadGender = loadGender;\n", "const tf = require('@tensorflow/tfjs');\n\nconst annotations = ['angry', 'discust', 'fear', 'happy', 'sad', 'surpise', 'neutral'];\nconst models = {};\nlet last = [];\nlet frame = 0;\nconst multiplier = 1.5;\n\nasync function load(config) {\n if (!models.emotion) models.emotion = await tf.loadGraphModel(config.face.emotion.modelPath);\n return models.emotion;\n}\n\nasync function predict(image, config) {\n if (frame < config.face.emotion.skipFrames) {\n frame += 1;\n return last;\n }\n frame = 0;\n const resize = tf.image.resizeBilinear(image, [config.face.emotion.inputSize, config.face.emotion.inputSize], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n resize.dispose();\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, [0.2989]);\n const greenNorm = tf.mul(green, [0.5870]);\n const blueNorm = tf.mul(blue, [0.1140]);\n red.dispose();\n green.dispose();\n blue.dispose();\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n redNorm.dispose();\n greenNorm.dispose();\n blueNorm.dispose();\n const obj = [];\n if (config.face.emotion.enabled) {\n const emotionT = await models.emotion.predict(grayscale);\n const data = await emotionT.data();\n for (let i = 0; i < data.length; i++) {\n if (multiplier * data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * multiplier * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n tf.dispose(emotionT);\n }\n tf.dispose(grayscale);\n last = obj;\n return obj;\n}\n\nexports.predict = predict;\nexports.load = load;\n", "const tf = require('@tensorflow/tfjs');\n\nclass BaseModel {\n constructor(model, outputStride) {\n this.model = model;\n this.outputStride = outputStride;\n const inputShape = this.model.inputs[0].shape;\n tf.util.assert((inputShape[1] === -1) && (inputShape[2] === -1), () => `Input shape [${inputShape[1]}, ${inputShape[2]}] must both be equal to or -1`);\n }\n\n /**\n * Predicts intermediate Tensor representations.\n *\n * @param input The input RGB image of the base model.\n * A Tensor of shape: [`inputResolution`, `inputResolution`, 3].\n *\n * @return A dictionary of base model's intermediate predictions.\n * The returned dictionary should contains the following elements:\n * heatmapScores: A Tensor3D that represents the heatmapScores.\n * offsets: A Tensor3D that represents the offsets.\n * displacementFwd: A Tensor3D that represents the forward displacement.\n * displacementBwd: A Tensor3D that represents the backward displacement.\n */\n predict(input) {\n return tf.tidy(() => {\n const asFloat = this.preprocessInput(input.toFloat());\n const asBatch = asFloat.expandDims(0);\n const results = this.model.predict(asBatch);\n const results3d = results.map((y) => y.squeeze([0]));\n const namedResults = this.nameOutputResults(results3d);\n return {\n heatmapScores: namedResults.heatmap.sigmoid(),\n offsets: namedResults.offsets,\n displacementFwd: namedResults.displacementFwd,\n displacementBwd: namedResults.displacementBwd,\n };\n });\n }\n\n /**\n * Releases the CPU and GPU memory allocated by the model.\n */\n dispose() {\n this.model.dispose();\n }\n}\nexports.BaseModel = BaseModel;\n", "const tf = require('@tensorflow/tfjs');\nconst modelBase = require('./modelBase');\n\nclass MobileNet extends modelBase.BaseModel {\n // eslint-disable-next-line class-methods-use-this\n preprocessInput(input) {\n // Normalize the pixels [0, 255] to be between [-1, 1].\n return tf.tidy(() => tf.div(input, 127.5).sub(1.0));\n }\n\n // eslint-disable-next-line class-methods-use-this\n nameOutputResults(results) {\n const [offsets, heatmap, displacementFwd, displacementBwd] = results;\n return { offsets, heatmap, displacementFwd, displacementBwd };\n }\n}\nexports.MobileNet = MobileNet;\n", "// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nfunction half(k) {\n return Math.floor(k / 2);\n}\nclass MaxHeap {\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() {\n return this.numberOfElements === -1;\n }\n\n size() {\n return this.numberOfElements + 1;\n }\n\n all() {\n return this.priorityQueue.slice(0, this.numberOfElements + 1);\n }\n\n max() {\n return this.priorityQueue[0];\n }\n\n swim(k) {\n while (k > 0 && this.less(half(k), k)) {\n this.exchange(k, half(k));\n k = half(k);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\nexports.MaxHeap = MaxHeap;\n", "const heapSort = require('./heapSort');\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, localMaximumRadius, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) {\n break;\n }\n }\n return localMaximum;\n}\n/**\n * Builds a priority queue with part candidate positions for a specific image in\n * the batch. For this we find all local maxima in the score maps with score\n * values above a threshold. We create a single priority queue across all parts.\n */\nfunction buildPartWithScoreQueue(scoreThreshold, localMaximumRadius, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new heapSort.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < scoreThreshold) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, localMaximumRadius, scores)) {\n queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n }\n return queue;\n}\nexports.buildPartWithScoreQueue = buildPartWithScoreQueue;\n", "exports.partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\nexports.NUM_KEYPOINTS = exports.partNames.length;\nexports.partIds = exports.partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\n/*\n * Define the skeleton. This defines the parent->child relationships of our\n * tree. Arbitrarily this defines the nose as the root of the tree, however\n * since we will infer the displacement for both parent->child and\n * child->parent, we can define the tree root as any node.\n */\nexports.poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\nexports.connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([exports.partIds[jointNameA], exports.partIds[jointNameB]]));\nexports.partChannels = [\n 'left_face',\n 'right_face',\n 'right_upper_leg_front',\n 'right_lower_leg_back',\n 'right_upper_leg_back',\n 'left_lower_leg_front',\n 'left_upper_leg_front',\n 'left_upper_leg_back',\n 'left_lower_leg_back',\n 'right_feet',\n 'right_lower_leg_front',\n 'left_feet',\n 'torso_front',\n 'torso_back',\n 'right_upper_arm_front',\n 'right_upper_arm_back',\n 'right_lower_arm_back',\n 'left_lower_arm_front',\n 'left_upper_arm_front',\n 'left_upper_arm_back',\n 'left_lower_arm_back',\n 'right_hand',\n 'right_lower_arm_front',\n 'left_hand',\n];\n", "const kpt = require('./keypoints');\n\nfunction getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + kpt.NUM_KEYPOINTS),\n };\n}\nexports.getOffsetPoint = getOffsetPoint;\n\nfunction getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\nexports.getImageCoords = getImageCoords;\n\nfunction fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\nexports.fillArray = fillArray;\n\nfunction clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\nexports.clamp = clamp;\n\nfunction squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\nexports.squaredDistance = squaredDistance;\n\nfunction addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\nexports.addVectors = addVectors;\n\nfunction clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\nexports.clampVector = clampVector;\n", "const keypoints = require('./keypoints');\nconst vectors = require('./vectors');\n\nconst parentChildrenTuples = keypoints.poseChain.map(([parentJoinName, childJoinName]) => ([keypoints.partIds[parentJoinName], keypoints.partIds[childJoinName]]));\nconst parentToChildEdges = parentChildrenTuples.map(([, childJointId]) => childJointId);\nconst childToParentEdges = parentChildrenTuples.map(([parentJointId]) => parentJointId);\nfunction getDisplacement(edgeId, point, displacements) {\n const numEdges = displacements.shape[2] / 2;\n return {\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, numEdges + edgeId),\n };\n}\nfunction getStridedIndexNearPoint(point, outputStride, height, width) {\n return {\n y: vectors.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: vectors.clamp(Math.round(point.x / outputStride), 0, width - 1),\n };\n}\n/**\n * We get a new keypoint along the `edgeId` for the pose instance, assuming\n * that the position of the `idSource` part is already known. For this, we\n * follow the displacement vector from the source to target part (stored in\n * the `i`-t channel of the displacement tensor). The displaced keypoint\n * vector is refined using the offset vector by `offsetRefineStep` times.\n */\nfunction traverseToTargetKeypoint(edgeId, sourceKeypoint, targetKeypointId, scoresBuffer, offsets, outputStride, displacements, offsetRefineStep = 2) {\n const [height, width] = scoresBuffer.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, outputStride, height, width);\n const displacement = getDisplacement(edgeId, sourceKeypointIndices, displacements);\n const displacedPoint = vectors.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, outputStride, height, width);\n const offsetPoint = vectors.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetKeypointId, offsets);\n targetKeypoint = vectors.addVectors({\n x: targetKeypointIndices.x * outputStride,\n y: targetKeypointIndices.y * outputStride,\n }, { x: offsetPoint.x, y: offsetPoint.y });\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, outputStride, height, width);\n const score = scoresBuffer.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetKeypointId);\n return { position: targetKeypoint, part: keypoints.partNames[targetKeypointId], score };\n}\n/**\n * Follows the displacement fields to decode the full pose of the object\n * instance given the position of a part that acts as root.\n *\n * @return An array of decoded keypoints and their scores for a single pose\n */\nfunction decodePose(root, scores, offsets, outputStride, displacementsFwd, displacementsBwd) {\n const numParts = scores.shape[2];\n const numEdges = parentToChildEdges.length;\n const instanceKeypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const { part: rootPart, score: rootScore } = root;\n const rootPoint = vectors.getImageCoords(rootPart, outputStride, offsets);\n instanceKeypoints[rootPart.id] = {\n score: rootScore,\n part: keypoints.partNames[rootPart.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward\n // displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceKeypointId = parentToChildEdges[edge];\n const targetKeypointId = childToParentEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward\n // displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceKeypointId = childToParentEdges[edge];\n const targetKeypointId = parentToChildEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsFwd);\n }\n }\n return instanceKeypoints;\n}\nexports.decodePose = decodePose;\n", "const buildParts = require('./buildParts');\nconst decodePose = require('./decodePose');\nconst vectors = require('./vectors');\n\nfunction withinNmsRadiusOfCorrespondingPoint(poses, squaredNmsRadius, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId].position;\n return vectors.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n/* Score the newly proposed object instance without taking into account\n * the scores of the parts that overlap with any previously detected\n * instance.\n */\nfunction getInstanceScore(existingPoses, squaredNmsRadius, instanceKeypoints) {\n const notOverlappedKeypointScores = instanceKeypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinNmsRadiusOfCorrespondingPoint(existingPoses, squaredNmsRadius, position, keypointId)) {\n result += score;\n }\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / instanceKeypoints.length;\n}\n// A point (y, x) is considered as root part candidate if its score is a\n// maximum in a window |y - y'| <= kLocalMaximumRadius, |x - x'| <=\n// kLocalMaximumRadius.\nconst kLocalMaximumRadius = 1;\n/**\n * Detects multiple poses and finds their parts from part scores and\n * displacement vectors. It returns up to `maxDetections` object instance\n * detections in decreasing root score order. It works as follows: We first\n * create a priority queue with local part score maxima above\n * `scoreThreshold`, considering all parts at the same time. Then we\n * iteratively pull the top element of the queue (in decreasing score order)\n * and treat it as a root candidate for a new object instance. To avoid\n * duplicate detections, we reject the root candidate if it is within a disk\n * of `nmsRadius` pixels from the corresponding part of a previously detected\n * instance, which is a form of part-based non-maximum suppression (NMS). If\n * the root candidate passes the NMS check, we start a new object instance\n * detection, treating the corresponding part as root and finding the\n * positions of the remaining parts by following the displacement vectors\n * along the tree-structured part graph. We assign to the newly detected\n * instance a score equal to the sum of scores of its parts which have not\n * been claimed by a previous instance (i.e., those at least `nmsRadius`\n * pixels away from the corresponding part of all previously detected\n * instances), divided by the total number of parts `numParts`.\n *\n * @param heatmapScores 3-D tensor with shape `[height, width, numParts]`.\n * The value of heatmapScores[y, x, k]` is the score of placing the `k`-th\n * object part at position `(y, x)`.\n *\n * @param offsets 3-D tensor with shape `[height, width, numParts * 2]`.\n * The value of [offsets[y, x, k], offsets[y, x, k + numParts]]` is the\n * short range offset vector of the `k`-th object part at heatmap\n * position `(y, x)`.\n *\n * @param displacementsFwd 3-D tensor of shape\n * `[height, width, 2 * num_edges]`, where `num_edges = num_parts - 1` is the\n * number of edges (parent-child pairs) in the tree. It contains the forward\n * displacements between consecutive part from the root towards the leaves.\n *\n * @param displacementsBwd 3-D tensor of shape\n * `[height, width, 2 * num_edges]`, where `num_edges = num_parts - 1` is the\n * number of edges (parent-child pairs) in the tree. It contains the backward\n * displacements between consecutive part from the root towards the leaves.\n *\n * @param outputStride The output stride that was used when feed-forwarding\n * through the PoseNet model. Must be 32, 16, or 8.\n *\n * @param maxPoseDetections Maximum number of returned instance detections per\n * image.\n *\n * @param scoreThreshold Only return instance detections that have root part\n * score greater or equal to this value. Defaults to 0.5.\n *\n * @param nmsRadius Non-maximum suppression part distance. It needs to be\n * strictly positive. Two parts suppress each other if they are less than\n * `nmsRadius` pixels away. Defaults to 20.\n *\n * @return An array of poses and their scores, each containing keypoints and\n * the corresponding keypoint scores.\n */\nfunction decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer, outputStride, maxPoseDetections, scoreThreshold = 0.5, nmsRadius = 20) {\n const poses = [];\n const queue = buildParts.buildPartWithScoreQueue(scoreThreshold, kLocalMaximumRadius, scoresBuffer);\n const squaredNmsRadius = nmsRadius * nmsRadius;\n // Generate at most maxDetections object instances per image in\n // decreasing root part score order.\n while (poses.length < maxPoseDetections && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it\n // is within a disk of `nmsRadius` pixels from the corresponding part of\n // a previously detected instance.\n const rootImageCoords = vectors.getImageCoords(root.part, outputStride, offsetsBuffer);\n if (withinNmsRadiusOfCorrespondingPoint(poses, squaredNmsRadius, rootImageCoords, root.part.id)) continue;\n // Start a new detection instance at the position of the root.\n const keypoints = decodePose.decodePose(root, scoresBuffer, offsetsBuffer, outputStride, displacementsFwdBuffer, displacementsBwdBuffer);\n const score = getInstanceScore(poses, squaredNmsRadius, keypoints);\n poses.push({ keypoints, score });\n }\n return poses;\n}\nexports.decodeMultiplePoses = decodeMultiplePoses;\n", "const kpt = require('./keypoints');\n\nfunction eitherPointDoesntMeetConfidence(a, b, minConfidence) {\n return (a < minConfidence || b < minConfidence);\n}\n\nfunction getAdjacentKeyPoints(keypoints, minConfidence) {\n return kpt.connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\nexports.getAdjacentKeyPoints = getAdjacentKeyPoints;\n\nconst { NEGATIVE_INFINITY, POSITIVE_INFINITY } = Number;\nfunction getBoundingBox(keypoints) {\n return keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: NEGATIVE_INFINITY,\n maxY: NEGATIVE_INFINITY,\n minX: POSITIVE_INFINITY,\n minY: POSITIVE_INFINITY,\n });\n}\nexports.getBoundingBox = getBoundingBox;\nfunction getBoundingBoxPoints(keypoints) {\n const { minX, minY, maxX, maxY } = getBoundingBox(keypoints);\n return [{ x: minX, y: minY }, { x: maxX, y: minY }, { x: maxX, y: maxY }, { x: minX, y: maxY }];\n}\nexports.getBoundingBoxPoints = getBoundingBoxPoints;\nasync function toTensorBuffers3D(tensors) {\n return Promise.all(tensors.map((tensor) => tensor.buffer()));\n}\nexports.toTensorBuffers3D = toTensorBuffers3D;\n\nfunction scalePose(pose, scaleY, scaleX) {\n return {\n score: pose.score,\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: { x: position.x * scaleX, y: position.y * scaleY },\n })),\n };\n}\nexports.scalePose = scalePose;\n\nfunction resizeTo(image, [targetH, targetW]) {\n const input = image.squeeze(0);\n const resized = input.resizeBilinear([targetH, targetW]);\n input.dispose();\n return resized;\n}\nexports.resizeTo = resizeTo;\n\nfunction scaleAndFlipPoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]) {\n const scaledPoses = poses.map((pose) => scalePose(pose, height / inputResolutionHeight, width / inputResolutionWidth));\n return scaledPoses;\n}\nexports.scaleAndFlipPoses = scaleAndFlipPoses;\n", "const tf = require('@tensorflow/tfjs');\nconst modelMobileNet = require('./modelMobileNet');\nconst decodeMultiple = require('./decodeMultiple');\nconst util = require('./util');\n\nclass PoseNet {\n constructor(net) {\n this.baseModel = net;\n }\n\n /**\n * Infer through PoseNet, and estimates multiple poses using the outputs.\n * This does standard ImageNet pre-processing before inferring through the\n * model. The image should pixels should have values [0-255]. It detects\n * multiple poses and finds their parts from part scores and displacement\n * vectors using a fast greedy decoding algorithm. It returns up to\n * `config.maxDetections` object instance detections in decreasing root\n * score order.\n *\n * @param input\n * ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement) The input\n * image to feed through the network.\n *\n * @param config MultiPoseEstimationConfig object that contains parameters\n * for the PoseNet inference using multiple pose estimation.\n *\n * @return An array of poses and their scores, each containing keypoints and\n * the corresponding keypoint scores. The positions of the keypoints are\n * in the same scale as the original image\n */\n async estimatePoses(input, config) {\n const outputStride = config.outputStride;\n // const inputResolution = config.inputResolution;\n const height = input.shape[1];\n const width = input.shape[2];\n const resized = util.resizeTo(input, [config.inputResolution, config.inputResolution]);\n const { heatmapScores, offsets, displacementFwd, displacementBwd } = this.baseModel.predict(resized);\n const allTensorBuffers = await util.toTensorBuffers3D([heatmapScores, offsets, displacementFwd, displacementBwd]);\n const scoresBuffer = allTensorBuffers[0];\n const offsetsBuffer = allTensorBuffers[1];\n const displacementsFwdBuffer = allTensorBuffers[2];\n const displacementsBwdBuffer = allTensorBuffers[3];\n const poses = await decodeMultiple.decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer, outputStride, config.maxDetections, config.scoreThreshold, config.nmsRadius);\n const resultPoses = util.scaleAndFlipPoses(poses, [height, width], [config.inputResolution, config.inputResolution]);\n heatmapScores.dispose();\n offsets.dispose();\n displacementFwd.dispose();\n displacementBwd.dispose();\n resized.dispose();\n return resultPoses;\n }\n\n dispose() {\n this.baseModel.dispose();\n }\n}\nexports.PoseNet = PoseNet;\nasync function loadMobileNet(config) {\n const graphModel = await tf.loadGraphModel(config.modelPath);\n const mobilenet = new modelMobileNet.MobileNet(graphModel, config.outputStride);\n return new PoseNet(mobilenet);\n}\n/**\n * Loads the PoseNet model instance from a checkpoint, with the MobileNet architecture. The model to be loaded is configurable using the\n * config dictionary ModelConfig. Please find more details in the documentation of the ModelConfig.\n *\n * @param config ModelConfig dictionary that contains parameters for\n * the PoseNet loading process. Please find more details of each parameters\n * in the documentation of the ModelConfig interface. The predefined\n * `MOBILENET_V1_CONFIG` and `RESNET_CONFIG` can also be used as references\n * for defining your customized config.\n */\nasync function load(config) {\n return loadMobileNet(config);\n}\nexports.load = load;\n", "const modelMobileNet = require('./modelMobileNet');\nconst modelPoseNet = require('./modelPoseNet');\nconst decodeMultiple = require('./decodeMultiple');\nconst keypoints = require('./keypoints');\nconst util = require('./util');\n\nexports.load = modelPoseNet.load;\nexports.PoseNet = modelPoseNet.PoseNet;\n\nexports.MobileNet = modelMobileNet.MobileNet;\nexports.decodeMultiplePoses = decodeMultiple.decodeMultiplePoses;\nexports.partChannels = keypoints.partChannels;\nexports.partIds = keypoints.partIds;\nexports.partNames = keypoints.partNames;\nexports.poseChain = keypoints.poseChain;\nexports.getAdjacentKeyPoints = util.getAdjacentKeyPoints;\nexports.getBoundingBox = util.getBoundingBox;\nexports.getBoundingBoxPoints = util.getBoundingBoxPoints;\nexports.scaleAndFlipPoses = util.scaleAndFlipPoses;\nexports.scalePose = util.scalePose;\n", "const tf = require('@tensorflow/tfjs');\n\nfunction getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\nexports.getBoxSize = getBoxSize;\n\nfunction getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\nexports.getBoxCenter = getBoxCenter;\n\nfunction cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\nexports.cutBoxFromImageAndResize = cutBoxFromImageAndResize;\n\nfunction scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks };\n}\nexports.scaleBoxCoordinates = scaleBoxCoordinates;\n\nfunction enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.enlargeBox = enlargeBox;\n\nfunction squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.squarifyBox = squarifyBox;\n\nfunction shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0], box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.shiftBox = shiftBox;\n", "const tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\n\nclass HandDetector {\n constructor(model, anchors, config) {\n this.model = model;\n this.width = config.inputSize;\n this.height = config.inputSize;\n this.anchors = anchors.map((anchor) => [anchor.x_center, anchor.y_center]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n this.inputSizeTensor = tf.tensor1d([config.inputSize, config.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([config.inputSize * 2, config.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(rawPalmLandmarks.reshape([-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoundingBoxes(input) {\n const batchedPrediction = this.model.predict(input);\n const prediction = batchedPrediction.squeeze();\n // Regression score for each anchor point.\n const scores = tf.tidy(() => tf.sigmoid(tf.slice(prediction, [0, 0], [-1, 1])).squeeze());\n // Bounding box for each anchor point.\n const rawBoxes = tf.slice(prediction, [0, 1], [-1, 4]);\n const boxes = this.normalizeBoxes(rawBoxes);\n const boxesWithHandsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.maxHands, this.iouThreshold, this.scoreThreshold);\n const boxesWithHands = await boxesWithHandsTensor.array();\n const toDispose = [batchedPrediction, boxesWithHandsTensor, prediction, boxes, rawBoxes, scores];\n const detectedHands = tf.tidy(() => {\n const detectedBoxes = [];\n for (const i in boxesWithHands) {\n const boxIndex = boxesWithHands[i];\n const matchingBox = tf.slice(boxes, [boxIndex, 0], [1, -1]);\n const rawPalmLandmarks = tf.slice(prediction, [boxIndex, 5], [1, 14]);\n const palmLandmarks = tf.tidy(() => this.normalizeLandmarks(rawPalmLandmarks, boxIndex).reshape([-1, 2]));\n detectedBoxes.push({ boxes: matchingBox, palmLandmarks });\n }\n return detectedBoxes;\n });\n toDispose.forEach((tensor) => tensor.dispose());\n return detectedHands;\n }\n\n /**\n * Returns a Box identifying the bounding box of a hand within the image.\n * Returns null if there is no hand in the image.\n *\n * @param input The image to classify.\n */\n async estimateHandBounds(input, config) {\n // const inputHeight = input.shape[2];\n // const inputWidth = input.shape[1];\n this.iouThreshold = config.iouThreshold;\n this.scoreThreshold = config.scoreThreshold;\n this.maxHands = config.maxHands;\n const resized = input.resizeBilinear([this.width, this.height]);\n const divided = resized.div(255);\n const normalized = divided.sub(0.5);\n const image = normalized.mul(2.0);\n resized.dispose();\n divided.dispose();\n normalized.dispose();\n const predictions = await this.getBoundingBoxes(image);\n image.dispose();\n if (!predictions || (predictions.length === 0)) return null;\n const hands = [];\n for (const i in predictions) {\n const prediction = predictions[i];\n const boundingBoxes = await prediction.boxes.array();\n const startPoint = boundingBoxes[0].slice(0, 2);\n const endPoint = boundingBoxes[0].slice(2, 4);\n const palmLandmarks = await prediction.palmLandmarks.array();\n prediction.boxes.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(bounding.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks }, [input.shape[2] / this.width, input.shape[1] / this.height]));\n }\n return hands;\n }\n}\nexports.HandDetector = HandDetector;\n", "exports.MESH_ANNOTATIONS = {\n thumb: [1, 2, 3, 4],\n indexFinger: [5, 6, 7, 8],\n middleFinger: [9, 10, 11, 12],\n ringFinger: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palmBase: [0],\n};\n", "function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\nexports.normalizeRadians = normalizeRadians;\n\nfunction computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\nexports.computeRotation = computeRotation;\n\nconst buildTranslationMatrix = (x, y) => ([[1, 0, x], [0, 1, y], [0, 0, 1]]);\nfunction dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\nexports.dot = dot;\n\nfunction getColumnFrom2DArr(arr, columnIndex) {\n const column = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\nexports.getColumnFrom2DArr = getColumnFrom2DArr;\n\nfunction multiplyTransformMatrices(mat1, mat2) {\n const product = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\nfunction buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\nexports.buildRotationMatrix = buildRotationMatrix;\n\nfunction invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\nexports.invertTransformMatrix = invertTransformMatrix;\n\nfunction rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\nexports.rotatePoint = rotatePoint;\n", "const tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\nconst util = require('./util');\n\nconst UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD = 0.8;\nconst PALM_BOX_SHIFT_VECTOR = [0, -0.4];\nconst HAND_BOX_SHIFT_VECTOR = [0, -0.1];\nconst HAND_BOX_ENLARGE_FACTOR = 1.65;\nconst PALM_LANDMARK_IDS = [0, 5, 9, 13, 17, 1, 2];\nconst PALM_LANDMARKS_INDEX_OF_PALM_BASE = 0;\nconst PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE = 2;\n\n// The Pipeline coordinates between the bounding box and skeleton models.\nclass HandPipeline {\n constructor(boundingBoxDetector, meshDetector, config) {\n this.regionsOfInterest = [];\n this.runsWithoutHandDetector = 0;\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.meshWidth = config.inputSize;\n this.meshHeight = config.inputSize;\n this.enlargeFactor = config.enlargeFactor;\n }\n\n // Get the bounding box surrounding the hand, given palm landmarks.\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => {\n const homogeneousCoordinate = [...coord, 1];\n return util.rotatePoint(homogeneousCoordinate, rotationMatrix);\n });\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n // boxAroundPalm only surrounds the palm - therefore we shift it\n // upwards so it will capture fingers once enlarged + squarified.\n return bounding.enlargeBox(bounding.squarifyBox(bounding.shiftBox(boxAroundPalm, PALM_BOX_SHIFT_VECTOR)), this.enlargeFactor);\n }\n\n // Get the bounding box surrounding the hand, given all hand landmarks.\n getBoxForHandLandmarks(landmarks) {\n // The MediaPipe hand mesh model is trained on hands with empty space\n // around them, so we still need to shift / enlarge boxAroundHand even\n // though it surrounds the entire hand.\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = bounding.enlargeBox(bounding.squarifyBox(bounding.shiftBox(boundingBox, HAND_BOX_SHIFT_VECTOR)), HAND_BOX_ENLARGE_FACTOR);\n const palmLandmarks = [];\n for (let i = 0; i < PALM_LANDMARK_IDS.length; i++) {\n palmLandmarks.push(landmarks[PALM_LANDMARK_IDS[i]].slice(0, 2));\n }\n boxAroundHand.palmLandmarks = palmLandmarks;\n return boxAroundHand;\n }\n\n // Scale, rotate, and translate raw keypoints from the model so they map to\n // the input coordinates.\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize(box);\n const scaleFactor = [boxSize[0] / this.meshWidth, boxSize[1] / this.meshHeight];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.meshWidth / 2),\n scaleFactor[1] * (coord[1] - this.meshHeight / 2), coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...bounding.getBoxCenter(box), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n coord[0] + originalBoxCenter[0], coord[1] + originalBoxCenter[1],\n coord[2],\n ]);\n }\n\n async estimateHands(image, config) {\n this.skipFrames = config.skipFrames;\n this.detectionConfidence = config.minConfidence;\n this.maxHands = config.maxHands;\n this.runsWithoutHandDetector++;\n const useFreshBox = this.shouldUpdateRegionsOfInterest();\n if (useFreshBox === true) {\n const boundingBoxPredictions = await this.boundingBoxDetector.estimateHandBounds(image, config);\n this.regionsOfInterest = [];\n for (const i in boundingBoxPredictions) {\n this.updateRegionsOfInterest(boundingBoxPredictions[i], true /* force update */, i);\n }\n this.runsWithoutHandDetector = 0;\n }\n // Rotate input so the hand is vertically oriented.\n const hands = [];\n if (!this.regionsOfInterest) return hands;\n for (const i in this.regionsOfInterest) {\n const currentBox = this.regionsOfInterest[i][0];\n if (!currentBox) return hands;\n const angle = util.computeRotation(currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_PALM_BASE], currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE]);\n const palmCenter = bounding.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized);\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const box = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = bounding.cutBoxFromImageAndResize(box, rotatedImage, [this.meshWidth, this.meshHeight]);\n const handImage = croppedInput.div(255);\n croppedInput.dispose();\n rotatedImage.dispose();\n const prediction = this.meshDetector.predict(handImage);\n const [flag, keypoints] = prediction;\n handImage.dispose();\n const flagValue = flag.dataSync()[0];\n flag.dispose();\n if (flagValue < config.minConfidence) {\n keypoints.dispose();\n this.regionsOfInterest[i] = [];\n return hands;\n }\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = await keypointsReshaped.array();\n keypoints.dispose();\n keypointsReshaped.dispose();\n const coords = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.updateRegionsOfInterest(nextBoundingBox, false /* force replace */, i);\n const result = {\n landmarks: coords,\n confidence: flagValue,\n box: {\n topLeft: nextBoundingBox.startPoint,\n bottomRight: nextBoundingBox.endPoint,\n },\n };\n hands.push(result);\n }\n return hands;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n\n // Updates regions of interest if the intersection over union between\n // the incoming and previous regions falls below a threshold.\n updateRegionsOfInterest(box, forceUpdate, index) {\n if (forceUpdate) {\n this.regionsOfInterest[index] = [box];\n } else {\n const previousBox = this.regionsOfInterest[index][0];\n let iou = 0;\n if (previousBox != null && previousBox.startPoint != null) {\n const [boxStartX, boxStartY] = box.startPoint;\n const [boxEndX, boxEndY] = box.endPoint;\n const [previousBoxStartX, previousBoxStartY] = previousBox.startPoint;\n const [previousBoxEndX, previousBoxEndY] = previousBox.endPoint;\n const xStartMax = Math.max(boxStartX, previousBoxStartX);\n const yStartMax = Math.max(boxStartY, previousBoxStartY);\n const xEndMin = Math.min(boxEndX, previousBoxEndX);\n const yEndMin = Math.min(boxEndY, previousBoxEndY);\n const intersection = (xEndMin - xStartMax) * (yEndMin - yStartMax);\n const boxArea = (boxEndX - boxStartX) * (boxEndY - boxStartY);\n const previousBoxArea = (previousBoxEndX - previousBoxStartX) * (previousBoxEndY - boxStartY);\n iou = intersection / (boxArea + previousBoxArea - intersection);\n }\n this.regionsOfInterest[index][0] = iou > UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD ? previousBox : box;\n }\n }\n\n shouldUpdateRegionsOfInterest() {\n return !this.regionsOfInterest || (this.regionsOfInterest.length === 0) || (this.runsWithoutHandDetector >= this.skipFrames);\n }\n}\nexports.HandPipeline = HandPipeline;\n", "const tf = require('@tensorflow/tfjs');\nconst hand = require('./handdetector');\nconst keypoints = require('./keypoints');\nconst pipe = require('./pipeline');\n\nclass HandPose {\n constructor(pipeline) {\n this.pipeline = pipeline;\n }\n\n async estimateHands(input, config) {\n this.skipFrames = config.skipFrames;\n this.detectionConfidence = config.minConfidence;\n this.maxHands = config.maxHands;\n const predictions = await this.pipeline.estimateHands(input, config);\n const hands = [];\n if (!predictions) return hands;\n for (const prediction of predictions) {\n if (!prediction) return [];\n const annotations = {};\n for (const key of Object.keys(keypoints.MESH_ANNOTATIONS)) {\n annotations[key] = keypoints.MESH_ANNOTATIONS[key].map((index) => prediction.landmarks[index]);\n }\n hands.push({\n confidence: prediction.confidence || 0,\n box: prediction.box ? [prediction.box.topLeft[0], prediction.box.topLeft[1], prediction.box.bottomRight[0] - prediction.box.topLeft[0], prediction.box.bottomRight[1] - prediction.box.topLeft[1]] : 0,\n landmarks: prediction.landmarks,\n annotations,\n });\n }\n return hands;\n }\n}\nexports.HandPose = HandPose;\n\nasync function loadAnchors(url) {\n if (tf.env().features.IS_NODE) {\n // eslint-disable-next-line global-require\n const fs = require('fs');\n const data = await fs.readFileSync(url.replace('file://', ''));\n return JSON.parse(data);\n }\n return tf.util.fetch(url).then((d) => d.json());\n}\n\nasync function load(config) {\n const [anchors, handDetectorModel, handPoseModel] = await Promise.all([\n loadAnchors(config.detector.anchors),\n tf.loadGraphModel(config.detector.modelPath, { fromTFHub: config.detector.modelPath.includes('tfhub.dev') }),\n tf.loadGraphModel(config.skeleton.modelPath, { fromTFHub: config.skeleton.modelPath.includes('tfhub.dev') }),\n ]);\n const detector = new hand.HandDetector(handDetectorModel, anchors, config);\n const pipeline = new pipe.HandPipeline(detector, handPoseModel, config);\n const handpose = new HandPose(pipeline);\n return handpose;\n}\nexports.load = load;\n", "/* eslint-disable no-shadow */\n/* eslint-disable prefer-rest-params */\n/* eslint-disable no-sequences */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-use-before-define */\n/*\nWebGLImageFilter - MIT Licensed\n2013, Dominic Szablewski - phoboslab.org\n*/\n\nconst WebGLProgram = function (gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (gl, source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n throw new Error('Filter: GL compile failed', gl.getShaderInfoLog(shader));\n }\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n\n const _vsh = _compile(gl, vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(gl, fragmentSource, gl.FRAGMENT_SHADER);\n\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) {\n throw new Error('Filter: GL link failed', gl.getProgramInfoLog(this.id));\n }\n\n gl.useProgram(this.id);\n\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) {\n this.attribute[a] = gl.getAttribLocation(this.id, a);\n }\n\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) {\n this.uniform[u] = gl.getUniformLocation(this.id, u);\n }\n};\n\nconst WebGLImageFilter = function (params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _canvas = params.canvas || document.createElement('canvas');\n\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n\n const gl = _canvas.getContext('webgl') || _canvas.getContext('experimental-webgl');\n if (!gl) throw new Error('Filter: getContext() failed');\n\n this.addFilter = function (name) {\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n\n // No filters? Just draw\n if (_filterChain.length === 0) {\n const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n\n return _canvas;\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n\n _canvas.width = _width = width;\n _canvas.height = _height = height;\n\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n _vertexBuffer = gl.createBuffer(),\n gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n\n // Note sure if this is a good idea; at least it makes texture loading\n // in Ejecta instant.\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n\n gl.viewport(0, 0, _width, _height);\n\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index]\n || _createFramebufferTexture(_width, _height);\n\n return _tempFramebuffers[index];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n return { fbo, texture };\n };\n\n const _draw = function (flags) {\n let source = null;\n let target = null;\n let flipY = false;\n\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex).texture;\n }\n _drawCount++;\n\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex).fbo;\n }\n\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n\n // Compile shaders\n _currentProgram = new WebGLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n let DRAW = { INTERMEDIATE: 1 };\n\n let SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n\n let _filter = {};\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n\n const program = _compileShader(_filter.blur.SHADER);\n\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n\n const program = _compileShader(_filter.pixelate.SHADER);\n\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n};\n\nexports.Canvas = WebGLImageFilter;\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\nexport default {\n backend: 'webgl', // select tfjs backend to use\n console: true, // enable debugging output to console\n scoped: false, // enable scoped runs\n // some models *may* have memory leaks, this wrapps everything in a local scope at a cost of performance\n // typically not needed\n videoOptimized: true, // perform additional optimizations when input is video, must be disabled for images\n filter: {\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models: detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: '../models/blazeface/back/model.json', // can be 'front' or 'back'.\n // 'front' is optimized for large faces such as front-facing camera and 'back' is optimized for distanct faces.\n inputSize: 256, // fixed value: 128 for front and 256 for 'back'\n maxFaces: 10, // maximum number of faces detected in the input, should be set to the minimum number for performance\n skipFrames: 10, // how many frames to go without re-running the face bounding box detector, only used for video inputs\n // if model is running st 25 FPS, we can re-use existing bounding box for updated face mesh analysis\n // as face probably hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.3, // threshold for deciding whether boxes overlap too much in non-maximum suppression\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n },\n mesh: {\n enabled: true,\n modelPath: '../models/facemesh/model.json',\n inputSize: 192, // fixed value\n },\n iris: {\n enabled: true,\n modelPath: '../models/iris/model.json',\n enlargeFactor: 2.3, // empiric tuning\n inputSize: 64, // fixed value\n },\n age: {\n enabled: true,\n modelPath: '../models/ssrnet-age/imdb/model.json', // can be 'imdb' or 'wiki'\n // which determines training set for model\n inputSize: 64, // fixed value\n skipFrames: 10, // how many frames to go without re-running the detector, only used for video inputs\n },\n gender: {\n enabled: true,\n minConfidence: 0.8, // threshold for discarding a prediction\n modelPath: '../models/ssrnet-gender/imdb/model.json',\n },\n emotion: {\n enabled: true,\n inputSize: 64, // fixed value\n minConfidence: 0.5, // threshold for discarding a prediction\n skipFrames: 10, // how many frames to go without re-running the detector\n modelPath: '../models/emotion/model.json',\n },\n },\n body: {\n enabled: true,\n modelPath: '../models/posenet/model.json',\n inputResolution: 257, // fixed value\n outputStride: 16, // fixed value\n maxDetections: 10, // maximum number of people detected in the input, should be set to the minimum number for performance\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n nmsRadius: 20, // radius for deciding points are too close in non-maximum suppression\n },\n hand: {\n enabled: true,\n inputSize: 256, // fixed value\n skipFrames: 10, // how many frames to go without re-running the hand bounding box detector, only used for video inputs\n // if model is running st 25 FPS, we can re-use existing bounding box for updated hand skeleton analysis\n // as the hand probably hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.3, // threshold for deciding whether boxes overlap too much in non-maximum suppression\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n enlargeFactor: 1.65, // empiric tuning as skeleton prediction prefers hand box with some whitespace\n maxHands: 10, // maximum number of hands detected in the input, should be set to the minimum number for performance\n detector: {\n anchors: '../models/handdetect/anchors.json',\n modelPath: '../models/handdetect/model.json',\n },\n skeleton: {\n modelPath: '../models/handskeleton/model.json',\n },\n },\n};\n", "const tf = require('@tensorflow/tfjs');\nconst facemesh = require('./facemesh/facemesh.js');\nconst ssrnet = require('./ssrnet/ssrnet.js');\nconst emotion = require('./emotion/emotion.js');\nconst posenet = require('./posenet/posenet.js');\nconst handpose = require('./handpose/handpose.js');\nconst fxImage = require('./imagefx.js');\nconst defaults = require('../config.js').default;\nconst app = require('../package.json');\n\nlet first = true;\n\n// static config override for non-video detection\nconst override = {\n face: { detector: { skipFrames: 0 }, age: { skipFrames: 0 }, emotion: { skipFrames: 0 } },\n hand: { skipFrames: 0 },\n};\n\n// helper function: gets elapsed time on both browser and nodejs\nconst now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt(Number(process.hrtime.bigint()) / 1000 / 1000);\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nfunction mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) {\n prev[key] = pVal.concat(...oVal);\n } else if (isObject(pVal) && isObject(oVal)) {\n prev[key] = mergeDeep(pVal, oVal);\n } else {\n prev[key] = oVal;\n }\n });\n return prev;\n }, {});\n}\n\nfunction sanity(input) {\n if (!input) return 'input is not defined';\n if (tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) {\n return 'input must be a tensor';\n }\n try {\n tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n}\n\nclass Human {\n constructor() {\n this.tf = tf;\n this.version = app.version;\n this.defaults = defaults;\n this.config = defaults;\n this.fx = (tf.ENV.flags.IS_BROWSER && (typeof document !== 'undefined')) ? new fxImage.Canvas() : null;\n this.state = 'idle';\n this.numTensors = 0;\n this.analyzeMemoryLeaks = false;\n // object that contains all initialized models\n this.models = {\n facemesh: null,\n posenet: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n };\n // export raw access to underlying models\n this.facemesh = facemesh;\n this.ssrnet = ssrnet;\n this.emotion = emotion;\n this.posenet = posenet;\n this.handpose = handpose;\n }\n\n // helper function: wrapper around console output\n log(...msg) {\n // eslint-disable-next-line no-console\n if (msg && this.config.console) console.log(...msg);\n }\n\n // helper function: measure tensor leak\n analyze(...msg) {\n if (!this.analyzeMemoryLeaks) return;\n const current = tf.engine().state.numTensors;\n const previous = this.numTensors;\n this.numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) this.log(...msg, leaked);\n }\n\n async load(userConfig) {\n if (userConfig) this.config = mergeDeep(defaults, userConfig);\n if (this.config.face.enabled && !this.models.facemesh) {\n this.log('Load model: Face');\n this.models.facemesh = await facemesh.load(this.config.face);\n }\n if (this.config.body.enabled && !this.models.posenet) {\n this.log('Load model: Body');\n this.models.posenet = await posenet.load(this.config.body);\n }\n if (this.config.hand.enabled && !this.models.handpose) {\n this.log('Load model: Hand');\n this.models.handpose = await handpose.load(this.config.hand);\n }\n if (this.config.face.enabled && this.config.face.age.enabled && !this.models.age) {\n this.log('Load model: Age');\n this.models.age = await ssrnet.loadAge(this.config);\n }\n if (this.config.face.enabled && this.config.face.gender.enabled && !this.models.gender) {\n this.log('Load model: Gender');\n this.models.gender = await ssrnet.loadGender(this.config);\n }\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) {\n this.log('Load model: Emotion');\n this.models.emotion = await emotion.load(this.config);\n }\n }\n\n tfImage(input) {\n // let imageData;\n let filtered;\n if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {\n const originalWidth = input.naturalWidth || input.videoWidth || input.width || (input.shape && (input.shape[1] > 0));\n const originalHeight = input.naturalHeight || input.videoHeight || input.height || (input.shape && (input.shape[2] > 0));\n\n let targetWidth = originalWidth;\n if (this.config.filter.width > 0) targetWidth = this.config.filter.width;\n else if (this.config.filter.height > 0) targetWidth = originalWidth * (this.config.filter.height / originalHeight);\n let targetHeight = originalHeight;\n if (this.config.filter.height > 0) targetHeight = this.config.filter.height;\n else if (this.config.filter.width > 0) targetHeight = originalHeight * (this.config.filter.width / originalWidth);\n\n const offscreenCanvas = new OffscreenCanvas(targetWidth, targetHeight);\n const ctx = offscreenCanvas.getContext('2d');\n if (input instanceof ImageData) ctx.putImageData(input, 0, 0);\n else ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, offscreenCanvas.width, offscreenCanvas.height);\n this.fx.reset();\n this.fx.addFilter('brightness', this.config.filter.brightness); // must have at least one filter enabled\n if (this.config.filter.contrast !== 0) this.fx.addFilter('contrast', this.config.filter.contrast);\n if (this.config.filter.sharpness !== 0) this.fx.addFilter('sharpen', this.config.filter.sharpness);\n if (this.config.filter.blur !== 0) this.fx.addFilter('blur', this.config.filter.blur);\n if (this.config.filter.saturation !== 0) this.fx.addFilter('saturation', this.config.filter.saturation);\n if (this.config.filter.hue !== 0) this.fx.addFilter('hue', this.config.filter.hue);\n if (this.config.filter.negative) this.fx.addFilter('negative');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.vintage) this.fx.addFilter('brownie');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.kodachrome) this.fx.addFilter('kodachrome');\n if (this.config.filter.technicolor) this.fx.addFilter('technicolor');\n if (this.config.filter.polaroid) this.fx.addFilter('polaroid');\n if (this.config.filter.pixelate !== 0) this.fx.addFilter('pixelate', this.config.filter.pixelate);\n filtered = this.fx.apply(offscreenCanvas);\n }\n let tensor;\n if (input instanceof tf.Tensor) {\n tensor = tf.clone(input);\n } else {\n const pixels = tf.browser.fromPixels(filtered || input);\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n return { tensor, canvas: this.config.filter.return ? filtered : null };\n }\n\n async detect(input, userConfig = {}) {\n this.state = 'config';\n const perf = {};\n let timeStamp;\n\n timeStamp = now();\n this.config = mergeDeep(defaults, userConfig);\n if (!this.config.videoOptimized) this.config = mergeDeep(this.config, override);\n perf.config = Math.trunc(now() - timeStamp);\n\n // sanity checks\n timeStamp = now();\n this.state = 'check';\n const error = sanity(input);\n if (error) {\n this.log(error, input);\n return { error };\n }\n perf.sanity = Math.trunc(now() - timeStamp);\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve) => {\n const timeStart = now();\n\n // configure backend\n timeStamp = now();\n if (tf.getBackend() !== this.config.backend) {\n this.state = 'backend';\n this.log('Human library setting backend:', this.config.backend);\n await tf.setBackend(this.config.backend);\n await tf.ready();\n }\n perf.backend = Math.trunc(now() - timeStamp);\n\n // check number of loaded models\n if (first) {\n this.log('Human library starting');\n this.log('Configuration:', this.config);\n this.log('Flags:', tf.ENV.flags);\n first = false;\n }\n\n // load models if enabled\n timeStamp = now();\n this.state = 'load';\n await this.load();\n perf.load = Math.trunc(now() - timeStamp);\n\n if (this.config.scoped) tf.engine().startScope();\n\n this.analyze('Start Detect:');\n\n timeStamp = now();\n const image = this.tfImage(input);\n perf.image = Math.trunc(now() - timeStamp);\n const imageTensor = image.tensor;\n\n // run posenet\n this.state = 'run:body';\n timeStamp = now();\n this.analyze('Start PoseNet');\n const poseRes = this.config.body.enabled ? await this.models.posenet.estimatePoses(imageTensor, this.config.body) : [];\n this.analyze('End PoseNet:');\n perf.body = Math.trunc(now() - timeStamp);\n\n // run handpose\n this.state = 'run:hand';\n timeStamp = now();\n this.analyze('Start HandPose:');\n const handRes = this.config.hand.enabled ? await this.models.handpose.estimateHands(imageTensor, this.config.hand) : [];\n this.analyze('End HandPose:');\n perf.hand = Math.trunc(now() - timeStamp);\n\n // run facemesh, includes blazeface and iris\n const faceRes = [];\n if (this.config.face.enabled) {\n this.state = 'run:face';\n timeStamp = now();\n this.analyze('Start FaceMesh:');\n const faces = await this.models.facemesh.estimateFaces(imageTensor, this.config.face);\n perf.face = Math.trunc(now() - timeStamp);\n for (const face of faces) {\n // is something went wrong, skip the face\n if (!face.image || face.image.isDisposedInternal) {\n this.log('face object is disposed:', face.image);\n continue;\n }\n // run ssr-net age & gender, inherits face from blazeface\n this.state = 'run:agegender';\n timeStamp = now();\n const ssrData = (this.config.face.age.enabled || this.config.face.gender.enabled) ? await ssrnet.predict(face.image, this.config) : {};\n perf.agegender = Math.trunc(now() - timeStamp);\n // run emotion, inherits face from blazeface\n this.state = 'run:emotion';\n timeStamp = now();\n const emotionData = this.config.face.emotion.enabled ? await emotion.predict(face.image, this.config) : {};\n perf.emotion = Math.trunc(now() - timeStamp);\n\n // dont need face anymore\n face.image.dispose();\n // calculate iris distance\n // iris: array[ bottom, left, top, right, center ]\n const iris = (face.annotations.leftEyeIris && face.annotations.rightEyeIris)\n ? Math.max(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0], face.annotations.rightEyeIris[3][0] - face.annotations.rightEyeIris[1][0])\n : 0;\n faceRes.push({\n confidence: face.confidence,\n box: face.box,\n mesh: face.mesh,\n annotations: face.annotations,\n age: ssrData.age,\n gender: ssrData.gender,\n agConfidence: ssrData.confidence,\n emotion: emotionData,\n iris: (iris !== 0) ? Math.trunc(100 * 11.7 /* human iris size in mm */ / iris) / 100 : 0,\n });\n this.analyze('End FaceMesh:');\n }\n }\n\n imageTensor.dispose();\n this.state = 'idle';\n\n if (this.config.scoped) tf.engine().endScope();\n this.analyze('End Scope:');\n\n perf.total = Math.trunc(now() - timeStart);\n resolve({ face: faceRes, body: poseRes, hand: handRes, performance: perf, canvas: image.canvas });\n });\n }\n}\n\nexport { Human as default };\n", "const tf = require('@tensorflow/tfjs');\nconst facemesh = require('./facemesh/facemesh.js');\nconst ssrnet = require('./ssrnet/ssrnet.js');\nconst emotion = require('./emotion/emotion.js');\nconst posenet = require('./posenet/posenet.js');\nconst handpose = require('./handpose/handpose.js');\nconst fxImage = require('./imagefx.js');\nconst defaults = require('../config.js').default;\nconst app = require('../package.json');\n\nlet first = true;\n\n// static config override for non-video detection\nconst override = {\n face: { detector: { skipFrames: 0 }, age: { skipFrames: 0 }, emotion: { skipFrames: 0 } },\n hand: { skipFrames: 0 },\n};\n\n// helper function: gets elapsed time on both browser and nodejs\nconst now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt(Number(process.hrtime.bigint()) / 1000 / 1000);\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nfunction mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) {\n prev[key] = pVal.concat(...oVal);\n } else if (isObject(pVal) && isObject(oVal)) {\n prev[key] = mergeDeep(pVal, oVal);\n } else {\n prev[key] = oVal;\n }\n });\n return prev;\n }, {});\n}\n\nfunction sanity(input) {\n if (!input) return 'input is not defined';\n if (tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) {\n return 'input must be a tensor';\n }\n try {\n tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n}\n\nclass Human {\n constructor() {\n this.tf = tf;\n this.version = app.version;\n this.defaults = defaults;\n this.config = defaults;\n this.fx = (tf.ENV.flags.IS_BROWSER && (typeof document !== 'undefined')) ? new fxImage.Canvas() : null;\n this.state = 'idle';\n this.numTensors = 0;\n this.analyzeMemoryLeaks = false;\n // object that contains all initialized models\n this.models = {\n facemesh: null,\n posenet: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n };\n // export raw access to underlying models\n this.facemesh = facemesh;\n this.ssrnet = ssrnet;\n this.emotion = emotion;\n this.posenet = posenet;\n this.handpose = handpose;\n }\n\n // helper function: wrapper around console output\n log(...msg) {\n // eslint-disable-next-line no-console\n if (msg && this.config.console) console.log(...msg);\n }\n\n // helper function: measure tensor leak\n analyze(...msg) {\n if (!this.analyzeMemoryLeaks) return;\n const current = tf.engine().state.numTensors;\n const previous = this.numTensors;\n this.numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) this.log(...msg, leaked);\n }\n\n async load(userConfig) {\n if (userConfig) this.config = mergeDeep(defaults, userConfig);\n if (this.config.face.enabled && !this.models.facemesh) {\n this.log('Load model: Face');\n this.models.facemesh = await facemesh.load(this.config.face);\n }\n if (this.config.body.enabled && !this.models.posenet) {\n this.log('Load model: Body');\n this.models.posenet = await posenet.load(this.config.body);\n }\n if (this.config.hand.enabled && !this.models.handpose) {\n this.log('Load model: Hand');\n this.models.handpose = await handpose.load(this.config.hand);\n }\n if (this.config.face.enabled && this.config.face.age.enabled && !this.models.age) {\n this.log('Load model: Age');\n this.models.age = await ssrnet.loadAge(this.config);\n }\n if (this.config.face.enabled && this.config.face.gender.enabled && !this.models.gender) {\n this.log('Load model: Gender');\n this.models.gender = await ssrnet.loadGender(this.config);\n }\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) {\n this.log('Load model: Emotion');\n this.models.emotion = await emotion.load(this.config);\n }\n }\n\n tfImage(input) {\n // let imageData;\n let filtered;\n if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {\n const originalWidth = input.naturalWidth || input.videoWidth || input.width || (input.shape && (input.shape[1] > 0));\n const originalHeight = input.naturalHeight || input.videoHeight || input.height || (input.shape && (input.shape[2] > 0));\n\n let targetWidth = originalWidth;\n if (this.config.filter.width > 0) targetWidth = this.config.filter.width;\n else if (this.config.filter.height > 0) targetWidth = originalWidth * (this.config.filter.height / originalHeight);\n let targetHeight = originalHeight;\n if (this.config.filter.height > 0) targetHeight = this.config.filter.height;\n else if (this.config.filter.width > 0) targetHeight = originalHeight * (this.config.filter.width / originalWidth);\n\n const offscreenCanvas = new OffscreenCanvas(targetWidth, targetHeight);\n const ctx = offscreenCanvas.getContext('2d');\n if (input instanceof ImageData) ctx.putImageData(input, 0, 0);\n else ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, offscreenCanvas.width, offscreenCanvas.height);\n this.fx.reset();\n this.fx.addFilter('brightness', this.config.filter.brightness); // must have at least one filter enabled\n if (this.config.filter.contrast !== 0) this.fx.addFilter('contrast', this.config.filter.contrast);\n if (this.config.filter.sharpness !== 0) this.fx.addFilter('sharpen', this.config.filter.sharpness);\n if (this.config.filter.blur !== 0) this.fx.addFilter('blur', this.config.filter.blur);\n if (this.config.filter.saturation !== 0) this.fx.addFilter('saturation', this.config.filter.saturation);\n if (this.config.filter.hue !== 0) this.fx.addFilter('hue', this.config.filter.hue);\n if (this.config.filter.negative) this.fx.addFilter('negative');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.vintage) this.fx.addFilter('brownie');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.kodachrome) this.fx.addFilter('kodachrome');\n if (this.config.filter.technicolor) this.fx.addFilter('technicolor');\n if (this.config.filter.polaroid) this.fx.addFilter('polaroid');\n if (this.config.filter.pixelate !== 0) this.fx.addFilter('pixelate', this.config.filter.pixelate);\n filtered = this.fx.apply(offscreenCanvas);\n }\n let tensor;\n if (input instanceof tf.Tensor) {\n tensor = tf.clone(input);\n } else {\n const pixels = tf.browser.fromPixels(filtered || input);\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n return { tensor, canvas: this.config.filter.return ? filtered : null };\n }\n\n async detect(input, userConfig = {}) {\n this.state = 'config';\n const perf = {};\n let timeStamp;\n\n timeStamp = now();\n this.config = mergeDeep(defaults, userConfig);\n if (!this.config.videoOptimized) this.config = mergeDeep(this.config, override);\n perf.config = Math.trunc(now() - timeStamp);\n\n // sanity checks\n timeStamp = now();\n this.state = 'check';\n const error = sanity(input);\n if (error) {\n this.log(error, input);\n return { error };\n }\n perf.sanity = Math.trunc(now() - timeStamp);\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve) => {\n const timeStart = now();\n\n // configure backend\n timeStamp = now();\n if (tf.getBackend() !== this.config.backend) {\n this.state = 'backend';\n this.log('Human library setting backend:', this.config.backend);\n await tf.setBackend(this.config.backend);\n await tf.ready();\n }\n perf.backend = Math.trunc(now() - timeStamp);\n\n // check number of loaded models\n if (first) {\n this.log('Human library starting');\n this.log('Configuration:', this.config);\n this.log('Flags:', tf.ENV.flags);\n first = false;\n }\n\n // load models if enabled\n timeStamp = now();\n this.state = 'load';\n await this.load();\n perf.load = Math.trunc(now() - timeStamp);\n\n if (this.config.scoped) tf.engine().startScope();\n\n this.analyze('Start Detect:');\n\n timeStamp = now();\n const image = this.tfImage(input);\n perf.image = Math.trunc(now() - timeStamp);\n const imageTensor = image.tensor;\n\n // run posenet\n this.state = 'run:body';\n timeStamp = now();\n this.analyze('Start PoseNet');\n const poseRes = this.config.body.enabled ? await this.models.posenet.estimatePoses(imageTensor, this.config.body) : [];\n this.analyze('End PoseNet:');\n perf.body = Math.trunc(now() - timeStamp);\n\n // run handpose\n this.state = 'run:hand';\n timeStamp = now();\n this.analyze('Start HandPose:');\n const handRes = this.config.hand.enabled ? await this.models.handpose.estimateHands(imageTensor, this.config.hand) : [];\n this.analyze('End HandPose:');\n perf.hand = Math.trunc(now() - timeStamp);\n\n // run facemesh, includes blazeface and iris\n const faceRes = [];\n if (this.config.face.enabled) {\n this.state = 'run:face';\n timeStamp = now();\n this.analyze('Start FaceMesh:');\n const faces = await this.models.facemesh.estimateFaces(imageTensor, this.config.face);\n perf.face = Math.trunc(now() - timeStamp);\n for (const face of faces) {\n // is something went wrong, skip the face\n if (!face.image || face.image.isDisposedInternal) {\n this.log('face object is disposed:', face.image);\n continue;\n }\n // run ssr-net age & gender, inherits face from blazeface\n this.state = 'run:agegender';\n timeStamp = now();\n const ssrData = (this.config.face.age.enabled || this.config.face.gender.enabled) ? await ssrnet.predict(face.image, this.config) : {};\n perf.agegender = Math.trunc(now() - timeStamp);\n // run emotion, inherits face from blazeface\n this.state = 'run:emotion';\n timeStamp = now();\n const emotionData = this.config.face.emotion.enabled ? await emotion.predict(face.image, this.config) : {};\n perf.emotion = Math.trunc(now() - timeStamp);\n\n // dont need face anymore\n face.image.dispose();\n // calculate iris distance\n // iris: array[ bottom, left, top, right, center ]\n const iris = (face.annotations.leftEyeIris && face.annotations.rightEyeIris)\n ? Math.max(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0], face.annotations.rightEyeIris[3][0] - face.annotations.rightEyeIris[1][0])\n : 0;\n faceRes.push({\n confidence: face.confidence,\n box: face.box,\n mesh: face.mesh,\n annotations: face.annotations,\n age: ssrData.age,\n gender: ssrData.gender,\n agConfidence: ssrData.confidence,\n emotion: emotionData,\n iris: (iris !== 0) ? Math.trunc(100 * 11.7 /* human iris size in mm */ / iris) / 100 : 0,\n });\n this.analyze('End FaceMesh:');\n }\n }\n\n imageTensor.dispose();\n this.state = 'idle';\n\n if (this.config.scoped) tf.engine().endScope();\n this.analyze('End Scope:');\n\n perf.total = Math.trunc(now() - timeStart);\n resolve({ face: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IAAI,KAAK,YAAY,YAAY,GAAG,KAAK,KAAK,YAAY,YAAY,GAAG,IAAI,KAAK,YAAY,aAAa,GAAG,KAAK,KAAK,YAAY,aAAa,GAAG,MACzJ;AACJ,kBAAQ,KAAK;AAAA,YACX,YAAY,KAAK;AAAA,YACjB,KAAK,KAAK;AAAA,YACV,MAAM,KAAK;AAAA,YACX,aAAa,KAAK;AAAA,YAClB,KAAK,QAAQ;AAAA,YACb,QAAQ,QAAQ;AAAA,YAChB,cAAc,QAAQ;AAAA,YACtB,SAAS;AAAA,YACT,MAAO,SAAS,IAAK,KAAK,MAAM,MAAM,OAAmC,QAAQ,MAAM;AAAA;AAEzF,eAAK,QAAQ;AAAA;AAAA;AAIjB,kBAAY;AACZ,WAAK,QAAQ;AAEb,UAAI,KAAK,OAAO;AAAQ,WAAG,SAAS;AACpC,WAAK,QAAQ;AAEb,WAAK,QAAQ,KAAK,MAAM,QAAQ;AAChC,cAAQ,CAAE,MAAM,SAAS,MAAM,SAAS,MAAM,SAAS,aAAa,MAAM,QAAQ,MAAM;AAAA;AAAA;AAAA;",
"names": []
}
diff --git a/dist/human.esm-nobundle.js b/dist/human.esm-nobundle.js
index bfa7562f..a50657cc 100644
--- a/dist/human.esm-nobundle.js
+++ b/dist/human.esm-nobundle.js
@@ -1,4 +1,5 @@
-var __defineProperty = Object.defineProperty;
+var __defProp = Object.defineProperty;
+var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
var __commonJS = (callback, module) => () => {
if (!module) {
module = {exports: {}};
@@ -6,13 +7,10 @@ var __commonJS = (callback, module) => () => {
}
return module.exports;
};
-var __markAsModule = (target) => {
- return __defineProperty(target, "__esModule", {value: true});
-};
var __export = (target, all) => {
__markAsModule(target);
for (var name in all)
- __defineProperty(target, name, {get: all[name], enumerable: true});
+ __defProp(target, name, {get: all[name], enumerable: true});
};
// src/facemesh/blazeface.js
@@ -5688,6 +5686,8 @@ var require_config = __commonJS((exports) => {
videoOptimized: true,
filter: {
enabled: true,
+ width: 0,
+ height: 0,
return: true,
brightness: 0,
contrast: 0,
@@ -5777,7 +5777,7 @@ var require_config = __commonJS((exports) => {
var require_package = __commonJS((exports, module) => {
module.exports = {
name: "@vladmandic/human",
- version: "0.4.2",
+ version: "0.4.3",
description: "human: 3D Face Detection, Iris Tracking and Age & Gender Prediction",
sideEffects: false,
main: "dist/human.cjs",
@@ -5799,19 +5799,19 @@ var require_package = __commonJS((exports, module) => {
dependencies: {},
peerDependencies: {},
devDependencies: {
+ "@tensorflow/tfjs": "^2.7.0",
+ "@tensorflow/tfjs-node": "^2.7.0",
"@vladmandic/pilogger": "^0.2.6",
- dayjs: "^1.9.3",
- "simple-git": "^2.21.0",
- "@tensorflow/tfjs": "^2.6.0",
- "@tensorflow/tfjs-node": "^2.6.0",
- esbuild: "^0.7.15",
- eslint: "^7.10.0",
+ dayjs: "^1.9.4",
+ esbuild: "^0.7.21",
+ eslint: "^7.12.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
- rimraf: "^3.0.2"
+ rimraf: "^3.0.2",
+ "simple-git": "^2.21.0"
},
scripts: {
start: "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
@@ -5959,14 +5959,24 @@ class Human {
tfImage(input) {
let filtered;
if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {
- const width = input.naturalWidth || input.videoWidth || input.width || input.shape && input.shape[1] > 0;
- const height = input.naturalHeight || input.videoHeight || input.height || input.shape && input.shape[2] > 0;
- const offscreenCanvas = new OffscreenCanvas(width, height);
+ const originalWidth = input.naturalWidth || input.videoWidth || input.width || input.shape && input.shape[1] > 0;
+ const originalHeight = input.naturalHeight || input.videoHeight || input.height || input.shape && input.shape[2] > 0;
+ let targetWidth = originalWidth;
+ if (this.config.filter.width > 0)
+ targetWidth = this.config.filter.width;
+ else if (this.config.filter.height > 0)
+ targetWidth = originalWidth * (this.config.filter.height / originalHeight);
+ let targetHeight = originalHeight;
+ if (this.config.filter.height > 0)
+ targetHeight = this.config.filter.height;
+ else if (this.config.filter.width > 0)
+ targetHeight = originalHeight * (this.config.filter.width / originalWidth);
+ const offscreenCanvas = new OffscreenCanvas(targetWidth, targetHeight);
const ctx = offscreenCanvas.getContext("2d");
if (input instanceof ImageData)
ctx.putImageData(input, 0, 0);
else
- ctx.drawImage(input, 0, 0, width, height, 0, 0, offscreenCanvas.width, offscreenCanvas.height);
+ ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, offscreenCanvas.width, offscreenCanvas.height);
this.fx.reset();
this.fx.addFilter("brightness", this.config.filter.brightness);
if (this.config.filter.contrast !== 0)
diff --git a/dist/human.esm-nobundle.js.map b/dist/human.esm-nobundle.js.map
index 5afcaa47..fe339329 100644
--- a/dist/human.esm-nobundle.js.map
+++ b/dist/human.esm-nobundle.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
"sources": ["../src/facemesh/blazeface.js", "../src/facemesh/keypoints.js", "../src/facemesh/box.js", "../src/facemesh/util.js", "../src/facemesh/pipeline.js", "../src/facemesh/uvcoords.js", "../src/facemesh/triangulation.js", "../src/facemesh/facemesh.js", "../src/ssrnet/ssrnet.js", "../src/emotion/emotion.js", "../src/posenet/modelBase.js", "../src/posenet/modelMobileNet.js", "../src/posenet/heapSort.js", "../src/posenet/buildParts.js", "../src/posenet/keypoints.js", "../src/posenet/vectors.js", "../src/posenet/decodePose.js", "../src/posenet/decodeMultiple.js", "../src/posenet/util.js", "../src/posenet/modelPoseNet.js", "../src/posenet/posenet.js", "../src/handpose/box.js", "../src/handpose/handdetector.js", "../src/handpose/keypoints.js", "../src/handpose/util.js", "../src/handpose/pipeline.js", "../src/handpose/handpose.js", "../src/imagefx.js", "../config.js", "../src/human.js"],
- "sourcesContent": ["const tf = require('@tensorflow/tfjs');\n\nconst NUM_LANDMARKS = 6;\n\nfunction generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) {\n anchors.push([anchorX, anchorY]);\n }\n }\n }\n }\n return anchors;\n}\n\nconst disposeBox = (box) => {\n box.startEndTensor.dispose();\n box.startPoint.dispose();\n box.endPoint.dispose();\n};\n\nconst createBox = (startEndTensor) => ({\n startEndTensor,\n startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]),\n endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),\n});\n\nconst scaleBox = (box, factors) => {\n const starts = tf.mul(box.startPoint, factors);\n const ends = tf.mul(box.endPoint, factors);\n const newCoordinates = tf.concat2d([starts, ends], 1);\n return createBox(newCoordinates);\n};\n\nfunction decodeBounds(boxOutputs, anchors, inputSize) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nfunction scaleBoxFromPrediction(face, scaleFactor) {\n return tf.tidy(() => {\n const box = face['box'] ? face['box'] : face;\n return scaleBox(box, scaleFactor).startEndTensor.squeeze();\n });\n}\n\nclass BlazeFaceModel {\n constructor(model, config) {\n this.blazeFaceModel = model;\n this.width = config.detector.inputSize;\n this.height = config.detector.inputSize;\n this.maxFaces = config.detector.maxFaces;\n this.anchorsData = generateAnchors(config.detector.inputSize);\n this.anchors = tf.tensor2d(this.anchorsData);\n this.inputSize = tf.tensor1d([this.width, this.height]);\n this.iouThreshold = config.detector.iouThreshold;\n this.scaleFaces = 0.8;\n this.scoreThreshold = config.detector.scoreThreshold;\n }\n\n // toto blazeface leaks two tensors per run\n async getBoundingBoxes(inputImage) {\n // sanity check on input\n if ((!inputImage) || (inputImage.isDisposedInternal) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return null;\n const [detectedOutputs, boxes, scores] = tf.tidy(() => {\n const resizedImage = inputImage.resizeBilinear([this.width, this.height]);\n const normalizedImage = tf.mul(tf.sub(resizedImage.div(255), 0.5), 2);\n const batchedPrediction = this.blazeFaceModel.predict(normalizedImage);\n let prediction;\n // are we using tfhub or pinto converted model?\n if (Array.isArray(batchedPrediction)) {\n const sorted = batchedPrediction.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n prediction = concat.squeeze(0);\n } else {\n prediction = batchedPrediction.squeeze(); // when using tfhub model\n }\n const decodedBounds = decodeBounds(prediction, this.anchors, this.inputSize);\n const logits = tf.slice(prediction, [0, 0], [-1, 1]);\n const scoresOut = tf.sigmoid(logits).squeeze();\n return [prediction, decodedBounds, scoresOut];\n });\n const boxIndicesTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.maxFaces, this.iouThreshold, this.scoreThreshold);\n const boxIndices = await boxIndicesTensor.array();\n boxIndicesTensor.dispose();\n const boundingBoxesMap = boxIndices.map((boxIndex) => tf.slice(boxes, [boxIndex, 0], [1, -1]));\n const boundingBoxes = await Promise.all(boundingBoxesMap.map(async (boundingBox) => {\n const vals = await boundingBox.array();\n boundingBox.dispose();\n return vals;\n }));\n const annotatedBoxes = [];\n for (let i = 0; i < boundingBoxes.length; i++) {\n const boundingBox = boundingBoxes[i];\n const box = createBox(boundingBox);\n const boxIndex = boxIndices[i];\n const anchor = this.anchorsData[boxIndex];\n const sliced = tf.slice(detectedOutputs, [boxIndex, NUM_LANDMARKS - 1], [1, -1]);\n const squeezed = sliced.squeeze();\n const landmarks = squeezed.reshape([NUM_LANDMARKS, -1]);\n /*\n const landmarks = tf\n .slice(detectedOutputs, [boxIndex, NUM_LANDMARKS - 1], [1, -1])\n .squeeze()\n .reshape([NUM_LANDMARKS, -1]);\n */\n const probability = tf.slice(scores, [boxIndex], [1]);\n const annotatedBox = { box, landmarks, probability, anchor };\n annotatedBoxes.push(annotatedBox);\n sliced.dispose();\n squeezed.dispose();\n // landmarks.dispose();\n }\n detectedOutputs.dispose();\n boxes.dispose();\n scores.dispose();\n detectedOutputs.dispose();\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / this.width, inputImage.shape[1] / this.height],\n };\n }\n\n async estimateFaces(input) {\n const { boxes, scaleFactor } = await this.getBoundingBoxes(input);\n return Promise.all(boxes.map(async (face) => {\n const scaledBox = scaleBoxFromPrediction(face, scaleFactor);\n const [landmarkData, boxData, probabilityData] = await Promise.all([face.landmarks, scaledBox, face.probability].map(async (d) => d.array()));\n const anchor = face.anchor;\n const [scaleFactorX, scaleFactorY] = scaleFactor;\n const scaledLandmarks = landmarkData\n .map((landmark) => ([\n (landmark[0] + anchor[0]) * scaleFactorX,\n (landmark[1] + anchor[1]) * scaleFactorY,\n ]));\n const normalizedFace = {\n topLeft: boxData.slice(0, 2),\n bottomRight: boxData.slice(2),\n landmarks: scaledLandmarks,\n probability: probabilityData,\n };\n disposeBox(face.box);\n face.landmarks.dispose();\n face.probability.dispose();\n scaledBox.dispose();\n return normalizedFace;\n }));\n }\n}\n\nasync function load(config) {\n const blazeface = await tf.loadGraphModel(config.detector.modelPath, { fromTFHub: config.detector.modelPath.includes('tfhub.dev') });\n const model = new BlazeFaceModel(blazeface, config);\n return model;\n}\n\nexports.load = load;\nexports.BlazeFaceModel = BlazeFaceModel;\nexports.disposeBox = disposeBox;\n", "exports.MESH_ANNOTATIONS = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\nexports.MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n", "const tf = require('@tensorflow/tfjs');\n\nfunction scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n}\nexports.scaleBoxCoordinates = scaleBoxCoordinates;\nfunction getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\nexports.getBoxSize = getBoxSize;\nfunction getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\nexports.getBoxCenter = getBoxCenter;\nfunction cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\nexports.cutBoxFromImageAndResize = cutBoxFromImageAndResize;\nfunction enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\nexports.enlargeBox = enlargeBox;\nfunction squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\nexports.squarifyBox = squarifyBox;\n", "exports.IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n/**\n * Normalizes the provided angle to the range -pi to pi.\n * @param angle The angle in radians to be normalized.\n */\nfunction normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\nexports.normalizeRadians = normalizeRadians;\n/**\n * Computes the angle of rotation between two anchor points.\n * @param point1 First anchor point\n * @param point2 Second anchor point\n */\nfunction computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\nexports.computeRotation = computeRotation;\nfunction radToDegrees(rad) {\n return rad * 180 / Math.PI;\n}\nexports.radToDegrees = radToDegrees;\nfunction buildTranslationMatrix(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n}\nfunction dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\nexports.dot = dot;\nfunction getColumnFrom2DArr(arr, columnIndex) {\n const column = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\nexports.getColumnFrom2DArr = getColumnFrom2DArr;\nfunction multiplyTransformMatrices(mat1, mat2) {\n const product = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\nfunction buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\nexports.buildRotationMatrix = buildRotationMatrix;\nfunction invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\nexports.invertTransformMatrix = invertTransformMatrix;\nfunction rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\nexports.rotatePoint = rotatePoint;\nfunction xyDistanceBetweenPoints(a, b) {\n return Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n}\nexports.xyDistanceBetweenPoints = xyDistanceBetweenPoints;\n", "/* eslint-disable class-methods-use-this */\nconst tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\nconst keypoints = require('./keypoints');\nconst util = require('./util');\n\nconst LANDMARKS_COUNT = 468;\nconst UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD = 0.25;\nconst MESH_MOUTH_INDEX = 13;\nconst MESH_KEYPOINTS_LINE_OF_SYMMETRY_INDICES = [MESH_MOUTH_INDEX, keypoints.MESH_ANNOTATIONS['midwayBetweenEyes'][0]];\nconst BLAZEFACE_MOUTH_INDEX = 3;\nconst BLAZEFACE_NOSE_INDEX = 2;\nconst BLAZEFACE_KEYPOINTS_LINE_OF_SYMMETRY_INDICES = [BLAZEFACE_MOUTH_INDEX, BLAZEFACE_NOSE_INDEX];\nconst LEFT_EYE_OUTLINE = keypoints.MESH_ANNOTATIONS['leftEyeLower0'];\nconst LEFT_EYE_BOUNDS = [LEFT_EYE_OUTLINE[0], LEFT_EYE_OUTLINE[LEFT_EYE_OUTLINE.length - 1]];\nconst RIGHT_EYE_OUTLINE = keypoints.MESH_ANNOTATIONS['rightEyeLower0'];\nconst RIGHT_EYE_BOUNDS = [RIGHT_EYE_OUTLINE[0], RIGHT_EYE_OUTLINE[RIGHT_EYE_OUTLINE.length - 1]];\nconst IRIS_UPPER_CENTER_INDEX = 3;\nconst IRIS_LOWER_CENTER_INDEX = 4;\nconst IRIS_IRIS_INDEX = 71;\nconst IRIS_NUM_COORDINATES = 76;\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates. Update the z coordinate to be an average of the original and the new. This produces the best visual effect.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < keypoints.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = keypoints.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = keypoints.MESH_ANNOTATIONS[`${prefix}${key}`];\n const shouldReplaceAllKeys = keys == null;\n if (shouldReplaceAllKeys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n// The Pipeline coordinates between the bounding box and skeleton models.\nclass Pipeline {\n constructor(boundingBoxDetector, meshDetector, irisModel, config) {\n // An array of facial bounding boxes.\n this.regionsOfInterest = [];\n this.runsWithoutFaceDetector = 0;\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.irisModel = irisModel;\n this.meshWidth = config.mesh.inputSize;\n this.meshHeight = config.mesh.inputSize;\n this.irisSize = config.iris.inputSize;\n this.irisEnlarge = config.iris.enlargeFactor;\n }\n\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const scaleFactor = [boxSize[0] / this.meshWidth, boxSize[1] / this.meshHeight];\n const coordsScaled = rawCoords.map((coord) => ([\n scaleFactor[0] * (coord[0] - this.meshWidth / 2),\n scaleFactor[1] * (coord[1] - this.meshHeight / 2), coord[2],\n ]));\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => ([...util.rotatePoint(coord, coordsRotationMatrix), coord[2]]));\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => ([\n coord[0] + originalBoxCenter[0],\n coord[1] + originalBoxCenter[1], coord[2],\n ]));\n }\n\n getLeftToRightEyeDepthDifference(rawCoords) {\n const leftEyeZ = rawCoords[LEFT_EYE_BOUNDS[0]][2];\n const rightEyeZ = rawCoords[RIGHT_EYE_BOUNDS[0]][2];\n return leftEyeZ - rightEyeZ;\n }\n\n // Returns a box describing a cropped region around the eye fit for passing to the iris model.\n getEyeBox(rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false) {\n const box = bounding.squarifyBox(bounding.enlargeBox(this.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), this.irisEnlarge));\n const boxSize = bounding.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / this.meshHeight,\n box.startPoint[0] / this.meshWidth, box.endPoint[1] / this.meshHeight,\n box.endPoint[0] / this.meshWidth,\n ]], [0], [this.irisSize, this.irisSize]);\n if (flip) {\n crop = tf.image.flipLeftRight(crop);\n }\n return { box, boxSize, crop };\n }\n\n // Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\n getEyeCoords(eyeData, eyeBox, eyeBoxSize, flip = false) {\n const eyeRawCoords = [];\n for (let i = 0; i < IRIS_NUM_COORDINATES; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip\n ? (1 - (x / this.irisSize))\n : (x / this.irisSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / this.irisSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(IRIS_IRIS_INDEX) };\n }\n\n // The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n getAdjustedIrisCoords(rawCoords, irisCoords, direction) {\n const upperCenterZ = rawCoords[keypoints.MESH_ANNOTATIONS[`${direction}EyeUpper0`][IRIS_UPPER_CENTER_INDEX]][2];\n const lowerCenterZ = rawCoords[keypoints.MESH_ANNOTATIONS[`${direction}EyeLower0`][IRIS_LOWER_CENTER_INDEX]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n }\n\n async predict(input, config) {\n this.skipFrames = config.detector.skipFrames;\n this.maxFaces = config.detector.maxFaces;\n this.runsWithoutFaceDetector++;\n if (this.shouldUpdateRegionsOfInterest()) {\n const detector = await this.boundingBoxDetector.getBoundingBoxes(input);\n if (detector.boxes.length === 0) {\n this.regionsOfInterest = [];\n return null;\n }\n const scaledBoxes = detector.boxes.map((prediction) => {\n const startPoint = prediction.box.startPoint.squeeze();\n const endPoint = prediction.box.endPoint.squeeze();\n const predictionBox = {\n startPoint: startPoint.arraySync(),\n endPoint: endPoint.arraySync(),\n };\n startPoint.dispose();\n endPoint.dispose();\n const scaledBox = bounding.scaleBoxCoordinates(predictionBox, detector.scaleFactor);\n const enlargedBox = bounding.enlargeBox(scaledBox);\n const landmarks = prediction.landmarks.arraySync();\n prediction.box.startPoint.dispose();\n prediction.box.endPoint.dispose();\n prediction.landmarks.dispose();\n prediction.probability.dispose();\n return { ...enlargedBox, landmarks };\n });\n this.updateRegionsOfInterest(scaledBoxes);\n this.runsWithoutFaceDetector = 0;\n }\n const results = tf.tidy(() => this.regionsOfInterest.map((box, i) => {\n let angle = 0;\n // The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).\n const boxLandmarksFromMeshModel = box.landmarks.length >= LANDMARKS_COUNT;\n let [indexOfMouth, indexOfForehead] = MESH_KEYPOINTS_LINE_OF_SYMMETRY_INDICES;\n if (boxLandmarksFromMeshModel === false) {\n [indexOfMouth, indexOfForehead] = BLAZEFACE_KEYPOINTS_LINE_OF_SYMMETRY_INDICES;\n }\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n let rotatedImage = input;\n let rotationMatrix = util.IDENTITY_MATRIX;\n if (angle !== 0) {\n rotatedImage = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized);\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n }\n const boxCPU = { startPoint: box.startPoint, endPoint: box.endPoint };\n const face = bounding.cutBoxFromImageAndResize(boxCPU, rotatedImage, [this.meshHeight, this.meshWidth]).div(255);\n // The first returned tensor represents facial contours, which are included in the coordinates.\n const [, flag, coords] = this.meshDetector.predict(face);\n const coordsReshaped = tf.reshape(coords, [-1, 3]);\n let rawCoords = coordsReshaped.arraySync();\n if (config.iris.enabled) {\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = this.getEyeBox(rawCoords, face, LEFT_EYE_BOUNDS[0], LEFT_EYE_BOUNDS[1], true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = this.getEyeBox(rawCoords, face, RIGHT_EYE_BOUNDS[0], RIGHT_EYE_BOUNDS[1]);\n const eyePredictions = (this.irisModel.predict(tf.concat([leftEyeCrop, rightEyeCrop])));\n const eyePredictionsData = eyePredictions.dataSync();\n eyePredictions.dispose();\n const leftEyeData = eyePredictionsData.slice(0, IRIS_NUM_COORDINATES * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = this.getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(IRIS_NUM_COORDINATES * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = this.getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = this.getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left');\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right');\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged. So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = this.getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = this.getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n rawCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n }\n const transformedCoordsData = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n tf.dispose(rawCoords);\n const landmarksBox = bounding.enlargeBox(this.calculateLandmarksBoundingBox(transformedCoordsData));\n const confidence = flag.squeeze();\n tf.dispose(flag);\n if (config.mesh.enabled) {\n const transformedCoords = tf.tensor2d(transformedCoordsData);\n this.regionsOfInterest[i] = { ...landmarksBox, landmarks: transformedCoords.arraySync() };\n const prediction = {\n coords: transformedCoords,\n box: landmarksBox,\n confidence,\n image: face,\n };\n return prediction;\n }\n const prediction = {\n coords: null,\n box: landmarksBox,\n confidence,\n image: face,\n };\n return prediction;\n }));\n return results;\n }\n\n // Updates regions of interest if the intersection over union between the incoming and previous regions falls below a threshold.\n updateRegionsOfInterest(boxes) {\n for (let i = 0; i < boxes.length; i++) {\n const box = boxes[i];\n const previousBox = this.regionsOfInterest[i];\n let iou = 0;\n if (previousBox && previousBox.startPoint) {\n const [boxStartX, boxStartY] = box.startPoint;\n const [boxEndX, boxEndY] = box.endPoint;\n const [previousBoxStartX, previousBoxStartY] = previousBox.startPoint;\n const [previousBoxEndX, previousBoxEndY] = previousBox.endPoint;\n const xStartMax = Math.max(boxStartX, previousBoxStartX);\n const yStartMax = Math.max(boxStartY, previousBoxStartY);\n const xEndMin = Math.min(boxEndX, previousBoxEndX);\n const yEndMin = Math.min(boxEndY, previousBoxEndY);\n const intersection = (xEndMin - xStartMax) * (yEndMin - yStartMax);\n const boxArea = (boxEndX - boxStartX) * (boxEndY - boxStartY);\n const previousBoxArea = (previousBoxEndX - previousBoxStartX) * (previousBoxEndY - boxStartY);\n iou = intersection / (boxArea + previousBoxArea - intersection);\n }\n if (iou < UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD) {\n this.regionsOfInterest[i] = box;\n }\n }\n this.regionsOfInterest = this.regionsOfInterest.slice(0, boxes.length);\n }\n\n clearRegionOfInterest(index) {\n if (this.regionsOfInterest[index] != null) {\n this.regionsOfInterest = [\n ...this.regionsOfInterest.slice(0, index),\n ...this.regionsOfInterest.slice(index + 1),\n ];\n }\n }\n\n shouldUpdateRegionsOfInterest() {\n if (this.regionsOfInterest.length === 0) return true; // nothing detected, so run detector on the next frame\n return (this.regionsOfInterest.length !== this.maxFaces) && (this.runsWithoutFaceDetector >= this.skipFrames);\n }\n\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint, landmarks };\n }\n}\nexports.Pipeline = Pipeline;\n", "exports.UV_COORDS = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n", "export default [\n 127, 34, 139, 11, 0, 37, 232, 231, 120, 72, 37, 39, 128, 121, 47, 232, 121,\n 128, 104, 69, 67, 175, 171, 148, 157, 154, 155, 118, 50, 101, 73, 39, 40, 9,\n 151, 108, 48, 115, 131, 194, 204, 211, 74, 40, 185, 80, 42, 183, 40, 92,\n 186, 230, 229, 118, 202, 212, 214, 83, 18, 17, 76, 61, 146, 160, 29, 30, 56,\n 157, 173, 106, 204, 194, 135, 214, 192, 203, 165, 98, 21, 71, 68, 51, 45, 4,\n 144, 24, 23, 77, 146, 91, 205, 50, 187, 201, 200, 18, 91, 106, 182, 90, 91,\n 181, 85, 84, 17, 206, 203, 36, 148, 171, 140, 92, 40, 39, 193, 189, 244,\n 159, 158, 28, 247, 246, 161, 236, 3, 196, 54, 68, 104, 193, 168, 8, 117,\n 228, 31, 189, 193, 55, 98, 97, 99, 126, 47, 100, 166, 79, 218, 155, 154, 26,\n 209, 49, 131, 135, 136, 150, 47, 126, 217, 223, 52, 53, 45, 51, 134, 211,\n 170, 140, 67, 69, 108, 43, 106, 91, 230, 119, 120, 226, 130, 247, 63, 53,\n 52, 238, 20, 242, 46, 70, 156, 78, 62, 96, 46, 53, 63, 143, 34, 227, 173,\n 155, 133, 123, 117, 111, 44, 125, 19, 236, 134, 51, 216, 206, 205, 154, 153,\n 22, 39, 37, 167, 200, 201, 208, 36, 142, 100, 57, 212, 202, 20, 60, 99, 28,\n 158, 157, 35, 226, 113, 160, 159, 27, 204, 202, 210, 113, 225, 46, 43, 202,\n 204, 62, 76, 77, 137, 123, 116, 41, 38, 72, 203, 129, 142, 64, 98, 240, 49,\n 102, 64, 41, 73, 74, 212, 216, 207, 42, 74, 184, 169, 170, 211, 170, 149,\n 176, 105, 66, 69, 122, 6, 168, 123, 147, 187, 96, 77, 90, 65, 55, 107, 89,\n 90, 180, 101, 100, 120, 63, 105, 104, 93, 137, 227, 15, 86, 85, 129, 102,\n 49, 14, 87, 86, 55, 8, 9, 100, 47, 121, 145, 23, 22, 88, 89, 179, 6, 122,\n 196, 88, 95, 96, 138, 172, 136, 215, 58, 172, 115, 48, 219, 42, 80, 81, 195,\n 3, 51, 43, 146, 61, 171, 175, 199, 81, 82, 38, 53, 46, 225, 144, 163, 110,\n 246, 33, 7, 52, 65, 66, 229, 228, 117, 34, 127, 234, 107, 108, 69, 109, 108,\n 151, 48, 64, 235, 62, 78, 191, 129, 209, 126, 111, 35, 143, 163, 161, 246,\n 117, 123, 50, 222, 65, 52, 19, 125, 141, 221, 55, 65, 3, 195, 197, 25, 7,\n 33, 220, 237, 44, 70, 71, 139, 122, 193, 245, 247, 130, 33, 71, 21, 162,\n 153, 158, 159, 170, 169, 150, 188, 174, 196, 216, 186, 92, 144, 160, 161, 2,\n 97, 167, 141, 125, 241, 164, 167, 37, 72, 38, 12, 145, 159, 160, 38, 82, 13,\n 63, 68, 71, 226, 35, 111, 158, 153, 154, 101, 50, 205, 206, 92, 165, 209,\n 198, 217, 165, 167, 97, 220, 115, 218, 133, 112, 243, 239, 238, 241, 214,\n 135, 169, 190, 173, 133, 171, 208, 32, 125, 44, 237, 86, 87, 178, 85, 86,\n 179, 84, 85, 180, 83, 84, 181, 201, 83, 182, 137, 93, 132, 76, 62, 183, 61,\n 76, 184, 57, 61, 185, 212, 57, 186, 214, 207, 187, 34, 143, 156, 79, 239,\n 237, 123, 137, 177, 44, 1, 4, 201, 194, 32, 64, 102, 129, 213, 215, 138, 59,\n 166, 219, 242, 99, 97, 2, 94, 141, 75, 59, 235, 24, 110, 228, 25, 130, 226,\n 23, 24, 229, 22, 23, 230, 26, 22, 231, 112, 26, 232, 189, 190, 243, 221, 56,\n 190, 28, 56, 221, 27, 28, 222, 29, 27, 223, 30, 29, 224, 247, 30, 225, 238,\n 79, 20, 166, 59, 75, 60, 75, 240, 147, 177, 215, 20, 79, 166, 187, 147, 213,\n 112, 233, 244, 233, 128, 245, 128, 114, 188, 114, 217, 174, 131, 115, 220,\n 217, 198, 236, 198, 131, 134, 177, 132, 58, 143, 35, 124, 110, 163, 7, 228,\n 110, 25, 356, 389, 368, 11, 302, 267, 452, 350, 349, 302, 303, 269, 357,\n 343, 277, 452, 453, 357, 333, 332, 297, 175, 152, 377, 384, 398, 382, 347,\n 348, 330, 303, 304, 270, 9, 336, 337, 278, 279, 360, 418, 262, 431, 304,\n 408, 409, 310, 415, 407, 270, 409, 410, 450, 348, 347, 422, 430, 434, 313,\n 314, 17, 306, 307, 375, 387, 388, 260, 286, 414, 398, 335, 406, 418, 364,\n 367, 416, 423, 358, 327, 251, 284, 298, 281, 5, 4, 373, 374, 253, 307, 320,\n 321, 425, 427, 411, 421, 313, 18, 321, 405, 406, 320, 404, 405, 315, 16, 17,\n 426, 425, 266, 377, 400, 369, 322, 391, 269, 417, 465, 464, 386, 257, 258,\n 466, 260, 388, 456, 399, 419, 284, 332, 333, 417, 285, 8, 346, 340, 261,\n 413, 441, 285, 327, 460, 328, 355, 371, 329, 392, 439, 438, 382, 341, 256,\n 429, 420, 360, 364, 394, 379, 277, 343, 437, 443, 444, 283, 275, 440, 363,\n 431, 262, 369, 297, 338, 337, 273, 375, 321, 450, 451, 349, 446, 342, 467,\n 293, 334, 282, 458, 461, 462, 276, 353, 383, 308, 324, 325, 276, 300, 293,\n 372, 345, 447, 382, 398, 362, 352, 345, 340, 274, 1, 19, 456, 248, 281, 436,\n 427, 425, 381, 256, 252, 269, 391, 393, 200, 199, 428, 266, 330, 329, 287,\n 273, 422, 250, 462, 328, 258, 286, 384, 265, 353, 342, 387, 259, 257, 424,\n 431, 430, 342, 353, 276, 273, 335, 424, 292, 325, 307, 366, 447, 345, 271,\n 303, 302, 423, 266, 371, 294, 455, 460, 279, 278, 294, 271, 272, 304, 432,\n 434, 427, 272, 407, 408, 394, 430, 431, 395, 369, 400, 334, 333, 299, 351,\n 417, 168, 352, 280, 411, 325, 319, 320, 295, 296, 336, 319, 403, 404, 330,\n 348, 349, 293, 298, 333, 323, 454, 447, 15, 16, 315, 358, 429, 279, 14, 15,\n 316, 285, 336, 9, 329, 349, 350, 374, 380, 252, 318, 402, 403, 6, 197, 419,\n 318, 319, 325, 367, 364, 365, 435, 367, 397, 344, 438, 439, 272, 271, 311,\n 195, 5, 281, 273, 287, 291, 396, 428, 199, 311, 271, 268, 283, 444, 445,\n 373, 254, 339, 263, 466, 249, 282, 334, 296, 449, 347, 346, 264, 447, 454,\n 336, 296, 299, 338, 10, 151, 278, 439, 455, 292, 407, 415, 358, 371, 355,\n 340, 345, 372, 390, 249, 466, 346, 347, 280, 442, 443, 282, 19, 94, 370,\n 441, 442, 295, 248, 419, 197, 263, 255, 359, 440, 275, 274, 300, 383, 368,\n 351, 412, 465, 263, 467, 466, 301, 368, 389, 380, 374, 386, 395, 378, 379,\n 412, 351, 419, 436, 426, 322, 373, 390, 388, 2, 164, 393, 370, 462, 461,\n 164, 0, 267, 302, 11, 12, 374, 373, 387, 268, 12, 13, 293, 300, 301, 446,\n 261, 340, 385, 384, 381, 330, 266, 425, 426, 423, 391, 429, 355, 437, 391,\n 327, 326, 440, 457, 438, 341, 382, 362, 459, 457, 461, 434, 430, 394, 414,\n 463, 362, 396, 369, 262, 354, 461, 457, 316, 403, 402, 315, 404, 403, 314,\n 405, 404, 313, 406, 405, 421, 418, 406, 366, 401, 361, 306, 408, 407, 291,\n 409, 408, 287, 410, 409, 432, 436, 410, 434, 416, 411, 264, 368, 383, 309,\n 438, 457, 352, 376, 401, 274, 275, 4, 421, 428, 262, 294, 327, 358, 433,\n 416, 367, 289, 455, 439, 462, 370, 326, 2, 326, 370, 305, 460, 455, 254,\n 449, 448, 255, 261, 446, 253, 450, 449, 252, 451, 450, 256, 452, 451, 341,\n 453, 452, 413, 464, 463, 441, 413, 414, 258, 442, 441, 257, 443, 442, 259,\n 444, 443, 260, 445, 444, 467, 342, 445, 459, 458, 250, 289, 392, 290, 290,\n 328, 460, 376, 433, 435, 250, 290, 392, 411, 416, 433, 341, 463, 464, 453,\n 464, 465, 357, 465, 412, 343, 412, 399, 360, 363, 440, 437, 399, 456, 420,\n 456, 363, 401, 435, 288, 372, 383, 353, 339, 255, 249, 448, 261, 255, 133,\n 243, 190, 133, 155, 112, 33, 246, 247, 33, 130, 25, 398, 384, 286, 362, 398,\n 414, 362, 463, 341, 263, 359, 467, 263, 249, 255, 466, 467, 260, 75, 60,\n 166, 238, 239, 79, 162, 127, 139, 72, 11, 37, 121, 232, 120, 73, 72, 39,\n 114, 128, 47, 233, 232, 128, 103, 104, 67, 152, 175, 148, 173, 157, 155,\n 119, 118, 101, 74, 73, 40, 107, 9, 108, 49, 48, 131, 32, 194, 211, 184, 74,\n 185, 191, 80, 183, 185, 40, 186, 119, 230, 118, 210, 202, 214, 84, 83, 17,\n 77, 76, 146, 161, 160, 30, 190, 56, 173, 182, 106, 194, 138, 135, 192, 129,\n 203, 98, 54, 21, 68, 5, 51, 4, 145, 144, 23, 90, 77, 91, 207, 205, 187, 83,\n 201, 18, 181, 91, 182, 180, 90, 181, 16, 85, 17, 205, 206, 36, 176, 148,\n 140, 165, 92, 39, 245, 193, 244, 27, 159, 28, 30, 247, 161, 174, 236, 196,\n 103, 54, 104, 55, 193, 8, 111, 117, 31, 221, 189, 55, 240, 98, 99, 142, 126,\n 100, 219, 166, 218, 112, 155, 26, 198, 209, 131, 169, 135, 150, 114, 47,\n 217, 224, 223, 53, 220, 45, 134, 32, 211, 140, 109, 67, 108, 146, 43, 91,\n 231, 230, 120, 113, 226, 247, 105, 63, 52, 241, 238, 242, 124, 46, 156, 95,\n 78, 96, 70, 46, 63, 116, 143, 227, 116, 123, 111, 1, 44, 19, 3, 236, 51,\n 207, 216, 205, 26, 154, 22, 165, 39, 167, 199, 200, 208, 101, 36, 100, 43,\n 57, 202, 242, 20, 99, 56, 28, 157, 124, 35, 113, 29, 160, 27, 211, 204, 210,\n 124, 113, 46, 106, 43, 204, 96, 62, 77, 227, 137, 116, 73, 41, 72, 36, 203,\n 142, 235, 64, 240, 48, 49, 64, 42, 41, 74, 214, 212, 207, 183, 42, 184, 210,\n 169, 211, 140, 170, 176, 104, 105, 69, 193, 122, 168, 50, 123, 187, 89, 96,\n 90, 66, 65, 107, 179, 89, 180, 119, 101, 120, 68, 63, 104, 234, 93, 227, 16,\n 15, 85, 209, 129, 49, 15, 14, 86, 107, 55, 9, 120, 100, 121, 153, 145, 22,\n 178, 88, 179, 197, 6, 196, 89, 88, 96, 135, 138, 136, 138, 215, 172, 218,\n 115, 219, 41, 42, 81, 5, 195, 51, 57, 43, 61, 208, 171, 199, 41, 81, 38,\n 224, 53, 225, 24, 144, 110, 105, 52, 66, 118, 229, 117, 227, 34, 234, 66,\n 107, 69, 10, 109, 151, 219, 48, 235, 183, 62, 191, 142, 129, 126, 116, 111,\n 143, 7, 163, 246, 118, 117, 50, 223, 222, 52, 94, 19, 141, 222, 221, 65,\n 196, 3, 197, 45, 220, 44, 156, 70, 139, 188, 122, 245, 139, 71, 162, 145,\n 153, 159, 149, 170, 150, 122, 188, 196, 206, 216, 92, 163, 144, 161, 164, 2,\n 167, 242, 141, 241, 0, 164, 37, 11, 72, 12, 144, 145, 160, 12, 38, 13, 70,\n 63, 71, 31, 226, 111, 157, 158, 154, 36, 101, 205, 203, 206, 165, 126, 209,\n 217, 98, 165, 97, 237, 220, 218, 237, 239, 241, 210, 214, 169, 140, 171, 32,\n 241, 125, 237, 179, 86, 178, 180, 85, 179, 181, 84, 180, 182, 83, 181, 194,\n 201, 182, 177, 137, 132, 184, 76, 183, 185, 61, 184, 186, 57, 185, 216, 212,\n 186, 192, 214, 187, 139, 34, 156, 218, 79, 237, 147, 123, 177, 45, 44, 4,\n 208, 201, 32, 98, 64, 129, 192, 213, 138, 235, 59, 219, 141, 242, 97, 97, 2,\n 141, 240, 75, 235, 229, 24, 228, 31, 25, 226, 230, 23, 229, 231, 22, 230,\n 232, 26, 231, 233, 112, 232, 244, 189, 243, 189, 221, 190, 222, 28, 221,\n 223, 27, 222, 224, 29, 223, 225, 30, 224, 113, 247, 225, 99, 60, 240, 213,\n 147, 215, 60, 20, 166, 192, 187, 213, 243, 112, 244, 244, 233, 245, 245,\n 128, 188, 188, 114, 174, 134, 131, 220, 174, 217, 236, 236, 198, 134, 215,\n 177, 58, 156, 143, 124, 25, 110, 7, 31, 228, 25, 264, 356, 368, 0, 11, 267,\n 451, 452, 349, 267, 302, 269, 350, 357, 277, 350, 452, 357, 299, 333, 297,\n 396, 175, 377, 381, 384, 382, 280, 347, 330, 269, 303, 270, 151, 9, 337,\n 344, 278, 360, 424, 418, 431, 270, 304, 409, 272, 310, 407, 322, 270, 410,\n 449, 450, 347, 432, 422, 434, 18, 313, 17, 291, 306, 375, 259, 387, 260,\n 424, 335, 418, 434, 364, 416, 391, 423, 327, 301, 251, 298, 275, 281, 4,\n 254, 373, 253, 375, 307, 321, 280, 425, 411, 200, 421, 18, 335, 321, 406,\n 321, 320, 405, 314, 315, 17, 423, 426, 266, 396, 377, 369, 270, 322, 269,\n 413, 417, 464, 385, 386, 258, 248, 456, 419, 298, 284, 333, 168, 417, 8,\n 448, 346, 261, 417, 413, 285, 326, 327, 328, 277, 355, 329, 309, 392, 438,\n 381, 382, 256, 279, 429, 360, 365, 364, 379, 355, 277, 437, 282, 443, 283,\n 281, 275, 363, 395, 431, 369, 299, 297, 337, 335, 273, 321, 348, 450, 349,\n 359, 446, 467, 283, 293, 282, 250, 458, 462, 300, 276, 383, 292, 308, 325,\n 283, 276, 293, 264, 372, 447, 346, 352, 340, 354, 274, 19, 363, 456, 281,\n 426, 436, 425, 380, 381, 252, 267, 269, 393, 421, 200, 428, 371, 266, 329,\n 432, 287, 422, 290, 250, 328, 385, 258, 384, 446, 265, 342, 386, 387, 257,\n 422, 424, 430, 445, 342, 276, 422, 273, 424, 306, 292, 307, 352, 366, 345,\n 268, 271, 302, 358, 423, 371, 327, 294, 460, 331, 279, 294, 303, 271, 304,\n 436, 432, 427, 304, 272, 408, 395, 394, 431, 378, 395, 400, 296, 334, 299,\n 6, 351, 168, 376, 352, 411, 307, 325, 320, 285, 295, 336, 320, 319, 404,\n 329, 330, 349, 334, 293, 333, 366, 323, 447, 316, 15, 315, 331, 358, 279,\n 317, 14, 316, 8, 285, 9, 277, 329, 350, 253, 374, 252, 319, 318, 403, 351,\n 6, 419, 324, 318, 325, 397, 367, 365, 288, 435, 397, 278, 344, 439, 310,\n 272, 311, 248, 195, 281, 375, 273, 291, 175, 396, 199, 312, 311, 268, 276,\n 283, 445, 390, 373, 339, 295, 282, 296, 448, 449, 346, 356, 264, 454, 337,\n 336, 299, 337, 338, 151, 294, 278, 455, 308, 292, 415, 429, 358, 355, 265,\n 340, 372, 388, 390, 466, 352, 346, 280, 295, 442, 282, 354, 19, 370, 285,\n 441, 295, 195, 248, 197, 457, 440, 274, 301, 300, 368, 417, 351, 465, 251,\n 301, 389, 385, 380, 386, 394, 395, 379, 399, 412, 419, 410, 436, 322, 387,\n 373, 388, 326, 2, 393, 354, 370, 461, 393, 164, 267, 268, 302, 12, 386, 374,\n 387, 312, 268, 13, 298, 293, 301, 265, 446, 340, 380, 385, 381, 280, 330,\n 425, 322, 426, 391, 420, 429, 437, 393, 391, 326, 344, 440, 438, 458, 459,\n 461, 364, 434, 394, 428, 396, 262, 274, 354, 457, 317, 316, 402, 316, 315,\n 403, 315, 314, 404, 314, 313, 405, 313, 421, 406, 323, 366, 361, 292, 306,\n 407, 306, 291, 408, 291, 287, 409, 287, 432, 410, 427, 434, 411, 372, 264,\n 383, 459, 309, 457, 366, 352, 401, 1, 274, 4, 418, 421, 262, 331, 294, 358,\n 435, 433, 367, 392, 289, 439, 328, 462, 326, 94, 2, 370, 289, 305, 455, 339,\n 254, 448, 359, 255, 446, 254, 253, 449, 253, 252, 450, 252, 256, 451, 256,\n 341, 452, 414, 413, 463, 286, 441, 414, 286, 258, 441, 258, 257, 442, 257,\n 259, 443, 259, 260, 444, 260, 467, 445, 309, 459, 250, 305, 289, 290, 305,\n 290, 460, 401, 376, 435, 309, 250, 392, 376, 411, 433, 453, 341, 464, 357,\n 453, 465, 343, 357, 412, 437, 343, 399, 344, 360, 440, 420, 437, 456, 360,\n 420, 363, 361, 401, 288, 265, 372, 353, 390, 339, 249, 339, 448, 255];\n", "const tf = require('@tensorflow/tfjs');\nconst blazeface = require('./blazeface');\nconst keypoints = require('./keypoints');\nconst pipe = require('./pipeline');\nconst uv_coords = require('./uvcoords');\nconst triangulation = require('./triangulation').default;\n\nclass MediaPipeFaceMesh {\n constructor(blazeFace, blazeMeshModel, irisModel, config) {\n this.pipeline = new pipe.Pipeline(blazeFace, blazeMeshModel, irisModel, config);\n if (config) this.config = config;\n }\n\n async estimateFaces(input, config) {\n if (config) this.config = config;\n const predictions = await this.pipeline.predict(input, config);\n const results = [];\n for (const prediction of (predictions || [])) {\n // guard against disposed tensors on long running operations such as pause in middle of processing\n if (prediction.isDisposedInternal) continue;\n const confidence = prediction.confidence.arraySync();\n if (confidence >= this.config.detector.minConfidence) {\n const mesh = prediction.coords ? prediction.coords.arraySync() : null;\n const annotations = {};\n if (mesh && mesh.length > 0) {\n for (const key in keypoints.MESH_ANNOTATIONS) {\n if (this.config.iris.enabled || key.includes('Iris') === false) {\n annotations[key] = keypoints.MESH_ANNOTATIONS[key].map((index) => mesh[index]);\n }\n }\n }\n results.push({\n confidence: confidence || 0,\n box: prediction.box ? [prediction.box.startPoint[0], prediction.box.startPoint[1], prediction.box.endPoint[0] - prediction.box.startPoint[0], prediction.box.endPoint[1] - prediction.box.startPoint[1]] : 0,\n mesh,\n annotations,\n image: prediction.image ? tf.clone(prediction.image) : null,\n });\n }\n if (prediction.confidence) prediction.confidence.dispose();\n if (prediction.coords) prediction.coords.dispose();\n if (prediction.image) prediction.image.dispose();\n }\n return results;\n }\n}\n\nasync function load(config) {\n const models = await Promise.all([\n blazeface.load(config),\n tf.loadGraphModel(config.mesh.modelPath, { fromTFHub: config.mesh.modelPath.includes('tfhub.dev') }),\n tf.loadGraphModel(config.iris.modelPath, { fromTFHub: config.iris.modelPath.includes('tfhub.dev') }),\n ]);\n const faceMesh = new MediaPipeFaceMesh(models[0], models[1], models[2], config);\n return faceMesh;\n}\n\nexports.load = load;\nexports.MediaPipeFaceMesh = MediaPipeFaceMesh;\nexports.uv_coords = uv_coords;\nexports.triangulation = triangulation;\n", "const tf = require('@tensorflow/tfjs');\n\nconst models = {};\nlet last = { age: 0, gender: '' };\nlet frame = 0;\n\nasync function loadAge(config) {\n if (!models.age) models.age = await tf.loadGraphModel(config.face.age.modelPath);\n return models.age;\n}\n\nasync function loadGender(config) {\n if (!models.gender) models.gender = await tf.loadGraphModel(config.face.gender.modelPath);\n return models.gender;\n}\n\nasync function predict(image, config) {\n if (frame < config.face.age.skipFrames) {\n frame += 1;\n return last;\n }\n frame = 0;\n const resize = tf.image.resizeBilinear(image, [config.face.age.inputSize, config.face.age.inputSize], false);\n const enhance = tf.mul(resize, [255.0]);\n tf.dispose(resize);\n\n const promises = [];\n let ageT;\n let genderT;\n if (config.face.age.enabled) promises.push(ageT = models.age.predict(enhance));\n if (config.face.gender.enabled) promises.push(genderT = models.gender.predict(enhance));\n await Promise.all(promises);\n\n const obj = {};\n if (ageT) {\n const data = await ageT.data();\n obj.age = Math.trunc(10 * data[0]) / 10;\n tf.dispose(ageT);\n }\n if (genderT) {\n const data = await genderT.data();\n const confidence = Math.trunc(Math.abs(1.9 * 100 * (data[0] - 0.5))) / 100;\n if (confidence > config.face.gender.minConfidence) {\n obj.gender = data[0] <= 0.5 ? 'female' : 'male';\n obj.confidence = confidence;\n }\n tf.dispose(genderT);\n }\n\n tf.dispose(enhance);\n last = obj;\n return obj;\n}\n\nexports.predict = predict;\nexports.loadAge = loadAge;\nexports.loadGender = loadGender;\n", "const tf = require('@tensorflow/tfjs');\n\nconst annotations = ['angry', 'discust', 'fear', 'happy', 'sad', 'surpise', 'neutral'];\nconst models = {};\nlet last = [];\nlet frame = 0;\nconst multiplier = 1.5;\n\nasync function load(config) {\n if (!models.emotion) models.emotion = await tf.loadGraphModel(config.face.emotion.modelPath);\n return models.emotion;\n}\n\nasync function predict(image, config) {\n if (frame < config.face.emotion.skipFrames) {\n frame += 1;\n return last;\n }\n frame = 0;\n const resize = tf.image.resizeBilinear(image, [config.face.emotion.inputSize, config.face.emotion.inputSize], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n resize.dispose();\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, [0.2989]);\n const greenNorm = tf.mul(green, [0.5870]);\n const blueNorm = tf.mul(blue, [0.1140]);\n red.dispose();\n green.dispose();\n blue.dispose();\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n redNorm.dispose();\n greenNorm.dispose();\n blueNorm.dispose();\n const obj = [];\n if (config.face.emotion.enabled) {\n const emotionT = await models.emotion.predict(grayscale);\n const data = await emotionT.data();\n for (let i = 0; i < data.length; i++) {\n if (multiplier * data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * multiplier * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n tf.dispose(emotionT);\n }\n tf.dispose(grayscale);\n last = obj;\n return obj;\n}\n\nexports.predict = predict;\nexports.load = load;\n", "const tf = require('@tensorflow/tfjs');\n\nclass BaseModel {\n constructor(model, outputStride) {\n this.model = model;\n this.outputStride = outputStride;\n const inputShape = this.model.inputs[0].shape;\n tf.util.assert((inputShape[1] === -1) && (inputShape[2] === -1), () => `Input shape [${inputShape[1]}, ${inputShape[2]}] must both be equal to or -1`);\n }\n\n /**\n * Predicts intermediate Tensor representations.\n *\n * @param input The input RGB image of the base model.\n * A Tensor of shape: [`inputResolution`, `inputResolution`, 3].\n *\n * @return A dictionary of base model's intermediate predictions.\n * The returned dictionary should contains the following elements:\n * heatmapScores: A Tensor3D that represents the heatmapScores.\n * offsets: A Tensor3D that represents the offsets.\n * displacementFwd: A Tensor3D that represents the forward displacement.\n * displacementBwd: A Tensor3D that represents the backward displacement.\n */\n predict(input) {\n return tf.tidy(() => {\n const asFloat = this.preprocessInput(input.toFloat());\n const asBatch = asFloat.expandDims(0);\n const results = this.model.predict(asBatch);\n const results3d = results.map((y) => y.squeeze([0]));\n const namedResults = this.nameOutputResults(results3d);\n return {\n heatmapScores: namedResults.heatmap.sigmoid(),\n offsets: namedResults.offsets,\n displacementFwd: namedResults.displacementFwd,\n displacementBwd: namedResults.displacementBwd,\n };\n });\n }\n\n /**\n * Releases the CPU and GPU memory allocated by the model.\n */\n dispose() {\n this.model.dispose();\n }\n}\nexports.BaseModel = BaseModel;\n", "const tf = require('@tensorflow/tfjs');\nconst modelBase = require('./modelBase');\n\nclass MobileNet extends modelBase.BaseModel {\n // eslint-disable-next-line class-methods-use-this\n preprocessInput(input) {\n // Normalize the pixels [0, 255] to be between [-1, 1].\n return tf.tidy(() => tf.div(input, 127.5).sub(1.0));\n }\n\n // eslint-disable-next-line class-methods-use-this\n nameOutputResults(results) {\n const [offsets, heatmap, displacementFwd, displacementBwd] = results;\n return { offsets, heatmap, displacementFwd, displacementBwd };\n }\n}\nexports.MobileNet = MobileNet;\n", "// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nfunction half(k) {\n return Math.floor(k / 2);\n}\nclass MaxHeap {\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() {\n return this.numberOfElements === -1;\n }\n\n size() {\n return this.numberOfElements + 1;\n }\n\n all() {\n return this.priorityQueue.slice(0, this.numberOfElements + 1);\n }\n\n max() {\n return this.priorityQueue[0];\n }\n\n swim(k) {\n while (k > 0 && this.less(half(k), k)) {\n this.exchange(k, half(k));\n k = half(k);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\nexports.MaxHeap = MaxHeap;\n", "const heapSort = require('./heapSort');\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, localMaximumRadius, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) {\n break;\n }\n }\n return localMaximum;\n}\n/**\n * Builds a priority queue with part candidate positions for a specific image in\n * the batch. For this we find all local maxima in the score maps with score\n * values above a threshold. We create a single priority queue across all parts.\n */\nfunction buildPartWithScoreQueue(scoreThreshold, localMaximumRadius, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new heapSort.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < scoreThreshold) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, localMaximumRadius, scores)) {\n queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n }\n return queue;\n}\nexports.buildPartWithScoreQueue = buildPartWithScoreQueue;\n", "exports.partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\nexports.NUM_KEYPOINTS = exports.partNames.length;\nexports.partIds = exports.partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\n/*\n * Define the skeleton. This defines the parent->child relationships of our\n * tree. Arbitrarily this defines the nose as the root of the tree, however\n * since we will infer the displacement for both parent->child and\n * child->parent, we can define the tree root as any node.\n */\nexports.poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\nexports.connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([exports.partIds[jointNameA], exports.partIds[jointNameB]]));\nexports.partChannels = [\n 'left_face',\n 'right_face',\n 'right_upper_leg_front',\n 'right_lower_leg_back',\n 'right_upper_leg_back',\n 'left_lower_leg_front',\n 'left_upper_leg_front',\n 'left_upper_leg_back',\n 'left_lower_leg_back',\n 'right_feet',\n 'right_lower_leg_front',\n 'left_feet',\n 'torso_front',\n 'torso_back',\n 'right_upper_arm_front',\n 'right_upper_arm_back',\n 'right_lower_arm_back',\n 'left_lower_arm_front',\n 'left_upper_arm_front',\n 'left_upper_arm_back',\n 'left_lower_arm_back',\n 'right_hand',\n 'right_lower_arm_front',\n 'left_hand',\n];\n", "const kpt = require('./keypoints');\n\nfunction getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + kpt.NUM_KEYPOINTS),\n };\n}\nexports.getOffsetPoint = getOffsetPoint;\n\nfunction getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\nexports.getImageCoords = getImageCoords;\n\nfunction fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\nexports.fillArray = fillArray;\n\nfunction clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\nexports.clamp = clamp;\n\nfunction squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\nexports.squaredDistance = squaredDistance;\n\nfunction addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\nexports.addVectors = addVectors;\n\nfunction clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\nexports.clampVector = clampVector;\n", "const keypoints = require('./keypoints');\nconst vectors = require('./vectors');\n\nconst parentChildrenTuples = keypoints.poseChain.map(([parentJoinName, childJoinName]) => ([keypoints.partIds[parentJoinName], keypoints.partIds[childJoinName]]));\nconst parentToChildEdges = parentChildrenTuples.map(([, childJointId]) => childJointId);\nconst childToParentEdges = parentChildrenTuples.map(([parentJointId]) => parentJointId);\nfunction getDisplacement(edgeId, point, displacements) {\n const numEdges = displacements.shape[2] / 2;\n return {\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, numEdges + edgeId),\n };\n}\nfunction getStridedIndexNearPoint(point, outputStride, height, width) {\n return {\n y: vectors.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: vectors.clamp(Math.round(point.x / outputStride), 0, width - 1),\n };\n}\n/**\n * We get a new keypoint along the `edgeId` for the pose instance, assuming\n * that the position of the `idSource` part is already known. For this, we\n * follow the displacement vector from the source to target part (stored in\n * the `i`-t channel of the displacement tensor). The displaced keypoint\n * vector is refined using the offset vector by `offsetRefineStep` times.\n */\nfunction traverseToTargetKeypoint(edgeId, sourceKeypoint, targetKeypointId, scoresBuffer, offsets, outputStride, displacements, offsetRefineStep = 2) {\n const [height, width] = scoresBuffer.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, outputStride, height, width);\n const displacement = getDisplacement(edgeId, sourceKeypointIndices, displacements);\n const displacedPoint = vectors.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, outputStride, height, width);\n const offsetPoint = vectors.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetKeypointId, offsets);\n targetKeypoint = vectors.addVectors({\n x: targetKeypointIndices.x * outputStride,\n y: targetKeypointIndices.y * outputStride,\n }, { x: offsetPoint.x, y: offsetPoint.y });\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, outputStride, height, width);\n const score = scoresBuffer.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetKeypointId);\n return { position: targetKeypoint, part: keypoints.partNames[targetKeypointId], score };\n}\n/**\n * Follows the displacement fields to decode the full pose of the object\n * instance given the position of a part that acts as root.\n *\n * @return An array of decoded keypoints and their scores for a single pose\n */\nfunction decodePose(root, scores, offsets, outputStride, displacementsFwd, displacementsBwd) {\n const numParts = scores.shape[2];\n const numEdges = parentToChildEdges.length;\n const instanceKeypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const { part: rootPart, score: rootScore } = root;\n const rootPoint = vectors.getImageCoords(rootPart, outputStride, offsets);\n instanceKeypoints[rootPart.id] = {\n score: rootScore,\n part: keypoints.partNames[rootPart.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward\n // displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceKeypointId = parentToChildEdges[edge];\n const targetKeypointId = childToParentEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward\n // displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceKeypointId = childToParentEdges[edge];\n const targetKeypointId = parentToChildEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsFwd);\n }\n }\n return instanceKeypoints;\n}\nexports.decodePose = decodePose;\n", "const buildParts = require('./buildParts');\nconst decodePose = require('./decodePose');\nconst vectors = require('./vectors');\n\nfunction withinNmsRadiusOfCorrespondingPoint(poses, squaredNmsRadius, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId].position;\n return vectors.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n/* Score the newly proposed object instance without taking into account\n * the scores of the parts that overlap with any previously detected\n * instance.\n */\nfunction getInstanceScore(existingPoses, squaredNmsRadius, instanceKeypoints) {\n const notOverlappedKeypointScores = instanceKeypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinNmsRadiusOfCorrespondingPoint(existingPoses, squaredNmsRadius, position, keypointId)) {\n result += score;\n }\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / instanceKeypoints.length;\n}\n// A point (y, x) is considered as root part candidate if its score is a\n// maximum in a window |y - y'| <= kLocalMaximumRadius, |x - x'| <=\n// kLocalMaximumRadius.\nconst kLocalMaximumRadius = 1;\n/**\n * Detects multiple poses and finds their parts from part scores and\n * displacement vectors. It returns up to `maxDetections` object instance\n * detections in decreasing root score order. It works as follows: We first\n * create a priority queue with local part score maxima above\n * `scoreThreshold`, considering all parts at the same time. Then we\n * iteratively pull the top element of the queue (in decreasing score order)\n * and treat it as a root candidate for a new object instance. To avoid\n * duplicate detections, we reject the root candidate if it is within a disk\n * of `nmsRadius` pixels from the corresponding part of a previously detected\n * instance, which is a form of part-based non-maximum suppression (NMS). If\n * the root candidate passes the NMS check, we start a new object instance\n * detection, treating the corresponding part as root and finding the\n * positions of the remaining parts by following the displacement vectors\n * along the tree-structured part graph. We assign to the newly detected\n * instance a score equal to the sum of scores of its parts which have not\n * been claimed by a previous instance (i.e., those at least `nmsRadius`\n * pixels away from the corresponding part of all previously detected\n * instances), divided by the total number of parts `numParts`.\n *\n * @param heatmapScores 3-D tensor with shape `[height, width, numParts]`.\n * The value of heatmapScores[y, x, k]` is the score of placing the `k`-th\n * object part at position `(y, x)`.\n *\n * @param offsets 3-D tensor with shape `[height, width, numParts * 2]`.\n * The value of [offsets[y, x, k], offsets[y, x, k + numParts]]` is the\n * short range offset vector of the `k`-th object part at heatmap\n * position `(y, x)`.\n *\n * @param displacementsFwd 3-D tensor of shape\n * `[height, width, 2 * num_edges]`, where `num_edges = num_parts - 1` is the\n * number of edges (parent-child pairs) in the tree. It contains the forward\n * displacements between consecutive part from the root towards the leaves.\n *\n * @param displacementsBwd 3-D tensor of shape\n * `[height, width, 2 * num_edges]`, where `num_edges = num_parts - 1` is the\n * number of edges (parent-child pairs) in the tree. It contains the backward\n * displacements between consecutive part from the root towards the leaves.\n *\n * @param outputStride The output stride that was used when feed-forwarding\n * through the PoseNet model. Must be 32, 16, or 8.\n *\n * @param maxPoseDetections Maximum number of returned instance detections per\n * image.\n *\n * @param scoreThreshold Only return instance detections that have root part\n * score greater or equal to this value. Defaults to 0.5.\n *\n * @param nmsRadius Non-maximum suppression part distance. It needs to be\n * strictly positive. Two parts suppress each other if they are less than\n * `nmsRadius` pixels away. Defaults to 20.\n *\n * @return An array of poses and their scores, each containing keypoints and\n * the corresponding keypoint scores.\n */\nfunction decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer, outputStride, maxPoseDetections, scoreThreshold = 0.5, nmsRadius = 20) {\n const poses = [];\n const queue = buildParts.buildPartWithScoreQueue(scoreThreshold, kLocalMaximumRadius, scoresBuffer);\n const squaredNmsRadius = nmsRadius * nmsRadius;\n // Generate at most maxDetections object instances per image in\n // decreasing root part score order.\n while (poses.length < maxPoseDetections && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it\n // is within a disk of `nmsRadius` pixels from the corresponding part of\n // a previously detected instance.\n const rootImageCoords = vectors.getImageCoords(root.part, outputStride, offsetsBuffer);\n if (withinNmsRadiusOfCorrespondingPoint(poses, squaredNmsRadius, rootImageCoords, root.part.id)) continue;\n // Start a new detection instance at the position of the root.\n const keypoints = decodePose.decodePose(root, scoresBuffer, offsetsBuffer, outputStride, displacementsFwdBuffer, displacementsBwdBuffer);\n const score = getInstanceScore(poses, squaredNmsRadius, keypoints);\n poses.push({ keypoints, score });\n }\n return poses;\n}\nexports.decodeMultiplePoses = decodeMultiplePoses;\n", "const kpt = require('./keypoints');\n\nfunction eitherPointDoesntMeetConfidence(a, b, minConfidence) {\n return (a < minConfidence || b < minConfidence);\n}\n\nfunction getAdjacentKeyPoints(keypoints, minConfidence) {\n return kpt.connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\nexports.getAdjacentKeyPoints = getAdjacentKeyPoints;\n\nconst { NEGATIVE_INFINITY, POSITIVE_INFINITY } = Number;\nfunction getBoundingBox(keypoints) {\n return keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: NEGATIVE_INFINITY,\n maxY: NEGATIVE_INFINITY,\n minX: POSITIVE_INFINITY,\n minY: POSITIVE_INFINITY,\n });\n}\nexports.getBoundingBox = getBoundingBox;\nfunction getBoundingBoxPoints(keypoints) {\n const { minX, minY, maxX, maxY } = getBoundingBox(keypoints);\n return [{ x: minX, y: minY }, { x: maxX, y: minY }, { x: maxX, y: maxY }, { x: minX, y: maxY }];\n}\nexports.getBoundingBoxPoints = getBoundingBoxPoints;\nasync function toTensorBuffers3D(tensors) {\n return Promise.all(tensors.map((tensor) => tensor.buffer()));\n}\nexports.toTensorBuffers3D = toTensorBuffers3D;\n\nfunction scalePose(pose, scaleY, scaleX) {\n return {\n score: pose.score,\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: { x: position.x * scaleX, y: position.y * scaleY },\n })),\n };\n}\nexports.scalePose = scalePose;\n\nfunction resizeTo(image, [targetH, targetW]) {\n const input = image.squeeze(0);\n const resized = input.resizeBilinear([targetH, targetW]);\n input.dispose();\n return resized;\n}\nexports.resizeTo = resizeTo;\n\nfunction scaleAndFlipPoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]) {\n const scaledPoses = poses.map((pose) => scalePose(pose, height / inputResolutionHeight, width / inputResolutionWidth));\n return scaledPoses;\n}\nexports.scaleAndFlipPoses = scaleAndFlipPoses;\n", "const tf = require('@tensorflow/tfjs');\nconst modelMobileNet = require('./modelMobileNet');\nconst decodeMultiple = require('./decodeMultiple');\nconst util = require('./util');\n\nclass PoseNet {\n constructor(net) {\n this.baseModel = net;\n }\n\n /**\n * Infer through PoseNet, and estimates multiple poses using the outputs.\n * This does standard ImageNet pre-processing before inferring through the\n * model. The image should pixels should have values [0-255]. It detects\n * multiple poses and finds their parts from part scores and displacement\n * vectors using a fast greedy decoding algorithm. It returns up to\n * `config.maxDetections` object instance detections in decreasing root\n * score order.\n *\n * @param input\n * ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement) The input\n * image to feed through the network.\n *\n * @param config MultiPoseEstimationConfig object that contains parameters\n * for the PoseNet inference using multiple pose estimation.\n *\n * @return An array of poses and their scores, each containing keypoints and\n * the corresponding keypoint scores. The positions of the keypoints are\n * in the same scale as the original image\n */\n async estimatePoses(input, config) {\n const outputStride = config.outputStride;\n // const inputResolution = config.inputResolution;\n const height = input.shape[1];\n const width = input.shape[2];\n const resized = util.resizeTo(input, [config.inputResolution, config.inputResolution]);\n const { heatmapScores, offsets, displacementFwd, displacementBwd } = this.baseModel.predict(resized);\n const allTensorBuffers = await util.toTensorBuffers3D([heatmapScores, offsets, displacementFwd, displacementBwd]);\n const scoresBuffer = allTensorBuffers[0];\n const offsetsBuffer = allTensorBuffers[1];\n const displacementsFwdBuffer = allTensorBuffers[2];\n const displacementsBwdBuffer = allTensorBuffers[3];\n const poses = await decodeMultiple.decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer, outputStride, config.maxDetections, config.scoreThreshold, config.nmsRadius);\n const resultPoses = util.scaleAndFlipPoses(poses, [height, width], [config.inputResolution, config.inputResolution]);\n heatmapScores.dispose();\n offsets.dispose();\n displacementFwd.dispose();\n displacementBwd.dispose();\n resized.dispose();\n return resultPoses;\n }\n\n dispose() {\n this.baseModel.dispose();\n }\n}\nexports.PoseNet = PoseNet;\nasync function loadMobileNet(config) {\n const graphModel = await tf.loadGraphModel(config.modelPath);\n const mobilenet = new modelMobileNet.MobileNet(graphModel, config.outputStride);\n return new PoseNet(mobilenet);\n}\n/**\n * Loads the PoseNet model instance from a checkpoint, with the MobileNet architecture. The model to be loaded is configurable using the\n * config dictionary ModelConfig. Please find more details in the documentation of the ModelConfig.\n *\n * @param config ModelConfig dictionary that contains parameters for\n * the PoseNet loading process. Please find more details of each parameters\n * in the documentation of the ModelConfig interface. The predefined\n * `MOBILENET_V1_CONFIG` and `RESNET_CONFIG` can also be used as references\n * for defining your customized config.\n */\nasync function load(config) {\n return loadMobileNet(config);\n}\nexports.load = load;\n", "const modelMobileNet = require('./modelMobileNet');\nconst modelPoseNet = require('./modelPoseNet');\nconst decodeMultiple = require('./decodeMultiple');\nconst keypoints = require('./keypoints');\nconst util = require('./util');\n\nexports.load = modelPoseNet.load;\nexports.PoseNet = modelPoseNet.PoseNet;\n\nexports.MobileNet = modelMobileNet.MobileNet;\nexports.decodeMultiplePoses = decodeMultiple.decodeMultiplePoses;\nexports.partChannels = keypoints.partChannels;\nexports.partIds = keypoints.partIds;\nexports.partNames = keypoints.partNames;\nexports.poseChain = keypoints.poseChain;\nexports.getAdjacentKeyPoints = util.getAdjacentKeyPoints;\nexports.getBoundingBox = util.getBoundingBox;\nexports.getBoundingBoxPoints = util.getBoundingBoxPoints;\nexports.scaleAndFlipPoses = util.scaleAndFlipPoses;\nexports.scalePose = util.scalePose;\n", "const tf = require('@tensorflow/tfjs');\n\nfunction getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\nexports.getBoxSize = getBoxSize;\n\nfunction getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\nexports.getBoxCenter = getBoxCenter;\n\nfunction cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\nexports.cutBoxFromImageAndResize = cutBoxFromImageAndResize;\n\nfunction scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks };\n}\nexports.scaleBoxCoordinates = scaleBoxCoordinates;\n\nfunction enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.enlargeBox = enlargeBox;\n\nfunction squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.squarifyBox = squarifyBox;\n\nfunction shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0], box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.shiftBox = shiftBox;\n", "const tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\n\nclass HandDetector {\n constructor(model, anchors, config) {\n this.model = model;\n this.width = config.inputSize;\n this.height = config.inputSize;\n this.anchors = anchors.map((anchor) => [anchor.x_center, anchor.y_center]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n this.inputSizeTensor = tf.tensor1d([config.inputSize, config.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([config.inputSize * 2, config.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(rawPalmLandmarks.reshape([-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoundingBoxes(input) {\n const batchedPrediction = this.model.predict(input);\n const prediction = batchedPrediction.squeeze();\n // Regression score for each anchor point.\n const scores = tf.tidy(() => tf.sigmoid(tf.slice(prediction, [0, 0], [-1, 1])).squeeze());\n // Bounding box for each anchor point.\n const rawBoxes = tf.slice(prediction, [0, 1], [-1, 4]);\n const boxes = this.normalizeBoxes(rawBoxes);\n const boxesWithHandsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.maxHands, this.iouThreshold, this.scoreThreshold);\n const boxesWithHands = await boxesWithHandsTensor.array();\n const toDispose = [batchedPrediction, boxesWithHandsTensor, prediction, boxes, rawBoxes, scores];\n const detectedHands = tf.tidy(() => {\n const detectedBoxes = [];\n for (const i in boxesWithHands) {\n const boxIndex = boxesWithHands[i];\n const matchingBox = tf.slice(boxes, [boxIndex, 0], [1, -1]);\n const rawPalmLandmarks = tf.slice(prediction, [boxIndex, 5], [1, 14]);\n const palmLandmarks = tf.tidy(() => this.normalizeLandmarks(rawPalmLandmarks, boxIndex).reshape([-1, 2]));\n detectedBoxes.push({ boxes: matchingBox, palmLandmarks });\n }\n return detectedBoxes;\n });\n toDispose.forEach((tensor) => tensor.dispose());\n return detectedHands;\n }\n\n /**\n * Returns a Box identifying the bounding box of a hand within the image.\n * Returns null if there is no hand in the image.\n *\n * @param input The image to classify.\n */\n async estimateHandBounds(input, config) {\n // const inputHeight = input.shape[2];\n // const inputWidth = input.shape[1];\n this.iouThreshold = config.iouThreshold;\n this.scoreThreshold = config.scoreThreshold;\n this.maxHands = config.maxHands;\n const resized = input.resizeBilinear([this.width, this.height]);\n const divided = resized.div(255);\n const normalized = divided.sub(0.5);\n const image = normalized.mul(2.0);\n resized.dispose();\n divided.dispose();\n normalized.dispose();\n const predictions = await this.getBoundingBoxes(image);\n image.dispose();\n if (!predictions || (predictions.length === 0)) return null;\n const hands = [];\n for (const i in predictions) {\n const prediction = predictions[i];\n const boundingBoxes = await prediction.boxes.array();\n const startPoint = boundingBoxes[0].slice(0, 2);\n const endPoint = boundingBoxes[0].slice(2, 4);\n const palmLandmarks = await prediction.palmLandmarks.array();\n prediction.boxes.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(bounding.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks }, [input.shape[2] / this.width, input.shape[1] / this.height]));\n }\n return hands;\n }\n}\nexports.HandDetector = HandDetector;\n", "exports.MESH_ANNOTATIONS = {\n thumb: [1, 2, 3, 4],\n indexFinger: [5, 6, 7, 8],\n middleFinger: [9, 10, 11, 12],\n ringFinger: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palmBase: [0],\n};\n", "function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\nexports.normalizeRadians = normalizeRadians;\n\nfunction computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\nexports.computeRotation = computeRotation;\n\nconst buildTranslationMatrix = (x, y) => ([[1, 0, x], [0, 1, y], [0, 0, 1]]);\nfunction dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\nexports.dot = dot;\n\nfunction getColumnFrom2DArr(arr, columnIndex) {\n const column = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\nexports.getColumnFrom2DArr = getColumnFrom2DArr;\n\nfunction multiplyTransformMatrices(mat1, mat2) {\n const product = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\nfunction buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\nexports.buildRotationMatrix = buildRotationMatrix;\n\nfunction invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\nexports.invertTransformMatrix = invertTransformMatrix;\n\nfunction rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\nexports.rotatePoint = rotatePoint;\n", "const tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\nconst util = require('./util');\n\nconst UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD = 0.8;\nconst PALM_BOX_SHIFT_VECTOR = [0, -0.4];\nconst HAND_BOX_SHIFT_VECTOR = [0, -0.1];\nconst HAND_BOX_ENLARGE_FACTOR = 1.65;\nconst PALM_LANDMARK_IDS = [0, 5, 9, 13, 17, 1, 2];\nconst PALM_LANDMARKS_INDEX_OF_PALM_BASE = 0;\nconst PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE = 2;\n\n// The Pipeline coordinates between the bounding box and skeleton models.\nclass HandPipeline {\n constructor(boundingBoxDetector, meshDetector, config) {\n this.regionsOfInterest = [];\n this.runsWithoutHandDetector = 0;\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.meshWidth = config.inputSize;\n this.meshHeight = config.inputSize;\n this.enlargeFactor = config.enlargeFactor;\n }\n\n // Get the bounding box surrounding the hand, given palm landmarks.\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => {\n const homogeneousCoordinate = [...coord, 1];\n return util.rotatePoint(homogeneousCoordinate, rotationMatrix);\n });\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n // boxAroundPalm only surrounds the palm - therefore we shift it\n // upwards so it will capture fingers once enlarged + squarified.\n return bounding.enlargeBox(bounding.squarifyBox(bounding.shiftBox(boxAroundPalm, PALM_BOX_SHIFT_VECTOR)), this.enlargeFactor);\n }\n\n // Get the bounding box surrounding the hand, given all hand landmarks.\n getBoxForHandLandmarks(landmarks) {\n // The MediaPipe hand mesh model is trained on hands with empty space\n // around them, so we still need to shift / enlarge boxAroundHand even\n // though it surrounds the entire hand.\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = bounding.enlargeBox(bounding.squarifyBox(bounding.shiftBox(boundingBox, HAND_BOX_SHIFT_VECTOR)), HAND_BOX_ENLARGE_FACTOR);\n const palmLandmarks = [];\n for (let i = 0; i < PALM_LANDMARK_IDS.length; i++) {\n palmLandmarks.push(landmarks[PALM_LANDMARK_IDS[i]].slice(0, 2));\n }\n boxAroundHand.palmLandmarks = palmLandmarks;\n return boxAroundHand;\n }\n\n // Scale, rotate, and translate raw keypoints from the model so they map to\n // the input coordinates.\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize(box);\n const scaleFactor = [boxSize[0] / this.meshWidth, boxSize[1] / this.meshHeight];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.meshWidth / 2),\n scaleFactor[1] * (coord[1] - this.meshHeight / 2), coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...bounding.getBoxCenter(box), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n coord[0] + originalBoxCenter[0], coord[1] + originalBoxCenter[1],\n coord[2],\n ]);\n }\n\n async estimateHands(image, config) {\n this.skipFrames = config.skipFrames;\n this.detectionConfidence = config.minConfidence;\n this.maxHands = config.maxHands;\n this.runsWithoutHandDetector++;\n const useFreshBox = this.shouldUpdateRegionsOfInterest();\n if (useFreshBox === true) {\n const boundingBoxPredictions = await this.boundingBoxDetector.estimateHandBounds(image, config);\n this.regionsOfInterest = [];\n for (const i in boundingBoxPredictions) {\n this.updateRegionsOfInterest(boundingBoxPredictions[i], true /* force update */, i);\n }\n this.runsWithoutHandDetector = 0;\n }\n // Rotate input so the hand is vertically oriented.\n const hands = [];\n if (!this.regionsOfInterest) return hands;\n for (const i in this.regionsOfInterest) {\n const currentBox = this.regionsOfInterest[i][0];\n if (!currentBox) return hands;\n const angle = util.computeRotation(currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_PALM_BASE], currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE]);\n const palmCenter = bounding.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized);\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const box = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = bounding.cutBoxFromImageAndResize(box, rotatedImage, [this.meshWidth, this.meshHeight]);\n const handImage = croppedInput.div(255);\n croppedInput.dispose();\n rotatedImage.dispose();\n const prediction = this.meshDetector.predict(handImage);\n const [flag, keypoints] = prediction;\n handImage.dispose();\n const flagValue = flag.dataSync()[0];\n flag.dispose();\n if (flagValue < config.minConfidence) {\n keypoints.dispose();\n this.regionsOfInterest[i] = [];\n return hands;\n }\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = await keypointsReshaped.array();\n keypoints.dispose();\n keypointsReshaped.dispose();\n const coords = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.updateRegionsOfInterest(nextBoundingBox, false /* force replace */, i);\n const result = {\n landmarks: coords,\n confidence: flagValue,\n box: {\n topLeft: nextBoundingBox.startPoint,\n bottomRight: nextBoundingBox.endPoint,\n },\n };\n hands.push(result);\n }\n return hands;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n\n // Updates regions of interest if the intersection over union between\n // the incoming and previous regions falls below a threshold.\n updateRegionsOfInterest(box, forceUpdate, index) {\n if (forceUpdate) {\n this.regionsOfInterest[index] = [box];\n } else {\n const previousBox = this.regionsOfInterest[index][0];\n let iou = 0;\n if (previousBox != null && previousBox.startPoint != null) {\n const [boxStartX, boxStartY] = box.startPoint;\n const [boxEndX, boxEndY] = box.endPoint;\n const [previousBoxStartX, previousBoxStartY] = previousBox.startPoint;\n const [previousBoxEndX, previousBoxEndY] = previousBox.endPoint;\n const xStartMax = Math.max(boxStartX, previousBoxStartX);\n const yStartMax = Math.max(boxStartY, previousBoxStartY);\n const xEndMin = Math.min(boxEndX, previousBoxEndX);\n const yEndMin = Math.min(boxEndY, previousBoxEndY);\n const intersection = (xEndMin - xStartMax) * (yEndMin - yStartMax);\n const boxArea = (boxEndX - boxStartX) * (boxEndY - boxStartY);\n const previousBoxArea = (previousBoxEndX - previousBoxStartX) * (previousBoxEndY - boxStartY);\n iou = intersection / (boxArea + previousBoxArea - intersection);\n }\n this.regionsOfInterest[index][0] = iou > UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD ? previousBox : box;\n }\n }\n\n shouldUpdateRegionsOfInterest() {\n return !this.regionsOfInterest || (this.regionsOfInterest.length === 0) || (this.runsWithoutHandDetector >= this.skipFrames);\n }\n}\nexports.HandPipeline = HandPipeline;\n", "const tf = require('@tensorflow/tfjs');\nconst hand = require('./handdetector');\nconst keypoints = require('./keypoints');\nconst pipe = require('./pipeline');\n\nclass HandPose {\n constructor(pipeline) {\n this.pipeline = pipeline;\n }\n\n async estimateHands(input, config) {\n this.skipFrames = config.skipFrames;\n this.detectionConfidence = config.minConfidence;\n this.maxHands = config.maxHands;\n const predictions = await this.pipeline.estimateHands(input, config);\n const hands = [];\n if (!predictions) return hands;\n for (const prediction of predictions) {\n if (!prediction) return [];\n const annotations = {};\n for (const key of Object.keys(keypoints.MESH_ANNOTATIONS)) {\n annotations[key] = keypoints.MESH_ANNOTATIONS[key].map((index) => prediction.landmarks[index]);\n }\n hands.push({\n confidence: prediction.confidence || 0,\n box: prediction.box ? [prediction.box.topLeft[0], prediction.box.topLeft[1], prediction.box.bottomRight[0] - prediction.box.topLeft[0], prediction.box.bottomRight[1] - prediction.box.topLeft[1]] : 0,\n landmarks: prediction.landmarks,\n annotations,\n });\n }\n return hands;\n }\n}\nexports.HandPose = HandPose;\n\nasync function loadAnchors(url) {\n if (tf.env().features.IS_NODE) {\n // eslint-disable-next-line global-require\n const fs = require('fs');\n const data = await fs.readFileSync(url.replace('file://', ''));\n return JSON.parse(data);\n }\n return tf.util.fetch(url).then((d) => d.json());\n}\n\nasync function load(config) {\n const [anchors, handDetectorModel, handPoseModel] = await Promise.all([\n loadAnchors(config.detector.anchors),\n tf.loadGraphModel(config.detector.modelPath, { fromTFHub: config.detector.modelPath.includes('tfhub.dev') }),\n tf.loadGraphModel(config.skeleton.modelPath, { fromTFHub: config.skeleton.modelPath.includes('tfhub.dev') }),\n ]);\n const detector = new hand.HandDetector(handDetectorModel, anchors, config);\n const pipeline = new pipe.HandPipeline(detector, handPoseModel, config);\n const handpose = new HandPose(pipeline);\n return handpose;\n}\nexports.load = load;\n", "/* eslint-disable no-shadow */\n/* eslint-disable prefer-rest-params */\n/* eslint-disable no-sequences */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-use-before-define */\n/*\nWebGLImageFilter - MIT Licensed\n2013, Dominic Szablewski - phoboslab.org\n*/\n\nconst WebGLProgram = function (gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (gl, source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n throw new Error('Filter: GL compile failed', gl.getShaderInfoLog(shader));\n }\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n\n const _vsh = _compile(gl, vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(gl, fragmentSource, gl.FRAGMENT_SHADER);\n\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) {\n throw new Error('Filter: GL link failed', gl.getProgramInfoLog(this.id));\n }\n\n gl.useProgram(this.id);\n\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) {\n this.attribute[a] = gl.getAttribLocation(this.id, a);\n }\n\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) {\n this.uniform[u] = gl.getUniformLocation(this.id, u);\n }\n};\n\nconst WebGLImageFilter = function (params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _canvas = params.canvas || document.createElement('canvas');\n\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n\n const gl = _canvas.getContext('webgl') || _canvas.getContext('experimental-webgl');\n if (!gl) throw new Error('Filter: getContext() failed');\n\n this.addFilter = function (name) {\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n\n // No filters? Just draw\n if (_filterChain.length === 0) {\n const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n\n return _canvas;\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n\n _canvas.width = _width = width;\n _canvas.height = _height = height;\n\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n _vertexBuffer = gl.createBuffer(),\n gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n\n // Note sure if this is a good idea; at least it makes texture loading\n // in Ejecta instant.\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n\n gl.viewport(0, 0, _width, _height);\n\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index]\n || _createFramebufferTexture(_width, _height);\n\n return _tempFramebuffers[index];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n return { fbo, texture };\n };\n\n const _draw = function (flags) {\n let source = null;\n let target = null;\n let flipY = false;\n\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex).texture;\n }\n _drawCount++;\n\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex).fbo;\n }\n\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n\n // Compile shaders\n _currentProgram = new WebGLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n let DRAW = { INTERMEDIATE: 1 };\n\n let SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n\n let _filter = {};\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n\n const program = _compileShader(_filter.blur.SHADER);\n\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n\n const program = _compileShader(_filter.pixelate.SHADER);\n\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n};\n\nexports.Canvas = WebGLImageFilter;\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\nexport default {\n backend: 'webgl', // select tfjs backend to use\n console: true, // enable debugging output to console\n scoped: false, // enable scoped runs\n // some models *may* have memory leaks, this wrapps everything in a local scope at a cost of performance\n // typically not needed\n videoOptimized: true, // perform additional optimizations when input is video, must be disabled for images\n filter: {\n enabled: true, // enable image pre-processing filters\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models: detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: '../models/blazeface/back/model.json', // can be 'front' or 'back'.\n // 'front' is optimized for large faces such as front-facing camera and 'back' is optimized for distanct faces.\n inputSize: 256, // fixed value: 128 for front and 256 for 'back'\n maxFaces: 10, // maximum number of faces detected in the input, should be set to the minimum number for performance\n skipFrames: 10, // how many frames to go without re-running the face bounding box detector, only used for video inputs\n // if model is running st 25 FPS, we can re-use existing bounding box for updated face mesh analysis\n // as face probably hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.3, // threshold for deciding whether boxes overlap too much in non-maximum suppression\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n },\n mesh: {\n enabled: true,\n modelPath: '../models/facemesh/model.json',\n inputSize: 192, // fixed value\n },\n iris: {\n enabled: true,\n modelPath: '../models/iris/model.json',\n enlargeFactor: 2.3, // empiric tuning\n inputSize: 64, // fixed value\n },\n age: {\n enabled: true,\n modelPath: '../models/ssrnet-age/imdb/model.json', // can be 'imdb' or 'wiki'\n // which determines training set for model\n inputSize: 64, // fixed value\n skipFrames: 10, // how many frames to go without re-running the detector, only used for video inputs\n },\n gender: {\n enabled: true,\n minConfidence: 0.8, // threshold for discarding a prediction\n modelPath: '../models/ssrnet-gender/imdb/model.json',\n },\n emotion: {\n enabled: true,\n inputSize: 64, // fixed value\n minConfidence: 0.5, // threshold for discarding a prediction\n skipFrames: 10, // how many frames to go without re-running the detector\n modelPath: '../models/emotion/model.json',\n },\n },\n body: {\n enabled: true,\n modelPath: '../models/posenet/model.json',\n inputResolution: 257, // fixed value\n outputStride: 16, // fixed value\n maxDetections: 10, // maximum number of people detected in the input, should be set to the minimum number for performance\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n nmsRadius: 20, // radius for deciding points are too close in non-maximum suppression\n },\n hand: {\n enabled: true,\n inputSize: 256, // fixed value\n skipFrames: 10, // how many frames to go without re-running the hand bounding box detector, only used for video inputs\n // if model is running st 25 FPS, we can re-use existing bounding box for updated hand skeleton analysis\n // as the hand probably hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.3, // threshold for deciding whether boxes overlap too much in non-maximum suppression\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n enlargeFactor: 1.65, // empiric tuning as skeleton prediction prefers hand box with some whitespace\n maxHands: 10, // maximum number of hands detected in the input, should be set to the minimum number for performance\n detector: {\n anchors: '../models/handdetect/anchors.json',\n modelPath: '../models/handdetect/model.json',\n },\n skeleton: {\n modelPath: '../models/handskeleton/model.json',\n },\n },\n};\n", "const tf = require('@tensorflow/tfjs');\nconst facemesh = require('./facemesh/facemesh.js');\nconst ssrnet = require('./ssrnet/ssrnet.js');\nconst emotion = require('./emotion/emotion.js');\nconst posenet = require('./posenet/posenet.js');\nconst handpose = require('./handpose/handpose.js');\nconst fxImage = require('./imagefx.js');\nconst defaults = require('../config.js').default;\nconst app = require('../package.json');\n\nlet first = true;\n\n// static config override for non-video detection\nconst override = {\n face: { detector: { skipFrames: 0 }, age: { skipFrames: 0 }, emotion: { skipFrames: 0 } },\n hand: { skipFrames: 0 },\n};\n\n// helper function: gets elapsed time on both browser and nodejs\nconst now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt(Number(process.hrtime.bigint()) / 1000 / 1000);\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nfunction mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) {\n prev[key] = pVal.concat(...oVal);\n } else if (isObject(pVal) && isObject(oVal)) {\n prev[key] = mergeDeep(pVal, oVal);\n } else {\n prev[key] = oVal;\n }\n });\n return prev;\n }, {});\n}\n\nfunction sanity(input) {\n if (!input) return 'input is not defined';\n if (tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) {\n return 'input must be a tensor';\n }\n try {\n tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n}\n\nclass Human {\n constructor() {\n this.tf = tf;\n this.version = app.version;\n this.defaults = defaults;\n this.config = defaults;\n this.fx = (tf.ENV.flags.IS_BROWSER && (typeof document !== 'undefined')) ? new fxImage.Canvas() : null;\n this.state = 'idle';\n this.numTensors = 0;\n this.analyzeMemoryLeaks = false;\n // object that contains all initialized models\n this.models = {\n facemesh: null,\n posenet: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n };\n // export raw access to underlying models\n this.facemesh = facemesh;\n this.ssrnet = ssrnet;\n this.emotion = emotion;\n this.posenet = posenet;\n this.handpose = handpose;\n }\n\n // helper function: wrapper around console output\n log(...msg) {\n // eslint-disable-next-line no-console\n if (msg && this.config.console) console.log(...msg);\n }\n\n // helper function: measure tensor leak\n analyze(...msg) {\n if (!this.analyzeMemoryLeaks) return;\n const current = tf.engine().state.numTensors;\n const previous = this.numTensors;\n this.numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) this.log(...msg, leaked);\n }\n\n async load(userConfig) {\n if (userConfig) this.config = mergeDeep(defaults, userConfig);\n if (this.config.face.enabled && !this.models.facemesh) {\n this.log('Load model: Face');\n this.models.facemesh = await facemesh.load(this.config.face);\n }\n if (this.config.body.enabled && !this.models.posenet) {\n this.log('Load model: Body');\n this.models.posenet = await posenet.load(this.config.body);\n }\n if (this.config.hand.enabled && !this.models.handpose) {\n this.log('Load model: Hand');\n this.models.handpose = await handpose.load(this.config.hand);\n }\n if (this.config.face.enabled && this.config.face.age.enabled && !this.models.age) {\n this.log('Load model: Age');\n this.models.age = await ssrnet.loadAge(this.config);\n }\n if (this.config.face.enabled && this.config.face.gender.enabled && !this.models.gender) {\n this.log('Load model: Gender');\n this.models.gender = await ssrnet.loadGender(this.config);\n }\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) {\n this.log('Load model: Emotion');\n this.models.emotion = await emotion.load(this.config);\n }\n }\n\n tfImage(input) {\n // let imageData;\n let filtered;\n if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {\n const width = input.naturalWidth || input.videoWidth || input.width || (input.shape && (input.shape[1] > 0));\n const height = input.naturalHeight || input.videoHeight || input.height || (input.shape && (input.shape[2] > 0));\n const offscreenCanvas = new OffscreenCanvas(width, height);\n const ctx = offscreenCanvas.getContext('2d');\n if (input instanceof ImageData) ctx.putImageData(input, 0, 0);\n else ctx.drawImage(input, 0, 0, width, height, 0, 0, offscreenCanvas.width, offscreenCanvas.height);\n this.fx.reset();\n this.fx.addFilter('brightness', this.config.filter.brightness); // must have at least one filter enabled\n if (this.config.filter.contrast !== 0) this.fx.addFilter('contrast', this.config.filter.contrast);\n if (this.config.filter.sharpness !== 0) this.fx.addFilter('sharpen', this.config.filter.sharpness);\n if (this.config.filter.blur !== 0) this.fx.addFilter('blur', this.config.filter.blur);\n if (this.config.filter.saturation !== 0) this.fx.addFilter('saturation', this.config.filter.saturation);\n if (this.config.filter.hue !== 0) this.fx.addFilter('hue', this.config.filter.hue);\n if (this.config.filter.negative) this.fx.addFilter('negative');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.vintage) this.fx.addFilter('brownie');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.kodachrome) this.fx.addFilter('kodachrome');\n if (this.config.filter.technicolor) this.fx.addFilter('technicolor');\n if (this.config.filter.polaroid) this.fx.addFilter('polaroid');\n if (this.config.filter.pixelate !== 0) this.fx.addFilter('pixelate', this.config.filter.pixelate);\n filtered = this.fx.apply(offscreenCanvas);\n }\n let tensor;\n if (input instanceof tf.Tensor) {\n tensor = tf.clone(input);\n } else {\n const pixels = tf.browser.fromPixels(filtered || input);\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n return { tensor, canvas: this.config.filter.return ? filtered : null };\n }\n\n async detect(input, userConfig = {}) {\n this.state = 'config';\n const perf = {};\n let timeStamp;\n\n timeStamp = now();\n this.config = mergeDeep(defaults, userConfig);\n if (!this.config.videoOptimized) this.config = mergeDeep(this.config, override);\n perf.config = Math.trunc(now() - timeStamp);\n\n // sanity checks\n timeStamp = now();\n this.state = 'check';\n const error = sanity(input);\n if (error) {\n this.log(error, input);\n return { error };\n }\n perf.sanity = Math.trunc(now() - timeStamp);\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve) => {\n const timeStart = now();\n\n // configure backend\n timeStamp = now();\n if (tf.getBackend() !== this.config.backend) {\n this.state = 'backend';\n this.log('Human library setting backend:', this.config.backend);\n await tf.setBackend(this.config.backend);\n await tf.ready();\n }\n perf.backend = Math.trunc(now() - timeStamp);\n\n // check number of loaded models\n if (first) {\n this.log('Human library starting');\n this.log('Configuration:', this.config);\n this.log('Flags:', tf.ENV.flags);\n first = false;\n }\n\n // load models if enabled\n timeStamp = now();\n this.state = 'load';\n await this.load();\n perf.load = Math.trunc(now() - timeStamp);\n\n if (this.config.scoped) tf.engine().startScope();\n\n this.analyze('Start Detect:');\n\n timeStamp = now();\n const image = this.tfImage(input);\n perf.image = Math.trunc(now() - timeStamp);\n const imageTensor = image.tensor;\n\n // run posenet\n this.state = 'run:body';\n timeStamp = now();\n this.analyze('Start PoseNet');\n const poseRes = this.config.body.enabled ? await this.models.posenet.estimatePoses(imageTensor, this.config.body) : [];\n this.analyze('End PoseNet:');\n perf.body = Math.trunc(now() - timeStamp);\n\n // run handpose\n this.state = 'run:hand';\n timeStamp = now();\n this.analyze('Start HandPose:');\n const handRes = this.config.hand.enabled ? await this.models.handpose.estimateHands(imageTensor, this.config.hand) : [];\n this.analyze('End HandPose:');\n perf.hand = Math.trunc(now() - timeStamp);\n\n // run facemesh, includes blazeface and iris\n const faceRes = [];\n if (this.config.face.enabled) {\n this.state = 'run:face';\n timeStamp = now();\n this.analyze('Start FaceMesh:');\n const faces = await this.models.facemesh.estimateFaces(imageTensor, this.config.face);\n perf.face = Math.trunc(now() - timeStamp);\n for (const face of faces) {\n // is something went wrong, skip the face\n if (!face.image || face.image.isDisposedInternal) {\n this.log('face object is disposed:', face.image);\n continue;\n }\n // run ssr-net age & gender, inherits face from blazeface\n this.state = 'run:agegender';\n timeStamp = now();\n const ssrData = (this.config.face.age.enabled || this.config.face.gender.enabled) ? await ssrnet.predict(face.image, this.config) : {};\n perf.agegender = Math.trunc(now() - timeStamp);\n // run emotion, inherits face from blazeface\n this.state = 'run:emotion';\n timeStamp = now();\n const emotionData = this.config.face.emotion.enabled ? await emotion.predict(face.image, this.config) : {};\n perf.emotion = Math.trunc(now() - timeStamp);\n\n // dont need face anymore\n face.image.dispose();\n // calculate iris distance\n // iris: array[ bottom, left, top, right, center ]\n const iris = (face.annotations.leftEyeIris && face.annotations.rightEyeIris)\n ? Math.max(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0], face.annotations.rightEyeIris[3][0] - face.annotations.rightEyeIris[1][0])\n : 0;\n faceRes.push({\n confidence: face.confidence,\n box: face.box,\n mesh: face.mesh,\n annotations: face.annotations,\n age: ssrData.age,\n gender: ssrData.gender,\n agConfidence: ssrData.confidence,\n emotion: emotionData,\n iris: (iris !== 0) ? Math.trunc(100 * 11.7 /* human iris size in mm */ / iris) / 100 : 0,\n });\n this.analyze('End FaceMesh:');\n }\n }\n\n imageTensor.dispose();\n this.state = 'idle';\n\n if (this.config.scoped) tf.engine().endScope();\n this.analyze('End Scope:');\n\n perf.total = Math.trunc(now() - timeStart);\n resolve({ face: faceRes, body: poseRes, hand: handRes, performance: perf, canvas: image.canvas });\n });\n }\n}\n\nexport { Human as default };\n"],
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA,QAAM,MAAK;AAEX,QAAM,gBAAgB;AAEtB,2BAAyB;AACvB,UAAM,OAAO,CAAE,SAAS,CAAC,YAAY,IAAI,YAAY,IAAI,SAAS,CAAC,GAAG;AACtE,UAAM,UAAU;AAChB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,QAAQ;AACvC,YAAM,SAAS,KAAK,QAAQ;AAC5B,YAAM,WAAW,KAAK,MAAO,aAAY,SAAS,KAAK;AACvD,YAAM,WAAW,KAAK,MAAO,aAAY,SAAS,KAAK;AACvD,YAAM,aAAa,KAAK,QAAQ;AAChC,eAAS,QAAQ,GAAG,QAAQ,UAAU;AACpC,cAAM,UAAU,SAAU,SAAQ;AAClC,iBAAS,QAAQ,GAAG,QAAQ,UAAU;AACpC,gBAAM,UAAU,SAAU,SAAQ;AAClC,mBAAS,IAAI,GAAG,IAAI,YAAY;AAC9B,oBAAQ,KAAK,CAAC,SAAS;AAAA;AAAA;AAAA;AAAA;AAK/B,WAAO;AAAA;AAGT,QAAM,aAAa,CAAC;AAClB,QAAI,eAAe;AACnB,QAAI,WAAW;AACf,QAAI,SAAS;AAAA;AAGf,QAAM,YAAY,CAAC,mBAA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,QAAQ;AAAA,YACtB,SAAS;AAAA,YACT,MAAO,SAAS,IAAK,KAAK,MAAM,MAAM,OAAmC,QAAQ,MAAM;AAAA;AAEzF,eAAK,QAAQ;AAAA;AAAA;AAIjB,kBAAY;AACZ,WAAK,QAAQ;AAEb,UAAI,KAAK,OAAO;AAAQ,WAAG,SAAS;AACpC,WAAK,QAAQ;AAEb,WAAK,QAAQ,KAAK,MAAM,QAAQ;AAChC,cAAQ,CAAE,MAAM,SAAS,MAAM,SAAS,MAAM,SAAS,aAAa,MAAM,QAAQ,MAAM;AAAA;AAAA;AAAA;",
+ "sourcesContent": ["const tf = require('@tensorflow/tfjs');\n\nconst NUM_LANDMARKS = 6;\n\nfunction generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) {\n anchors.push([anchorX, anchorY]);\n }\n }\n }\n }\n return anchors;\n}\n\nconst disposeBox = (box) => {\n box.startEndTensor.dispose();\n box.startPoint.dispose();\n box.endPoint.dispose();\n};\n\nconst createBox = (startEndTensor) => ({\n startEndTensor,\n startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]),\n endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),\n});\n\nconst scaleBox = (box, factors) => {\n const starts = tf.mul(box.startPoint, factors);\n const ends = tf.mul(box.endPoint, factors);\n const newCoordinates = tf.concat2d([starts, ends], 1);\n return createBox(newCoordinates);\n};\n\nfunction decodeBounds(boxOutputs, anchors, inputSize) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nfunction scaleBoxFromPrediction(face, scaleFactor) {\n return tf.tidy(() => {\n const box = face['box'] ? face['box'] : face;\n return scaleBox(box, scaleFactor).startEndTensor.squeeze();\n });\n}\n\nclass BlazeFaceModel {\n constructor(model, config) {\n this.blazeFaceModel = model;\n this.width = config.detector.inputSize;\n this.height = config.detector.inputSize;\n this.maxFaces = config.detector.maxFaces;\n this.anchorsData = generateAnchors(config.detector.inputSize);\n this.anchors = tf.tensor2d(this.anchorsData);\n this.inputSize = tf.tensor1d([this.width, this.height]);\n this.iouThreshold = config.detector.iouThreshold;\n this.scaleFaces = 0.8;\n this.scoreThreshold = config.detector.scoreThreshold;\n }\n\n // toto blazeface leaks two tensors per run\n async getBoundingBoxes(inputImage) {\n // sanity check on input\n if ((!inputImage) || (inputImage.isDisposedInternal) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return null;\n const [detectedOutputs, boxes, scores] = tf.tidy(() => {\n const resizedImage = inputImage.resizeBilinear([this.width, this.height]);\n const normalizedImage = tf.mul(tf.sub(resizedImage.div(255), 0.5), 2);\n const batchedPrediction = this.blazeFaceModel.predict(normalizedImage);\n let prediction;\n // are we using tfhub or pinto converted model?\n if (Array.isArray(batchedPrediction)) {\n const sorted = batchedPrediction.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n prediction = concat.squeeze(0);\n } else {\n prediction = batchedPrediction.squeeze(); // when using tfhub model\n }\n const decodedBounds = decodeBounds(prediction, this.anchors, this.inputSize);\n const logits = tf.slice(prediction, [0, 0], [-1, 1]);\n const scoresOut = tf.sigmoid(logits).squeeze();\n return [prediction, decodedBounds, scoresOut];\n });\n const boxIndicesTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.maxFaces, this.iouThreshold, this.scoreThreshold);\n const boxIndices = await boxIndicesTensor.array();\n boxIndicesTensor.dispose();\n const boundingBoxesMap = boxIndices.map((boxIndex) => tf.slice(boxes, [boxIndex, 0], [1, -1]));\n const boundingBoxes = await Promise.all(boundingBoxesMap.map(async (boundingBox) => {\n const vals = await boundingBox.array();\n boundingBox.dispose();\n return vals;\n }));\n const annotatedBoxes = [];\n for (let i = 0; i < boundingBoxes.length; i++) {\n const boundingBox = boundingBoxes[i];\n const box = createBox(boundingBox);\n const boxIndex = boxIndices[i];\n const anchor = this.anchorsData[boxIndex];\n const sliced = tf.slice(detectedOutputs, [boxIndex, NUM_LANDMARKS - 1], [1, -1]);\n const squeezed = sliced.squeeze();\n const landmarks = squeezed.reshape([NUM_LANDMARKS, -1]);\n /*\n const landmarks = tf\n .slice(detectedOutputs, [boxIndex, NUM_LANDMARKS - 1], [1, -1])\n .squeeze()\n .reshape([NUM_LANDMARKS, -1]);\n */\n const probability = tf.slice(scores, [boxIndex], [1]);\n const annotatedBox = { box, landmarks, probability, anchor };\n annotatedBoxes.push(annotatedBox);\n sliced.dispose();\n squeezed.dispose();\n // landmarks.dispose();\n }\n detectedOutputs.dispose();\n boxes.dispose();\n scores.dispose();\n detectedOutputs.dispose();\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / this.width, inputImage.shape[1] / this.height],\n };\n }\n\n async estimateFaces(input) {\n const { boxes, scaleFactor } = await this.getBoundingBoxes(input);\n return Promise.all(boxes.map(async (face) => {\n const scaledBox = scaleBoxFromPrediction(face, scaleFactor);\n const [landmarkData, boxData, probabilityData] = await Promise.all([face.landmarks, scaledBox, face.probability].map(async (d) => d.array()));\n const anchor = face.anchor;\n const [scaleFactorX, scaleFactorY] = scaleFactor;\n const scaledLandmarks = landmarkData\n .map((landmark) => ([\n (landmark[0] + anchor[0]) * scaleFactorX,\n (landmark[1] + anchor[1]) * scaleFactorY,\n ]));\n const normalizedFace = {\n topLeft: boxData.slice(0, 2),\n bottomRight: boxData.slice(2),\n landmarks: scaledLandmarks,\n probability: probabilityData,\n };\n disposeBox(face.box);\n face.landmarks.dispose();\n face.probability.dispose();\n scaledBox.dispose();\n return normalizedFace;\n }));\n }\n}\n\nasync function load(config) {\n const blazeface = await tf.loadGraphModel(config.detector.modelPath, { fromTFHub: config.detector.modelPath.includes('tfhub.dev') });\n const model = new BlazeFaceModel(blazeface, config);\n return model;\n}\n\nexports.load = load;\nexports.BlazeFaceModel = BlazeFaceModel;\nexports.disposeBox = disposeBox;\n", "exports.MESH_ANNOTATIONS = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\nexports.MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n", "const tf = require('@tensorflow/tfjs');\n\nfunction scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n}\nexports.scaleBoxCoordinates = scaleBoxCoordinates;\nfunction getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\nexports.getBoxSize = getBoxSize;\nfunction getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\nexports.getBoxCenter = getBoxCenter;\nfunction cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\nexports.cutBoxFromImageAndResize = cutBoxFromImageAndResize;\nfunction enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\nexports.enlargeBox = enlargeBox;\nfunction squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\nexports.squarifyBox = squarifyBox;\n", "exports.IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n/**\n * Normalizes the provided angle to the range -pi to pi.\n * @param angle The angle in radians to be normalized.\n */\nfunction normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\nexports.normalizeRadians = normalizeRadians;\n/**\n * Computes the angle of rotation between two anchor points.\n * @param point1 First anchor point\n * @param point2 Second anchor point\n */\nfunction computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\nexports.computeRotation = computeRotation;\nfunction radToDegrees(rad) {\n return rad * 180 / Math.PI;\n}\nexports.radToDegrees = radToDegrees;\nfunction buildTranslationMatrix(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n}\nfunction dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\nexports.dot = dot;\nfunction getColumnFrom2DArr(arr, columnIndex) {\n const column = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\nexports.getColumnFrom2DArr = getColumnFrom2DArr;\nfunction multiplyTransformMatrices(mat1, mat2) {\n const product = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\nfunction buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\nexports.buildRotationMatrix = buildRotationMatrix;\nfunction invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\nexports.invertTransformMatrix = invertTransformMatrix;\nfunction rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\nexports.rotatePoint = rotatePoint;\nfunction xyDistanceBetweenPoints(a, b) {\n return Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n}\nexports.xyDistanceBetweenPoints = xyDistanceBetweenPoints;\n", "/* eslint-disable class-methods-use-this */\nconst tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\nconst keypoints = require('./keypoints');\nconst util = require('./util');\n\nconst LANDMARKS_COUNT = 468;\nconst UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD = 0.25;\nconst MESH_MOUTH_INDEX = 13;\nconst MESH_KEYPOINTS_LINE_OF_SYMMETRY_INDICES = [MESH_MOUTH_INDEX, keypoints.MESH_ANNOTATIONS['midwayBetweenEyes'][0]];\nconst BLAZEFACE_MOUTH_INDEX = 3;\nconst BLAZEFACE_NOSE_INDEX = 2;\nconst BLAZEFACE_KEYPOINTS_LINE_OF_SYMMETRY_INDICES = [BLAZEFACE_MOUTH_INDEX, BLAZEFACE_NOSE_INDEX];\nconst LEFT_EYE_OUTLINE = keypoints.MESH_ANNOTATIONS['leftEyeLower0'];\nconst LEFT_EYE_BOUNDS = [LEFT_EYE_OUTLINE[0], LEFT_EYE_OUTLINE[LEFT_EYE_OUTLINE.length - 1]];\nconst RIGHT_EYE_OUTLINE = keypoints.MESH_ANNOTATIONS['rightEyeLower0'];\nconst RIGHT_EYE_BOUNDS = [RIGHT_EYE_OUTLINE[0], RIGHT_EYE_OUTLINE[RIGHT_EYE_OUTLINE.length - 1]];\nconst IRIS_UPPER_CENTER_INDEX = 3;\nconst IRIS_LOWER_CENTER_INDEX = 4;\nconst IRIS_IRIS_INDEX = 71;\nconst IRIS_NUM_COORDINATES = 76;\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates. Update the z coordinate to be an average of the original and the new. This produces the best visual effect.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < keypoints.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = keypoints.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = keypoints.MESH_ANNOTATIONS[`${prefix}${key}`];\n const shouldReplaceAllKeys = keys == null;\n if (shouldReplaceAllKeys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n// The Pipeline coordinates between the bounding box and skeleton models.\nclass Pipeline {\n constructor(boundingBoxDetector, meshDetector, irisModel, config) {\n // An array of facial bounding boxes.\n this.regionsOfInterest = [];\n this.runsWithoutFaceDetector = 0;\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.irisModel = irisModel;\n this.meshWidth = config.mesh.inputSize;\n this.meshHeight = config.mesh.inputSize;\n this.irisSize = config.iris.inputSize;\n this.irisEnlarge = config.iris.enlargeFactor;\n }\n\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const scaleFactor = [boxSize[0] / this.meshWidth, boxSize[1] / this.meshHeight];\n const coordsScaled = rawCoords.map((coord) => ([\n scaleFactor[0] * (coord[0] - this.meshWidth / 2),\n scaleFactor[1] * (coord[1] - this.meshHeight / 2), coord[2],\n ]));\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => ([...util.rotatePoint(coord, coordsRotationMatrix), coord[2]]));\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => ([\n coord[0] + originalBoxCenter[0],\n coord[1] + originalBoxCenter[1], coord[2],\n ]));\n }\n\n getLeftToRightEyeDepthDifference(rawCoords) {\n const leftEyeZ = rawCoords[LEFT_EYE_BOUNDS[0]][2];\n const rightEyeZ = rawCoords[RIGHT_EYE_BOUNDS[0]][2];\n return leftEyeZ - rightEyeZ;\n }\n\n // Returns a box describing a cropped region around the eye fit for passing to the iris model.\n getEyeBox(rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false) {\n const box = bounding.squarifyBox(bounding.enlargeBox(this.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), this.irisEnlarge));\n const boxSize = bounding.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / this.meshHeight,\n box.startPoint[0] / this.meshWidth, box.endPoint[1] / this.meshHeight,\n box.endPoint[0] / this.meshWidth,\n ]], [0], [this.irisSize, this.irisSize]);\n if (flip) {\n crop = tf.image.flipLeftRight(crop);\n }\n return { box, boxSize, crop };\n }\n\n // Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\n getEyeCoords(eyeData, eyeBox, eyeBoxSize, flip = false) {\n const eyeRawCoords = [];\n for (let i = 0; i < IRIS_NUM_COORDINATES; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip\n ? (1 - (x / this.irisSize))\n : (x / this.irisSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / this.irisSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(IRIS_IRIS_INDEX) };\n }\n\n // The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n getAdjustedIrisCoords(rawCoords, irisCoords, direction) {\n const upperCenterZ = rawCoords[keypoints.MESH_ANNOTATIONS[`${direction}EyeUpper0`][IRIS_UPPER_CENTER_INDEX]][2];\n const lowerCenterZ = rawCoords[keypoints.MESH_ANNOTATIONS[`${direction}EyeLower0`][IRIS_LOWER_CENTER_INDEX]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n }\n\n async predict(input, config) {\n this.skipFrames = config.detector.skipFrames;\n this.maxFaces = config.detector.maxFaces;\n this.runsWithoutFaceDetector++;\n if (this.shouldUpdateRegionsOfInterest()) {\n const detector = await this.boundingBoxDetector.getBoundingBoxes(input);\n if (detector.boxes.length === 0) {\n this.regionsOfInterest = [];\n return null;\n }\n const scaledBoxes = detector.boxes.map((prediction) => {\n const startPoint = prediction.box.startPoint.squeeze();\n const endPoint = prediction.box.endPoint.squeeze();\n const predictionBox = {\n startPoint: startPoint.arraySync(),\n endPoint: endPoint.arraySync(),\n };\n startPoint.dispose();\n endPoint.dispose();\n const scaledBox = bounding.scaleBoxCoordinates(predictionBox, detector.scaleFactor);\n const enlargedBox = bounding.enlargeBox(scaledBox);\n const landmarks = prediction.landmarks.arraySync();\n prediction.box.startPoint.dispose();\n prediction.box.endPoint.dispose();\n prediction.landmarks.dispose();\n prediction.probability.dispose();\n return { ...enlargedBox, landmarks };\n });\n this.updateRegionsOfInterest(scaledBoxes);\n this.runsWithoutFaceDetector = 0;\n }\n const results = tf.tidy(() => this.regionsOfInterest.map((box, i) => {\n let angle = 0;\n // The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).\n const boxLandmarksFromMeshModel = box.landmarks.length >= LANDMARKS_COUNT;\n let [indexOfMouth, indexOfForehead] = MESH_KEYPOINTS_LINE_OF_SYMMETRY_INDICES;\n if (boxLandmarksFromMeshModel === false) {\n [indexOfMouth, indexOfForehead] = BLAZEFACE_KEYPOINTS_LINE_OF_SYMMETRY_INDICES;\n }\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n let rotatedImage = input;\n let rotationMatrix = util.IDENTITY_MATRIX;\n if (angle !== 0) {\n rotatedImage = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized);\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n }\n const boxCPU = { startPoint: box.startPoint, endPoint: box.endPoint };\n const face = bounding.cutBoxFromImageAndResize(boxCPU, rotatedImage, [this.meshHeight, this.meshWidth]).div(255);\n // The first returned tensor represents facial contours, which are included in the coordinates.\n const [, flag, coords] = this.meshDetector.predict(face);\n const coordsReshaped = tf.reshape(coords, [-1, 3]);\n let rawCoords = coordsReshaped.arraySync();\n if (config.iris.enabled) {\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = this.getEyeBox(rawCoords, face, LEFT_EYE_BOUNDS[0], LEFT_EYE_BOUNDS[1], true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = this.getEyeBox(rawCoords, face, RIGHT_EYE_BOUNDS[0], RIGHT_EYE_BOUNDS[1]);\n const eyePredictions = (this.irisModel.predict(tf.concat([leftEyeCrop, rightEyeCrop])));\n const eyePredictionsData = eyePredictions.dataSync();\n eyePredictions.dispose();\n const leftEyeData = eyePredictionsData.slice(0, IRIS_NUM_COORDINATES * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = this.getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(IRIS_NUM_COORDINATES * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = this.getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = this.getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left');\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right');\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged. So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = this.getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = this.getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n rawCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n }\n const transformedCoordsData = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n tf.dispose(rawCoords);\n const landmarksBox = bounding.enlargeBox(this.calculateLandmarksBoundingBox(transformedCoordsData));\n const confidence = flag.squeeze();\n tf.dispose(flag);\n if (config.mesh.enabled) {\n const transformedCoords = tf.tensor2d(transformedCoordsData);\n this.regionsOfInterest[i] = { ...landmarksBox, landmarks: transformedCoords.arraySync() };\n const prediction = {\n coords: transformedCoords,\n box: landmarksBox,\n confidence,\n image: face,\n };\n return prediction;\n }\n const prediction = {\n coords: null,\n box: landmarksBox,\n confidence,\n image: face,\n };\n return prediction;\n }));\n return results;\n }\n\n // Updates regions of interest if the intersection over union between the incoming and previous regions falls below a threshold.\n updateRegionsOfInterest(boxes) {\n for (let i = 0; i < boxes.length; i++) {\n const box = boxes[i];\n const previousBox = this.regionsOfInterest[i];\n let iou = 0;\n if (previousBox && previousBox.startPoint) {\n const [boxStartX, boxStartY] = box.startPoint;\n const [boxEndX, boxEndY] = box.endPoint;\n const [previousBoxStartX, previousBoxStartY] = previousBox.startPoint;\n const [previousBoxEndX, previousBoxEndY] = previousBox.endPoint;\n const xStartMax = Math.max(boxStartX, previousBoxStartX);\n const yStartMax = Math.max(boxStartY, previousBoxStartY);\n const xEndMin = Math.min(boxEndX, previousBoxEndX);\n const yEndMin = Math.min(boxEndY, previousBoxEndY);\n const intersection = (xEndMin - xStartMax) * (yEndMin - yStartMax);\n const boxArea = (boxEndX - boxStartX) * (boxEndY - boxStartY);\n const previousBoxArea = (previousBoxEndX - previousBoxStartX) * (previousBoxEndY - boxStartY);\n iou = intersection / (boxArea + previousBoxArea - intersection);\n }\n if (iou < UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD) {\n this.regionsOfInterest[i] = box;\n }\n }\n this.regionsOfInterest = this.regionsOfInterest.slice(0, boxes.length);\n }\n\n clearRegionOfInterest(index) {\n if (this.regionsOfInterest[index] != null) {\n this.regionsOfInterest = [\n ...this.regionsOfInterest.slice(0, index),\n ...this.regionsOfInterest.slice(index + 1),\n ];\n }\n }\n\n shouldUpdateRegionsOfInterest() {\n if (this.regionsOfInterest.length === 0) return true; // nothing detected, so run detector on the next frame\n return (this.regionsOfInterest.length !== this.maxFaces) && (this.runsWithoutFaceDetector >= this.skipFrames);\n }\n\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint, landmarks };\n }\n}\nexports.Pipeline = Pipeline;\n", "exports.UV_COORDS = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n", "export default [\n 127, 34, 139, 11, 0, 37, 232, 231, 120, 72, 37, 39, 128, 121, 47, 232, 121,\n 128, 104, 69, 67, 175, 171, 148, 157, 154, 155, 118, 50, 101, 73, 39, 40, 9,\n 151, 108, 48, 115, 131, 194, 204, 211, 74, 40, 185, 80, 42, 183, 40, 92,\n 186, 230, 229, 118, 202, 212, 214, 83, 18, 17, 76, 61, 146, 160, 29, 30, 56,\n 157, 173, 106, 204, 194, 135, 214, 192, 203, 165, 98, 21, 71, 68, 51, 45, 4,\n 144, 24, 23, 77, 146, 91, 205, 50, 187, 201, 200, 18, 91, 106, 182, 90, 91,\n 181, 85, 84, 17, 206, 203, 36, 148, 171, 140, 92, 40, 39, 193, 189, 244,\n 159, 158, 28, 247, 246, 161, 236, 3, 196, 54, 68, 104, 193, 168, 8, 117,\n 228, 31, 189, 193, 55, 98, 97, 99, 126, 47, 100, 166, 79, 218, 155, 154, 26,\n 209, 49, 131, 135, 136, 150, 47, 126, 217, 223, 52, 53, 45, 51, 134, 211,\n 170, 140, 67, 69, 108, 43, 106, 91, 230, 119, 120, 226, 130, 247, 63, 53,\n 52, 238, 20, 242, 46, 70, 156, 78, 62, 96, 46, 53, 63, 143, 34, 227, 173,\n 155, 133, 123, 117, 111, 44, 125, 19, 236, 134, 51, 216, 206, 205, 154, 153,\n 22, 39, 37, 167, 200, 201, 208, 36, 142, 100, 57, 212, 202, 20, 60, 99, 28,\n 158, 157, 35, 226, 113, 160, 159, 27, 204, 202, 210, 113, 225, 46, 43, 202,\n 204, 62, 76, 77, 137, 123, 116, 41, 38, 72, 203, 129, 142, 64, 98, 240, 49,\n 102, 64, 41, 73, 74, 212, 216, 207, 42, 74, 184, 169, 170, 211, 170, 149,\n 176, 105, 66, 69, 122, 6, 168, 123, 147, 187, 96, 77, 90, 65, 55, 107, 89,\n 90, 180, 101, 100, 120, 63, 105, 104, 93, 137, 227, 15, 86, 85, 129, 102,\n 49, 14, 87, 86, 55, 8, 9, 100, 47, 121, 145, 23, 22, 88, 89, 179, 6, 122,\n 196, 88, 95, 96, 138, 172, 136, 215, 58, 172, 115, 48, 219, 42, 80, 81, 195,\n 3, 51, 43, 146, 61, 171, 175, 199, 81, 82, 38, 53, 46, 225, 144, 163, 110,\n 246, 33, 7, 52, 65, 66, 229, 228, 117, 34, 127, 234, 107, 108, 69, 109, 108,\n 151, 48, 64, 235, 62, 78, 191, 129, 209, 126, 111, 35, 143, 163, 161, 246,\n 117, 123, 50, 222, 65, 52, 19, 125, 141, 221, 55, 65, 3, 195, 197, 25, 7,\n 33, 220, 237, 44, 70, 71, 139, 122, 193, 245, 247, 130, 33, 71, 21, 162,\n 153, 158, 159, 170, 169, 150, 188, 174, 196, 216, 186, 92, 144, 160, 161, 2,\n 97, 167, 141, 125, 241, 164, 167, 37, 72, 38, 12, 145, 159, 160, 38, 82, 13,\n 63, 68, 71, 226, 35, 111, 158, 153, 154, 101, 50, 205, 206, 92, 165, 209,\n 198, 217, 165, 167, 97, 220, 115, 218, 133, 112, 243, 239, 238, 241, 214,\n 135, 169, 190, 173, 133, 171, 208, 32, 125, 44, 237, 86, 87, 178, 85, 86,\n 179, 84, 85, 180, 83, 84, 181, 201, 83, 182, 137, 93, 132, 76, 62, 183, 61,\n 76, 184, 57, 61, 185, 212, 57, 186, 214, 207, 187, 34, 143, 156, 79, 239,\n 237, 123, 137, 177, 44, 1, 4, 201, 194, 32, 64, 102, 129, 213, 215, 138, 59,\n 166, 219, 242, 99, 97, 2, 94, 141, 75, 59, 235, 24, 110, 228, 25, 130, 226,\n 23, 24, 229, 22, 23, 230, 26, 22, 231, 112, 26, 232, 189, 190, 243, 221, 56,\n 190, 28, 56, 221, 27, 28, 222, 29, 27, 223, 30, 29, 224, 247, 30, 225, 238,\n 79, 20, 166, 59, 75, 60, 75, 240, 147, 177, 215, 20, 79, 166, 187, 147, 213,\n 112, 233, 244, 233, 128, 245, 128, 114, 188, 114, 217, 174, 131, 115, 220,\n 217, 198, 236, 198, 131, 134, 177, 132, 58, 143, 35, 124, 110, 163, 7, 228,\n 110, 25, 356, 389, 368, 11, 302, 267, 452, 350, 349, 302, 303, 269, 357,\n 343, 277, 452, 453, 357, 333, 332, 297, 175, 152, 377, 384, 398, 382, 347,\n 348, 330, 303, 304, 270, 9, 336, 337, 278, 279, 360, 418, 262, 431, 304,\n 408, 409, 310, 415, 407, 270, 409, 410, 450, 348, 347, 422, 430, 434, 313,\n 314, 17, 306, 307, 375, 387, 388, 260, 286, 414, 398, 335, 406, 418, 364,\n 367, 416, 423, 358, 327, 251, 284, 298, 281, 5, 4, 373, 374, 253, 307, 320,\n 321, 425, 427, 411, 421, 313, 18, 321, 405, 406, 320, 404, 405, 315, 16, 17,\n 426, 425, 266, 377, 400, 369, 322, 391, 269, 417, 465, 464, 386, 257, 258,\n 466, 260, 388, 456, 399, 419, 284, 332, 333, 417, 285, 8, 346, 340, 261,\n 413, 441, 285, 327, 460, 328, 355, 371, 329, 392, 439, 438, 382, 341, 256,\n 429, 420, 360, 364, 394, 379, 277, 343, 437, 443, 444, 283, 275, 440, 363,\n 431, 262, 369, 297, 338, 337, 273, 375, 321, 450, 451, 349, 446, 342, 467,\n 293, 334, 282, 458, 461, 462, 276, 353, 383, 308, 324, 325, 276, 300, 293,\n 372, 345, 447, 382, 398, 362, 352, 345, 340, 274, 1, 19, 456, 248, 281, 436,\n 427, 425, 381, 256, 252, 269, 391, 393, 200, 199, 428, 266, 330, 329, 287,\n 273, 422, 250, 462, 328, 258, 286, 384, 265, 353, 342, 387, 259, 257, 424,\n 431, 430, 342, 353, 276, 273, 335, 424, 292, 325, 307, 366, 447, 345, 271,\n 303, 302, 423, 266, 371, 294, 455, 460, 279, 278, 294, 271, 272, 304, 432,\n 434, 427, 272, 407, 408, 394, 430, 431, 395, 369, 400, 334, 333, 299, 351,\n 417, 168, 352, 280, 411, 325, 319, 320, 295, 296, 336, 319, 403, 404, 330,\n 348, 349, 293, 298, 333, 323, 454, 447, 15, 16, 315, 358, 429, 279, 14, 15,\n 316, 285, 336, 9, 329, 349, 350, 374, 380, 252, 318, 402, 403, 6, 197, 419,\n 318, 319, 325, 367, 364, 365, 435, 367, 397, 344, 438, 439, 272, 271, 311,\n 195, 5, 281, 273, 287, 291, 396, 428, 199, 311, 271, 268, 283, 444, 445,\n 373, 254, 339, 263, 466, 249, 282, 334, 296, 449, 347, 346, 264, 447, 454,\n 336, 296, 299, 338, 10, 151, 278, 439, 455, 292, 407, 415, 358, 371, 355,\n 340, 345, 372, 390, 249, 466, 346, 347, 280, 442, 443, 282, 19, 94, 370,\n 441, 442, 295, 248, 419, 197, 263, 255, 359, 440, 275, 274, 300, 383, 368,\n 351, 412, 465, 263, 467, 466, 301, 368, 389, 380, 374, 386, 395, 378, 379,\n 412, 351, 419, 436, 426, 322, 373, 390, 388, 2, 164, 393, 370, 462, 461,\n 164, 0, 267, 302, 11, 12, 374, 373, 387, 268, 12, 13, 293, 300, 301, 446,\n 261, 340, 385, 384, 381, 330, 266, 425, 426, 423, 391, 429, 355, 437, 391,\n 327, 326, 440, 457, 438, 341, 382, 362, 459, 457, 461, 434, 430, 394, 414,\n 463, 362, 396, 369, 262, 354, 461, 457, 316, 403, 402, 315, 404, 403, 314,\n 405, 404, 313, 406, 405, 421, 418, 406, 366, 401, 361, 306, 408, 407, 291,\n 409, 408, 287, 410, 409, 432, 436, 410, 434, 416, 411, 264, 368, 383, 309,\n 438, 457, 352, 376, 401, 274, 275, 4, 421, 428, 262, 294, 327, 358, 433,\n 416, 367, 289, 455, 439, 462, 370, 326, 2, 326, 370, 305, 460, 455, 254,\n 449, 448, 255, 261, 446, 253, 450, 449, 252, 451, 450, 256, 452, 451, 341,\n 453, 452, 413, 464, 463, 441, 413, 414, 258, 442, 441, 257, 443, 442, 259,\n 444, 443, 260, 445, 444, 467, 342, 445, 459, 458, 250, 289, 392, 290, 290,\n 328, 460, 376, 433, 435, 250, 290, 392, 411, 416, 433, 341, 463, 464, 453,\n 464, 465, 357, 465, 412, 343, 412, 399, 360, 363, 440, 437, 399, 456, 420,\n 456, 363, 401, 435, 288, 372, 383, 353, 339, 255, 249, 448, 261, 255, 133,\n 243, 190, 133, 155, 112, 33, 246, 247, 33, 130, 25, 398, 384, 286, 362, 398,\n 414, 362, 463, 341, 263, 359, 467, 263, 249, 255, 466, 467, 260, 75, 60,\n 166, 238, 239, 79, 162, 127, 139, 72, 11, 37, 121, 232, 120, 73, 72, 39,\n 114, 128, 47, 233, 232, 128, 103, 104, 67, 152, 175, 148, 173, 157, 155,\n 119, 118, 101, 74, 73, 40, 107, 9, 108, 49, 48, 131, 32, 194, 211, 184, 74,\n 185, 191, 80, 183, 185, 40, 186, 119, 230, 118, 210, 202, 214, 84, 83, 17,\n 77, 76, 146, 161, 160, 30, 190, 56, 173, 182, 106, 194, 138, 135, 192, 129,\n 203, 98, 54, 21, 68, 5, 51, 4, 145, 144, 23, 90, 77, 91, 207, 205, 187, 83,\n 201, 18, 181, 91, 182, 180, 90, 181, 16, 85, 17, 205, 206, 36, 176, 148,\n 140, 165, 92, 39, 245, 193, 244, 27, 159, 28, 30, 247, 161, 174, 236, 196,\n 103, 54, 104, 55, 193, 8, 111, 117, 31, 221, 189, 55, 240, 98, 99, 142, 126,\n 100, 219, 166, 218, 112, 155, 26, 198, 209, 131, 169, 135, 150, 114, 47,\n 217, 224, 223, 53, 220, 45, 134, 32, 211, 140, 109, 67, 108, 146, 43, 91,\n 231, 230, 120, 113, 226, 247, 105, 63, 52, 241, 238, 242, 124, 46, 156, 95,\n 78, 96, 70, 46, 63, 116, 143, 227, 116, 123, 111, 1, 44, 19, 3, 236, 51,\n 207, 216, 205, 26, 154, 22, 165, 39, 167, 199, 200, 208, 101, 36, 100, 43,\n 57, 202, 242, 20, 99, 56, 28, 157, 124, 35, 113, 29, 160, 27, 211, 204, 210,\n 124, 113, 46, 106, 43, 204, 96, 62, 77, 227, 137, 116, 73, 41, 72, 36, 203,\n 142, 235, 64, 240, 48, 49, 64, 42, 41, 74, 214, 212, 207, 183, 42, 184, 210,\n 169, 211, 140, 170, 176, 104, 105, 69, 193, 122, 168, 50, 123, 187, 89, 96,\n 90, 66, 65, 107, 179, 89, 180, 119, 101, 120, 68, 63, 104, 234, 93, 227, 16,\n 15, 85, 209, 129, 49, 15, 14, 86, 107, 55, 9, 120, 100, 121, 153, 145, 22,\n 178, 88, 179, 197, 6, 196, 89, 88, 96, 135, 138, 136, 138, 215, 172, 218,\n 115, 219, 41, 42, 81, 5, 195, 51, 57, 43, 61, 208, 171, 199, 41, 81, 38,\n 224, 53, 225, 24, 144, 110, 105, 52, 66, 118, 229, 117, 227, 34, 234, 66,\n 107, 69, 10, 109, 151, 219, 48, 235, 183, 62, 191, 142, 129, 126, 116, 111,\n 143, 7, 163, 246, 118, 117, 50, 223, 222, 52, 94, 19, 141, 222, 221, 65,\n 196, 3, 197, 45, 220, 44, 156, 70, 139, 188, 122, 245, 139, 71, 162, 145,\n 153, 159, 149, 170, 150, 122, 188, 196, 206, 216, 92, 163, 144, 161, 164, 2,\n 167, 242, 141, 241, 0, 164, 37, 11, 72, 12, 144, 145, 160, 12, 38, 13, 70,\n 63, 71, 31, 226, 111, 157, 158, 154, 36, 101, 205, 203, 206, 165, 126, 209,\n 217, 98, 165, 97, 237, 220, 218, 237, 239, 241, 210, 214, 169, 140, 171, 32,\n 241, 125, 237, 179, 86, 178, 180, 85, 179, 181, 84, 180, 182, 83, 181, 194,\n 201, 182, 177, 137, 132, 184, 76, 183, 185, 61, 184, 186, 57, 185, 216, 212,\n 186, 192, 214, 187, 139, 34, 156, 218, 79, 237, 147, 123, 177, 45, 44, 4,\n 208, 201, 32, 98, 64, 129, 192, 213, 138, 235, 59, 219, 141, 242, 97, 97, 2,\n 141, 240, 75, 235, 229, 24, 228, 31, 25, 226, 230, 23, 229, 231, 22, 230,\n 232, 26, 231, 233, 112, 232, 244, 189, 243, 189, 221, 190, 222, 28, 221,\n 223, 27, 222, 224, 29, 223, 225, 30, 224, 113, 247, 225, 99, 60, 240, 213,\n 147, 215, 60, 20, 166, 192, 187, 213, 243, 112, 244, 244, 233, 245, 245,\n 128, 188, 188, 114, 174, 134, 131, 220, 174, 217, 236, 236, 198, 134, 215,\n 177, 58, 156, 143, 124, 25, 110, 7, 31, 228, 25, 264, 356, 368, 0, 11, 267,\n 451, 452, 349, 267, 302, 269, 350, 357, 277, 350, 452, 357, 299, 333, 297,\n 396, 175, 377, 381, 384, 382, 280, 347, 330, 269, 303, 270, 151, 9, 337,\n 344, 278, 360, 424, 418, 431, 270, 304, 409, 272, 310, 407, 322, 270, 410,\n 449, 450, 347, 432, 422, 434, 18, 313, 17, 291, 306, 375, 259, 387, 260,\n 424, 335, 418, 434, 364, 416, 391, 423, 327, 301, 251, 298, 275, 281, 4,\n 254, 373, 253, 375, 307, 321, 280, 425, 411, 200, 421, 18, 335, 321, 406,\n 321, 320, 405, 314, 315, 17, 423, 426, 266, 396, 377, 369, 270, 322, 269,\n 413, 417, 464, 385, 386, 258, 248, 456, 419, 298, 284, 333, 168, 417, 8,\n 448, 346, 261, 417, 413, 285, 326, 327, 328, 277, 355, 329, 309, 392, 438,\n 381, 382, 256, 279, 429, 360, 365, 364, 379, 355, 277, 437, 282, 443, 283,\n 281, 275, 363, 395, 431, 369, 299, 297, 337, 335, 273, 321, 348, 450, 349,\n 359, 446, 467, 283, 293, 282, 250, 458, 462, 300, 276, 383, 292, 308, 325,\n 283, 276, 293, 264, 372, 447, 346, 352, 340, 354, 274, 19, 363, 456, 281,\n 426, 436, 425, 380, 381, 252, 267, 269, 393, 421, 200, 428, 371, 266, 329,\n 432, 287, 422, 290, 250, 328, 385, 258, 384, 446, 265, 342, 386, 387, 257,\n 422, 424, 430, 445, 342, 276, 422, 273, 424, 306, 292, 307, 352, 366, 345,\n 268, 271, 302, 358, 423, 371, 327, 294, 460, 331, 279, 294, 303, 271, 304,\n 436, 432, 427, 304, 272, 408, 395, 394, 431, 378, 395, 400, 296, 334, 299,\n 6, 351, 168, 376, 352, 411, 307, 325, 320, 285, 295, 336, 320, 319, 404,\n 329, 330, 349, 334, 293, 333, 366, 323, 447, 316, 15, 315, 331, 358, 279,\n 317, 14, 316, 8, 285, 9, 277, 329, 350, 253, 374, 252, 319, 318, 403, 351,\n 6, 419, 324, 318, 325, 397, 367, 365, 288, 435, 397, 278, 344, 439, 310,\n 272, 311, 248, 195, 281, 375, 273, 291, 175, 396, 199, 312, 311, 268, 276,\n 283, 445, 390, 373, 339, 295, 282, 296, 448, 449, 346, 356, 264, 454, 337,\n 336, 299, 337, 338, 151, 294, 278, 455, 308, 292, 415, 429, 358, 355, 265,\n 340, 372, 388, 390, 466, 352, 346, 280, 295, 442, 282, 354, 19, 370, 285,\n 441, 295, 195, 248, 197, 457, 440, 274, 301, 300, 368, 417, 351, 465, 251,\n 301, 389, 385, 380, 386, 394, 395, 379, 399, 412, 419, 410, 436, 322, 387,\n 373, 388, 326, 2, 393, 354, 370, 461, 393, 164, 267, 268, 302, 12, 386, 374,\n 387, 312, 268, 13, 298, 293, 301, 265, 446, 340, 380, 385, 381, 280, 330,\n 425, 322, 426, 391, 420, 429, 437, 393, 391, 326, 344, 440, 438, 458, 459,\n 461, 364, 434, 394, 428, 396, 262, 274, 354, 457, 317, 316, 402, 316, 315,\n 403, 315, 314, 404, 314, 313, 405, 313, 421, 406, 323, 366, 361, 292, 306,\n 407, 306, 291, 408, 291, 287, 409, 287, 432, 410, 427, 434, 411, 372, 264,\n 383, 459, 309, 457, 366, 352, 401, 1, 274, 4, 418, 421, 262, 331, 294, 358,\n 435, 433, 367, 392, 289, 439, 328, 462, 326, 94, 2, 370, 289, 305, 455, 339,\n 254, 448, 359, 255, 446, 254, 253, 449, 253, 252, 450, 252, 256, 451, 256,\n 341, 452, 414, 413, 463, 286, 441, 414, 286, 258, 441, 258, 257, 442, 257,\n 259, 443, 259, 260, 444, 260, 467, 445, 309, 459, 250, 305, 289, 290, 305,\n 290, 460, 401, 376, 435, 309, 250, 392, 376, 411, 433, 453, 341, 464, 357,\n 453, 465, 343, 357, 412, 437, 343, 399, 344, 360, 440, 420, 437, 456, 360,\n 420, 363, 361, 401, 288, 265, 372, 353, 390, 339, 249, 339, 448, 255];\n", "const tf = require('@tensorflow/tfjs');\nconst blazeface = require('./blazeface');\nconst keypoints = require('./keypoints');\nconst pipe = require('./pipeline');\nconst uv_coords = require('./uvcoords');\nconst triangulation = require('./triangulation').default;\n\nclass MediaPipeFaceMesh {\n constructor(blazeFace, blazeMeshModel, irisModel, config) {\n this.pipeline = new pipe.Pipeline(blazeFace, blazeMeshModel, irisModel, config);\n if (config) this.config = config;\n }\n\n async estimateFaces(input, config) {\n if (config) this.config = config;\n const predictions = await this.pipeline.predict(input, config);\n const results = [];\n for (const prediction of (predictions || [])) {\n // guard against disposed tensors on long running operations such as pause in middle of processing\n if (prediction.isDisposedInternal) continue;\n const confidence = prediction.confidence.arraySync();\n if (confidence >= this.config.detector.minConfidence) {\n const mesh = prediction.coords ? prediction.coords.arraySync() : null;\n const annotations = {};\n if (mesh && mesh.length > 0) {\n for (const key in keypoints.MESH_ANNOTATIONS) {\n if (this.config.iris.enabled || key.includes('Iris') === false) {\n annotations[key] = keypoints.MESH_ANNOTATIONS[key].map((index) => mesh[index]);\n }\n }\n }\n results.push({\n confidence: confidence || 0,\n box: prediction.box ? [prediction.box.startPoint[0], prediction.box.startPoint[1], prediction.box.endPoint[0] - prediction.box.startPoint[0], prediction.box.endPoint[1] - prediction.box.startPoint[1]] : 0,\n mesh,\n annotations,\n image: prediction.image ? tf.clone(prediction.image) : null,\n });\n }\n if (prediction.confidence) prediction.confidence.dispose();\n if (prediction.coords) prediction.coords.dispose();\n if (prediction.image) prediction.image.dispose();\n }\n return results;\n }\n}\n\nasync function load(config) {\n const models = await Promise.all([\n blazeface.load(config),\n tf.loadGraphModel(config.mesh.modelPath, { fromTFHub: config.mesh.modelPath.includes('tfhub.dev') }),\n tf.loadGraphModel(config.iris.modelPath, { fromTFHub: config.iris.modelPath.includes('tfhub.dev') }),\n ]);\n const faceMesh = new MediaPipeFaceMesh(models[0], models[1], models[2], config);\n return faceMesh;\n}\n\nexports.load = load;\nexports.MediaPipeFaceMesh = MediaPipeFaceMesh;\nexports.uv_coords = uv_coords;\nexports.triangulation = triangulation;\n", "const tf = require('@tensorflow/tfjs');\n\nconst models = {};\nlet last = { age: 0, gender: '' };\nlet frame = 0;\n\nasync function loadAge(config) {\n if (!models.age) models.age = await tf.loadGraphModel(config.face.age.modelPath);\n return models.age;\n}\n\nasync function loadGender(config) {\n if (!models.gender) models.gender = await tf.loadGraphModel(config.face.gender.modelPath);\n return models.gender;\n}\n\nasync function predict(image, config) {\n if (frame < config.face.age.skipFrames) {\n frame += 1;\n return last;\n }\n frame = 0;\n const resize = tf.image.resizeBilinear(image, [config.face.age.inputSize, config.face.age.inputSize], false);\n const enhance = tf.mul(resize, [255.0]);\n tf.dispose(resize);\n\n const promises = [];\n let ageT;\n let genderT;\n if (config.face.age.enabled) promises.push(ageT = models.age.predict(enhance));\n if (config.face.gender.enabled) promises.push(genderT = models.gender.predict(enhance));\n await Promise.all(promises);\n\n const obj = {};\n if (ageT) {\n const data = await ageT.data();\n obj.age = Math.trunc(10 * data[0]) / 10;\n tf.dispose(ageT);\n }\n if (genderT) {\n const data = await genderT.data();\n const confidence = Math.trunc(Math.abs(1.9 * 100 * (data[0] - 0.5))) / 100;\n if (confidence > config.face.gender.minConfidence) {\n obj.gender = data[0] <= 0.5 ? 'female' : 'male';\n obj.confidence = confidence;\n }\n tf.dispose(genderT);\n }\n\n tf.dispose(enhance);\n last = obj;\n return obj;\n}\n\nexports.predict = predict;\nexports.loadAge = loadAge;\nexports.loadGender = loadGender;\n", "const tf = require('@tensorflow/tfjs');\n\nconst annotations = ['angry', 'discust', 'fear', 'happy', 'sad', 'surpise', 'neutral'];\nconst models = {};\nlet last = [];\nlet frame = 0;\nconst multiplier = 1.5;\n\nasync function load(config) {\n if (!models.emotion) models.emotion = await tf.loadGraphModel(config.face.emotion.modelPath);\n return models.emotion;\n}\n\nasync function predict(image, config) {\n if (frame < config.face.emotion.skipFrames) {\n frame += 1;\n return last;\n }\n frame = 0;\n const resize = tf.image.resizeBilinear(image, [config.face.emotion.inputSize, config.face.emotion.inputSize], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n resize.dispose();\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, [0.2989]);\n const greenNorm = tf.mul(green, [0.5870]);\n const blueNorm = tf.mul(blue, [0.1140]);\n red.dispose();\n green.dispose();\n blue.dispose();\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n redNorm.dispose();\n greenNorm.dispose();\n blueNorm.dispose();\n const obj = [];\n if (config.face.emotion.enabled) {\n const emotionT = await models.emotion.predict(grayscale);\n const data = await emotionT.data();\n for (let i = 0; i < data.length; i++) {\n if (multiplier * data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * multiplier * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n tf.dispose(emotionT);\n }\n tf.dispose(grayscale);\n last = obj;\n return obj;\n}\n\nexports.predict = predict;\nexports.load = load;\n", "const tf = require('@tensorflow/tfjs');\n\nclass BaseModel {\n constructor(model, outputStride) {\n this.model = model;\n this.outputStride = outputStride;\n const inputShape = this.model.inputs[0].shape;\n tf.util.assert((inputShape[1] === -1) && (inputShape[2] === -1), () => `Input shape [${inputShape[1]}, ${inputShape[2]}] must both be equal to or -1`);\n }\n\n /**\n * Predicts intermediate Tensor representations.\n *\n * @param input The input RGB image of the base model.\n * A Tensor of shape: [`inputResolution`, `inputResolution`, 3].\n *\n * @return A dictionary of base model's intermediate predictions.\n * The returned dictionary should contains the following elements:\n * heatmapScores: A Tensor3D that represents the heatmapScores.\n * offsets: A Tensor3D that represents the offsets.\n * displacementFwd: A Tensor3D that represents the forward displacement.\n * displacementBwd: A Tensor3D that represents the backward displacement.\n */\n predict(input) {\n return tf.tidy(() => {\n const asFloat = this.preprocessInput(input.toFloat());\n const asBatch = asFloat.expandDims(0);\n const results = this.model.predict(asBatch);\n const results3d = results.map((y) => y.squeeze([0]));\n const namedResults = this.nameOutputResults(results3d);\n return {\n heatmapScores: namedResults.heatmap.sigmoid(),\n offsets: namedResults.offsets,\n displacementFwd: namedResults.displacementFwd,\n displacementBwd: namedResults.displacementBwd,\n };\n });\n }\n\n /**\n * Releases the CPU and GPU memory allocated by the model.\n */\n dispose() {\n this.model.dispose();\n }\n}\nexports.BaseModel = BaseModel;\n", "const tf = require('@tensorflow/tfjs');\nconst modelBase = require('./modelBase');\n\nclass MobileNet extends modelBase.BaseModel {\n // eslint-disable-next-line class-methods-use-this\n preprocessInput(input) {\n // Normalize the pixels [0, 255] to be between [-1, 1].\n return tf.tidy(() => tf.div(input, 127.5).sub(1.0));\n }\n\n // eslint-disable-next-line class-methods-use-this\n nameOutputResults(results) {\n const [offsets, heatmap, displacementFwd, displacementBwd] = results;\n return { offsets, heatmap, displacementFwd, displacementBwd };\n }\n}\nexports.MobileNet = MobileNet;\n", "// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nfunction half(k) {\n return Math.floor(k / 2);\n}\nclass MaxHeap {\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() {\n return this.numberOfElements === -1;\n }\n\n size() {\n return this.numberOfElements + 1;\n }\n\n all() {\n return this.priorityQueue.slice(0, this.numberOfElements + 1);\n }\n\n max() {\n return this.priorityQueue[0];\n }\n\n swim(k) {\n while (k > 0 && this.less(half(k), k)) {\n this.exchange(k, half(k));\n k = half(k);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\nexports.MaxHeap = MaxHeap;\n", "const heapSort = require('./heapSort');\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, localMaximumRadius, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) {\n break;\n }\n }\n return localMaximum;\n}\n/**\n * Builds a priority queue with part candidate positions for a specific image in\n * the batch. For this we find all local maxima in the score maps with score\n * values above a threshold. We create a single priority queue across all parts.\n */\nfunction buildPartWithScoreQueue(scoreThreshold, localMaximumRadius, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new heapSort.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < scoreThreshold) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, localMaximumRadius, scores)) {\n queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n }\n return queue;\n}\nexports.buildPartWithScoreQueue = buildPartWithScoreQueue;\n", "exports.partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\nexports.NUM_KEYPOINTS = exports.partNames.length;\nexports.partIds = exports.partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\n/*\n * Define the skeleton. This defines the parent->child relationships of our\n * tree. Arbitrarily this defines the nose as the root of the tree, however\n * since we will infer the displacement for both parent->child and\n * child->parent, we can define the tree root as any node.\n */\nexports.poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\nexports.connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([exports.partIds[jointNameA], exports.partIds[jointNameB]]));\nexports.partChannels = [\n 'left_face',\n 'right_face',\n 'right_upper_leg_front',\n 'right_lower_leg_back',\n 'right_upper_leg_back',\n 'left_lower_leg_front',\n 'left_upper_leg_front',\n 'left_upper_leg_back',\n 'left_lower_leg_back',\n 'right_feet',\n 'right_lower_leg_front',\n 'left_feet',\n 'torso_front',\n 'torso_back',\n 'right_upper_arm_front',\n 'right_upper_arm_back',\n 'right_lower_arm_back',\n 'left_lower_arm_front',\n 'left_upper_arm_front',\n 'left_upper_arm_back',\n 'left_lower_arm_back',\n 'right_hand',\n 'right_lower_arm_front',\n 'left_hand',\n];\n", "const kpt = require('./keypoints');\n\nfunction getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + kpt.NUM_KEYPOINTS),\n };\n}\nexports.getOffsetPoint = getOffsetPoint;\n\nfunction getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\nexports.getImageCoords = getImageCoords;\n\nfunction fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\nexports.fillArray = fillArray;\n\nfunction clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\nexports.clamp = clamp;\n\nfunction squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\nexports.squaredDistance = squaredDistance;\n\nfunction addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\nexports.addVectors = addVectors;\n\nfunction clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\nexports.clampVector = clampVector;\n", "const keypoints = require('./keypoints');\nconst vectors = require('./vectors');\n\nconst parentChildrenTuples = keypoints.poseChain.map(([parentJoinName, childJoinName]) => ([keypoints.partIds[parentJoinName], keypoints.partIds[childJoinName]]));\nconst parentToChildEdges = parentChildrenTuples.map(([, childJointId]) => childJointId);\nconst childToParentEdges = parentChildrenTuples.map(([parentJointId]) => parentJointId);\nfunction getDisplacement(edgeId, point, displacements) {\n const numEdges = displacements.shape[2] / 2;\n return {\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, numEdges + edgeId),\n };\n}\nfunction getStridedIndexNearPoint(point, outputStride, height, width) {\n return {\n y: vectors.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: vectors.clamp(Math.round(point.x / outputStride), 0, width - 1),\n };\n}\n/**\n * We get a new keypoint along the `edgeId` for the pose instance, assuming\n * that the position of the `idSource` part is already known. For this, we\n * follow the displacement vector from the source to target part (stored in\n * the `i`-t channel of the displacement tensor). The displaced keypoint\n * vector is refined using the offset vector by `offsetRefineStep` times.\n */\nfunction traverseToTargetKeypoint(edgeId, sourceKeypoint, targetKeypointId, scoresBuffer, offsets, outputStride, displacements, offsetRefineStep = 2) {\n const [height, width] = scoresBuffer.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, outputStride, height, width);\n const displacement = getDisplacement(edgeId, sourceKeypointIndices, displacements);\n const displacedPoint = vectors.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, outputStride, height, width);\n const offsetPoint = vectors.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetKeypointId, offsets);\n targetKeypoint = vectors.addVectors({\n x: targetKeypointIndices.x * outputStride,\n y: targetKeypointIndices.y * outputStride,\n }, { x: offsetPoint.x, y: offsetPoint.y });\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, outputStride, height, width);\n const score = scoresBuffer.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetKeypointId);\n return { position: targetKeypoint, part: keypoints.partNames[targetKeypointId], score };\n}\n/**\n * Follows the displacement fields to decode the full pose of the object\n * instance given the position of a part that acts as root.\n *\n * @return An array of decoded keypoints and their scores for a single pose\n */\nfunction decodePose(root, scores, offsets, outputStride, displacementsFwd, displacementsBwd) {\n const numParts = scores.shape[2];\n const numEdges = parentToChildEdges.length;\n const instanceKeypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const { part: rootPart, score: rootScore } = root;\n const rootPoint = vectors.getImageCoords(rootPart, outputStride, offsets);\n instanceKeypoints[rootPart.id] = {\n score: rootScore,\n part: keypoints.partNames[rootPart.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward\n // displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceKeypointId = parentToChildEdges[edge];\n const targetKeypointId = childToParentEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward\n // displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceKeypointId = childToParentEdges[edge];\n const targetKeypointId = parentToChildEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsFwd);\n }\n }\n return instanceKeypoints;\n}\nexports.decodePose = decodePose;\n", "const buildParts = require('./buildParts');\nconst decodePose = require('./decodePose');\nconst vectors = require('./vectors');\n\nfunction withinNmsRadiusOfCorrespondingPoint(poses, squaredNmsRadius, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId].position;\n return vectors.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n/* Score the newly proposed object instance without taking into account\n * the scores of the parts that overlap with any previously detected\n * instance.\n */\nfunction getInstanceScore(existingPoses, squaredNmsRadius, instanceKeypoints) {\n const notOverlappedKeypointScores = instanceKeypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinNmsRadiusOfCorrespondingPoint(existingPoses, squaredNmsRadius, position, keypointId)) {\n result += score;\n }\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / instanceKeypoints.length;\n}\n// A point (y, x) is considered as root part candidate if its score is a\n// maximum in a window |y - y'| <= kLocalMaximumRadius, |x - x'| <=\n// kLocalMaximumRadius.\nconst kLocalMaximumRadius = 1;\n/**\n * Detects multiple poses and finds their parts from part scores and\n * displacement vectors. It returns up to `maxDetections` object instance\n * detections in decreasing root score order. It works as follows: We first\n * create a priority queue with local part score maxima above\n * `scoreThreshold`, considering all parts at the same time. Then we\n * iteratively pull the top element of the queue (in decreasing score order)\n * and treat it as a root candidate for a new object instance. To avoid\n * duplicate detections, we reject the root candidate if it is within a disk\n * of `nmsRadius` pixels from the corresponding part of a previously detected\n * instance, which is a form of part-based non-maximum suppression (NMS). If\n * the root candidate passes the NMS check, we start a new object instance\n * detection, treating the corresponding part as root and finding the\n * positions of the remaining parts by following the displacement vectors\n * along the tree-structured part graph. We assign to the newly detected\n * instance a score equal to the sum of scores of its parts which have not\n * been claimed by a previous instance (i.e., those at least `nmsRadius`\n * pixels away from the corresponding part of all previously detected\n * instances), divided by the total number of parts `numParts`.\n *\n * @param heatmapScores 3-D tensor with shape `[height, width, numParts]`.\n * The value of heatmapScores[y, x, k]` is the score of placing the `k`-th\n * object part at position `(y, x)`.\n *\n * @param offsets 3-D tensor with shape `[height, width, numParts * 2]`.\n * The value of [offsets[y, x, k], offsets[y, x, k + numParts]]` is the\n * short range offset vector of the `k`-th object part at heatmap\n * position `(y, x)`.\n *\n * @param displacementsFwd 3-D tensor of shape\n * `[height, width, 2 * num_edges]`, where `num_edges = num_parts - 1` is the\n * number of edges (parent-child pairs) in the tree. It contains the forward\n * displacements between consecutive part from the root towards the leaves.\n *\n * @param displacementsBwd 3-D tensor of shape\n * `[height, width, 2 * num_edges]`, where `num_edges = num_parts - 1` is the\n * number of edges (parent-child pairs) in the tree. It contains the backward\n * displacements between consecutive part from the root towards the leaves.\n *\n * @param outputStride The output stride that was used when feed-forwarding\n * through the PoseNet model. Must be 32, 16, or 8.\n *\n * @param maxPoseDetections Maximum number of returned instance detections per\n * image.\n *\n * @param scoreThreshold Only return instance detections that have root part\n * score greater or equal to this value. Defaults to 0.5.\n *\n * @param nmsRadius Non-maximum suppression part distance. It needs to be\n * strictly positive. Two parts suppress each other if they are less than\n * `nmsRadius` pixels away. Defaults to 20.\n *\n * @return An array of poses and their scores, each containing keypoints and\n * the corresponding keypoint scores.\n */\nfunction decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer, outputStride, maxPoseDetections, scoreThreshold = 0.5, nmsRadius = 20) {\n const poses = [];\n const queue = buildParts.buildPartWithScoreQueue(scoreThreshold, kLocalMaximumRadius, scoresBuffer);\n const squaredNmsRadius = nmsRadius * nmsRadius;\n // Generate at most maxDetections object instances per image in\n // decreasing root part score order.\n while (poses.length < maxPoseDetections && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it\n // is within a disk of `nmsRadius` pixels from the corresponding part of\n // a previously detected instance.\n const rootImageCoords = vectors.getImageCoords(root.part, outputStride, offsetsBuffer);\n if (withinNmsRadiusOfCorrespondingPoint(poses, squaredNmsRadius, rootImageCoords, root.part.id)) continue;\n // Start a new detection instance at the position of the root.\n const keypoints = decodePose.decodePose(root, scoresBuffer, offsetsBuffer, outputStride, displacementsFwdBuffer, displacementsBwdBuffer);\n const score = getInstanceScore(poses, squaredNmsRadius, keypoints);\n poses.push({ keypoints, score });\n }\n return poses;\n}\nexports.decodeMultiplePoses = decodeMultiplePoses;\n", "const kpt = require('./keypoints');\n\nfunction eitherPointDoesntMeetConfidence(a, b, minConfidence) {\n return (a < minConfidence || b < minConfidence);\n}\n\nfunction getAdjacentKeyPoints(keypoints, minConfidence) {\n return kpt.connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\nexports.getAdjacentKeyPoints = getAdjacentKeyPoints;\n\nconst { NEGATIVE_INFINITY, POSITIVE_INFINITY } = Number;\nfunction getBoundingBox(keypoints) {\n return keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: NEGATIVE_INFINITY,\n maxY: NEGATIVE_INFINITY,\n minX: POSITIVE_INFINITY,\n minY: POSITIVE_INFINITY,\n });\n}\nexports.getBoundingBox = getBoundingBox;\nfunction getBoundingBoxPoints(keypoints) {\n const { minX, minY, maxX, maxY } = getBoundingBox(keypoints);\n return [{ x: minX, y: minY }, { x: maxX, y: minY }, { x: maxX, y: maxY }, { x: minX, y: maxY }];\n}\nexports.getBoundingBoxPoints = getBoundingBoxPoints;\nasync function toTensorBuffers3D(tensors) {\n return Promise.all(tensors.map((tensor) => tensor.buffer()));\n}\nexports.toTensorBuffers3D = toTensorBuffers3D;\n\nfunction scalePose(pose, scaleY, scaleX) {\n return {\n score: pose.score,\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: { x: position.x * scaleX, y: position.y * scaleY },\n })),\n };\n}\nexports.scalePose = scalePose;\n\nfunction resizeTo(image, [targetH, targetW]) {\n const input = image.squeeze(0);\n const resized = input.resizeBilinear([targetH, targetW]);\n input.dispose();\n return resized;\n}\nexports.resizeTo = resizeTo;\n\nfunction scaleAndFlipPoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]) {\n const scaledPoses = poses.map((pose) => scalePose(pose, height / inputResolutionHeight, width / inputResolutionWidth));\n return scaledPoses;\n}\nexports.scaleAndFlipPoses = scaleAndFlipPoses;\n", "const tf = require('@tensorflow/tfjs');\nconst modelMobileNet = require('./modelMobileNet');\nconst decodeMultiple = require('./decodeMultiple');\nconst util = require('./util');\n\nclass PoseNet {\n constructor(net) {\n this.baseModel = net;\n }\n\n /**\n * Infer through PoseNet, and estimates multiple poses using the outputs.\n * This does standard ImageNet pre-processing before inferring through the\n * model. The image should pixels should have values [0-255]. It detects\n * multiple poses and finds their parts from part scores and displacement\n * vectors using a fast greedy decoding algorithm. It returns up to\n * `config.maxDetections` object instance detections in decreasing root\n * score order.\n *\n * @param input\n * ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement) The input\n * image to feed through the network.\n *\n * @param config MultiPoseEstimationConfig object that contains parameters\n * for the PoseNet inference using multiple pose estimation.\n *\n * @return An array of poses and their scores, each containing keypoints and\n * the corresponding keypoint scores. The positions of the keypoints are\n * in the same scale as the original image\n */\n async estimatePoses(input, config) {\n const outputStride = config.outputStride;\n // const inputResolution = config.inputResolution;\n const height = input.shape[1];\n const width = input.shape[2];\n const resized = util.resizeTo(input, [config.inputResolution, config.inputResolution]);\n const { heatmapScores, offsets, displacementFwd, displacementBwd } = this.baseModel.predict(resized);\n const allTensorBuffers = await util.toTensorBuffers3D([heatmapScores, offsets, displacementFwd, displacementBwd]);\n const scoresBuffer = allTensorBuffers[0];\n const offsetsBuffer = allTensorBuffers[1];\n const displacementsFwdBuffer = allTensorBuffers[2];\n const displacementsBwdBuffer = allTensorBuffers[3];\n const poses = await decodeMultiple.decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer, outputStride, config.maxDetections, config.scoreThreshold, config.nmsRadius);\n const resultPoses = util.scaleAndFlipPoses(poses, [height, width], [config.inputResolution, config.inputResolution]);\n heatmapScores.dispose();\n offsets.dispose();\n displacementFwd.dispose();\n displacementBwd.dispose();\n resized.dispose();\n return resultPoses;\n }\n\n dispose() {\n this.baseModel.dispose();\n }\n}\nexports.PoseNet = PoseNet;\nasync function loadMobileNet(config) {\n const graphModel = await tf.loadGraphModel(config.modelPath);\n const mobilenet = new modelMobileNet.MobileNet(graphModel, config.outputStride);\n return new PoseNet(mobilenet);\n}\n/**\n * Loads the PoseNet model instance from a checkpoint, with the MobileNet architecture. The model to be loaded is configurable using the\n * config dictionary ModelConfig. Please find more details in the documentation of the ModelConfig.\n *\n * @param config ModelConfig dictionary that contains parameters for\n * the PoseNet loading process. Please find more details of each parameters\n * in the documentation of the ModelConfig interface. The predefined\n * `MOBILENET_V1_CONFIG` and `RESNET_CONFIG` can also be used as references\n * for defining your customized config.\n */\nasync function load(config) {\n return loadMobileNet(config);\n}\nexports.load = load;\n", "const modelMobileNet = require('./modelMobileNet');\nconst modelPoseNet = require('./modelPoseNet');\nconst decodeMultiple = require('./decodeMultiple');\nconst keypoints = require('./keypoints');\nconst util = require('./util');\n\nexports.load = modelPoseNet.load;\nexports.PoseNet = modelPoseNet.PoseNet;\n\nexports.MobileNet = modelMobileNet.MobileNet;\nexports.decodeMultiplePoses = decodeMultiple.decodeMultiplePoses;\nexports.partChannels = keypoints.partChannels;\nexports.partIds = keypoints.partIds;\nexports.partNames = keypoints.partNames;\nexports.poseChain = keypoints.poseChain;\nexports.getAdjacentKeyPoints = util.getAdjacentKeyPoints;\nexports.getBoundingBox = util.getBoundingBox;\nexports.getBoundingBoxPoints = util.getBoundingBoxPoints;\nexports.scaleAndFlipPoses = util.scaleAndFlipPoses;\nexports.scalePose = util.scalePose;\n", "const tf = require('@tensorflow/tfjs');\n\nfunction getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\nexports.getBoxSize = getBoxSize;\n\nfunction getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\nexports.getBoxCenter = getBoxCenter;\n\nfunction cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\nexports.cutBoxFromImageAndResize = cutBoxFromImageAndResize;\n\nfunction scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks };\n}\nexports.scaleBoxCoordinates = scaleBoxCoordinates;\n\nfunction enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.enlargeBox = enlargeBox;\n\nfunction squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.squarifyBox = squarifyBox;\n\nfunction shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0], box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\nexports.shiftBox = shiftBox;\n", "const tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\n\nclass HandDetector {\n constructor(model, anchors, config) {\n this.model = model;\n this.width = config.inputSize;\n this.height = config.inputSize;\n this.anchors = anchors.map((anchor) => [anchor.x_center, anchor.y_center]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n this.inputSizeTensor = tf.tensor1d([config.inputSize, config.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([config.inputSize * 2, config.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(rawPalmLandmarks.reshape([-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoundingBoxes(input) {\n const batchedPrediction = this.model.predict(input);\n const prediction = batchedPrediction.squeeze();\n // Regression score for each anchor point.\n const scores = tf.tidy(() => tf.sigmoid(tf.slice(prediction, [0, 0], [-1, 1])).squeeze());\n // Bounding box for each anchor point.\n const rawBoxes = tf.slice(prediction, [0, 1], [-1, 4]);\n const boxes = this.normalizeBoxes(rawBoxes);\n const boxesWithHandsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.maxHands, this.iouThreshold, this.scoreThreshold);\n const boxesWithHands = await boxesWithHandsTensor.array();\n const toDispose = [batchedPrediction, boxesWithHandsTensor, prediction, boxes, rawBoxes, scores];\n const detectedHands = tf.tidy(() => {\n const detectedBoxes = [];\n for (const i in boxesWithHands) {\n const boxIndex = boxesWithHands[i];\n const matchingBox = tf.slice(boxes, [boxIndex, 0], [1, -1]);\n const rawPalmLandmarks = tf.slice(prediction, [boxIndex, 5], [1, 14]);\n const palmLandmarks = tf.tidy(() => this.normalizeLandmarks(rawPalmLandmarks, boxIndex).reshape([-1, 2]));\n detectedBoxes.push({ boxes: matchingBox, palmLandmarks });\n }\n return detectedBoxes;\n });\n toDispose.forEach((tensor) => tensor.dispose());\n return detectedHands;\n }\n\n /**\n * Returns a Box identifying the bounding box of a hand within the image.\n * Returns null if there is no hand in the image.\n *\n * @param input The image to classify.\n */\n async estimateHandBounds(input, config) {\n // const inputHeight = input.shape[2];\n // const inputWidth = input.shape[1];\n this.iouThreshold = config.iouThreshold;\n this.scoreThreshold = config.scoreThreshold;\n this.maxHands = config.maxHands;\n const resized = input.resizeBilinear([this.width, this.height]);\n const divided = resized.div(255);\n const normalized = divided.sub(0.5);\n const image = normalized.mul(2.0);\n resized.dispose();\n divided.dispose();\n normalized.dispose();\n const predictions = await this.getBoundingBoxes(image);\n image.dispose();\n if (!predictions || (predictions.length === 0)) return null;\n const hands = [];\n for (const i in predictions) {\n const prediction = predictions[i];\n const boundingBoxes = await prediction.boxes.array();\n const startPoint = boundingBoxes[0].slice(0, 2);\n const endPoint = boundingBoxes[0].slice(2, 4);\n const palmLandmarks = await prediction.palmLandmarks.array();\n prediction.boxes.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(bounding.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks }, [input.shape[2] / this.width, input.shape[1] / this.height]));\n }\n return hands;\n }\n}\nexports.HandDetector = HandDetector;\n", "exports.MESH_ANNOTATIONS = {\n thumb: [1, 2, 3, 4],\n indexFinger: [5, 6, 7, 8],\n middleFinger: [9, 10, 11, 12],\n ringFinger: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palmBase: [0],\n};\n", "function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\nexports.normalizeRadians = normalizeRadians;\n\nfunction computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\nexports.computeRotation = computeRotation;\n\nconst buildTranslationMatrix = (x, y) => ([[1, 0, x], [0, 1, y], [0, 0, 1]]);\nfunction dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\nexports.dot = dot;\n\nfunction getColumnFrom2DArr(arr, columnIndex) {\n const column = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\nexports.getColumnFrom2DArr = getColumnFrom2DArr;\n\nfunction multiplyTransformMatrices(mat1, mat2) {\n const product = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\nfunction buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\nexports.buildRotationMatrix = buildRotationMatrix;\n\nfunction invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\nexports.invertTransformMatrix = invertTransformMatrix;\n\nfunction rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\nexports.rotatePoint = rotatePoint;\n", "const tf = require('@tensorflow/tfjs');\nconst bounding = require('./box');\nconst util = require('./util');\n\nconst UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD = 0.8;\nconst PALM_BOX_SHIFT_VECTOR = [0, -0.4];\nconst HAND_BOX_SHIFT_VECTOR = [0, -0.1];\nconst HAND_BOX_ENLARGE_FACTOR = 1.65;\nconst PALM_LANDMARK_IDS = [0, 5, 9, 13, 17, 1, 2];\nconst PALM_LANDMARKS_INDEX_OF_PALM_BASE = 0;\nconst PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE = 2;\n\n// The Pipeline coordinates between the bounding box and skeleton models.\nclass HandPipeline {\n constructor(boundingBoxDetector, meshDetector, config) {\n this.regionsOfInterest = [];\n this.runsWithoutHandDetector = 0;\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.meshWidth = config.inputSize;\n this.meshHeight = config.inputSize;\n this.enlargeFactor = config.enlargeFactor;\n }\n\n // Get the bounding box surrounding the hand, given palm landmarks.\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => {\n const homogeneousCoordinate = [...coord, 1];\n return util.rotatePoint(homogeneousCoordinate, rotationMatrix);\n });\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n // boxAroundPalm only surrounds the palm - therefore we shift it\n // upwards so it will capture fingers once enlarged + squarified.\n return bounding.enlargeBox(bounding.squarifyBox(bounding.shiftBox(boxAroundPalm, PALM_BOX_SHIFT_VECTOR)), this.enlargeFactor);\n }\n\n // Get the bounding box surrounding the hand, given all hand landmarks.\n getBoxForHandLandmarks(landmarks) {\n // The MediaPipe hand mesh model is trained on hands with empty space\n // around them, so we still need to shift / enlarge boxAroundHand even\n // though it surrounds the entire hand.\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = bounding.enlargeBox(bounding.squarifyBox(bounding.shiftBox(boundingBox, HAND_BOX_SHIFT_VECTOR)), HAND_BOX_ENLARGE_FACTOR);\n const palmLandmarks = [];\n for (let i = 0; i < PALM_LANDMARK_IDS.length; i++) {\n palmLandmarks.push(landmarks[PALM_LANDMARK_IDS[i]].slice(0, 2));\n }\n boxAroundHand.palmLandmarks = palmLandmarks;\n return boxAroundHand;\n }\n\n // Scale, rotate, and translate raw keypoints from the model so they map to\n // the input coordinates.\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize(box);\n const scaleFactor = [boxSize[0] / this.meshWidth, boxSize[1] / this.meshHeight];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.meshWidth / 2),\n scaleFactor[1] * (coord[1] - this.meshHeight / 2), coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...bounding.getBoxCenter(box), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n coord[0] + originalBoxCenter[0], coord[1] + originalBoxCenter[1],\n coord[2],\n ]);\n }\n\n async estimateHands(image, config) {\n this.skipFrames = config.skipFrames;\n this.detectionConfidence = config.minConfidence;\n this.maxHands = config.maxHands;\n this.runsWithoutHandDetector++;\n const useFreshBox = this.shouldUpdateRegionsOfInterest();\n if (useFreshBox === true) {\n const boundingBoxPredictions = await this.boundingBoxDetector.estimateHandBounds(image, config);\n this.regionsOfInterest = [];\n for (const i in boundingBoxPredictions) {\n this.updateRegionsOfInterest(boundingBoxPredictions[i], true /* force update */, i);\n }\n this.runsWithoutHandDetector = 0;\n }\n // Rotate input so the hand is vertically oriented.\n const hands = [];\n if (!this.regionsOfInterest) return hands;\n for (const i in this.regionsOfInterest) {\n const currentBox = this.regionsOfInterest[i][0];\n if (!currentBox) return hands;\n const angle = util.computeRotation(currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_PALM_BASE], currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE]);\n const palmCenter = bounding.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized);\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const box = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = bounding.cutBoxFromImageAndResize(box, rotatedImage, [this.meshWidth, this.meshHeight]);\n const handImage = croppedInput.div(255);\n croppedInput.dispose();\n rotatedImage.dispose();\n const prediction = this.meshDetector.predict(handImage);\n const [flag, keypoints] = prediction;\n handImage.dispose();\n const flagValue = flag.dataSync()[0];\n flag.dispose();\n if (flagValue < config.minConfidence) {\n keypoints.dispose();\n this.regionsOfInterest[i] = [];\n return hands;\n }\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = await keypointsReshaped.array();\n keypoints.dispose();\n keypointsReshaped.dispose();\n const coords = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.updateRegionsOfInterest(nextBoundingBox, false /* force replace */, i);\n const result = {\n landmarks: coords,\n confidence: flagValue,\n box: {\n topLeft: nextBoundingBox.startPoint,\n bottomRight: nextBoundingBox.endPoint,\n },\n };\n hands.push(result);\n }\n return hands;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n\n // Updates regions of interest if the intersection over union between\n // the incoming and previous regions falls below a threshold.\n updateRegionsOfInterest(box, forceUpdate, index) {\n if (forceUpdate) {\n this.regionsOfInterest[index] = [box];\n } else {\n const previousBox = this.regionsOfInterest[index][0];\n let iou = 0;\n if (previousBox != null && previousBox.startPoint != null) {\n const [boxStartX, boxStartY] = box.startPoint;\n const [boxEndX, boxEndY] = box.endPoint;\n const [previousBoxStartX, previousBoxStartY] = previousBox.startPoint;\n const [previousBoxEndX, previousBoxEndY] = previousBox.endPoint;\n const xStartMax = Math.max(boxStartX, previousBoxStartX);\n const yStartMax = Math.max(boxStartY, previousBoxStartY);\n const xEndMin = Math.min(boxEndX, previousBoxEndX);\n const yEndMin = Math.min(boxEndY, previousBoxEndY);\n const intersection = (xEndMin - xStartMax) * (yEndMin - yStartMax);\n const boxArea = (boxEndX - boxStartX) * (boxEndY - boxStartY);\n const previousBoxArea = (previousBoxEndX - previousBoxStartX) * (previousBoxEndY - boxStartY);\n iou = intersection / (boxArea + previousBoxArea - intersection);\n }\n this.regionsOfInterest[index][0] = iou > UPDATE_REGION_OF_INTEREST_IOU_THRESHOLD ? previousBox : box;\n }\n }\n\n shouldUpdateRegionsOfInterest() {\n return !this.regionsOfInterest || (this.regionsOfInterest.length === 0) || (this.runsWithoutHandDetector >= this.skipFrames);\n }\n}\nexports.HandPipeline = HandPipeline;\n", "const tf = require('@tensorflow/tfjs');\nconst hand = require('./handdetector');\nconst keypoints = require('./keypoints');\nconst pipe = require('./pipeline');\n\nclass HandPose {\n constructor(pipeline) {\n this.pipeline = pipeline;\n }\n\n async estimateHands(input, config) {\n this.skipFrames = config.skipFrames;\n this.detectionConfidence = config.minConfidence;\n this.maxHands = config.maxHands;\n const predictions = await this.pipeline.estimateHands(input, config);\n const hands = [];\n if (!predictions) return hands;\n for (const prediction of predictions) {\n if (!prediction) return [];\n const annotations = {};\n for (const key of Object.keys(keypoints.MESH_ANNOTATIONS)) {\n annotations[key] = keypoints.MESH_ANNOTATIONS[key].map((index) => prediction.landmarks[index]);\n }\n hands.push({\n confidence: prediction.confidence || 0,\n box: prediction.box ? [prediction.box.topLeft[0], prediction.box.topLeft[1], prediction.box.bottomRight[0] - prediction.box.topLeft[0], prediction.box.bottomRight[1] - prediction.box.topLeft[1]] : 0,\n landmarks: prediction.landmarks,\n annotations,\n });\n }\n return hands;\n }\n}\nexports.HandPose = HandPose;\n\nasync function loadAnchors(url) {\n if (tf.env().features.IS_NODE) {\n // eslint-disable-next-line global-require\n const fs = require('fs');\n const data = await fs.readFileSync(url.replace('file://', ''));\n return JSON.parse(data);\n }\n return tf.util.fetch(url).then((d) => d.json());\n}\n\nasync function load(config) {\n const [anchors, handDetectorModel, handPoseModel] = await Promise.all([\n loadAnchors(config.detector.anchors),\n tf.loadGraphModel(config.detector.modelPath, { fromTFHub: config.detector.modelPath.includes('tfhub.dev') }),\n tf.loadGraphModel(config.skeleton.modelPath, { fromTFHub: config.skeleton.modelPath.includes('tfhub.dev') }),\n ]);\n const detector = new hand.HandDetector(handDetectorModel, anchors, config);\n const pipeline = new pipe.HandPipeline(detector, handPoseModel, config);\n const handpose = new HandPose(pipeline);\n return handpose;\n}\nexports.load = load;\n", "/* eslint-disable no-shadow */\n/* eslint-disable prefer-rest-params */\n/* eslint-disable no-sequences */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-use-before-define */\n/*\nWebGLImageFilter - MIT Licensed\n2013, Dominic Szablewski - phoboslab.org\n*/\n\nconst WebGLProgram = function (gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (gl, source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n throw new Error('Filter: GL compile failed', gl.getShaderInfoLog(shader));\n }\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n\n const _vsh = _compile(gl, vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(gl, fragmentSource, gl.FRAGMENT_SHADER);\n\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) {\n throw new Error('Filter: GL link failed', gl.getProgramInfoLog(this.id));\n }\n\n gl.useProgram(this.id);\n\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) {\n this.attribute[a] = gl.getAttribLocation(this.id, a);\n }\n\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) {\n this.uniform[u] = gl.getUniformLocation(this.id, u);\n }\n};\n\nconst WebGLImageFilter = function (params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _canvas = params.canvas || document.createElement('canvas');\n\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n\n const gl = _canvas.getContext('webgl') || _canvas.getContext('experimental-webgl');\n if (!gl) throw new Error('Filter: getContext() failed');\n\n this.addFilter = function (name) {\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n\n // No filters? Just draw\n if (_filterChain.length === 0) {\n const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n\n return _canvas;\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n\n _canvas.width = _width = width;\n _canvas.height = _height = height;\n\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n _vertexBuffer = gl.createBuffer(),\n gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n\n // Note sure if this is a good idea; at least it makes texture loading\n // in Ejecta instant.\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n\n gl.viewport(0, 0, _width, _height);\n\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index]\n || _createFramebufferTexture(_width, _height);\n\n return _tempFramebuffers[index];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n return { fbo, texture };\n };\n\n const _draw = function (flags) {\n let source = null;\n let target = null;\n let flipY = false;\n\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex).texture;\n }\n _drawCount++;\n\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex).fbo;\n }\n\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n\n // Compile shaders\n _currentProgram = new WebGLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n let DRAW = { INTERMEDIATE: 1 };\n\n let SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n\n let _filter = {};\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n\n const program = _compileShader(_filter.blur.SHADER);\n\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n\n const program = _compileShader(_filter.pixelate.SHADER);\n\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n};\n\nexports.Canvas = WebGLImageFilter;\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\nexport default {\n backend: 'webgl', // select tfjs backend to use\n console: true, // enable debugging output to console\n scoped: false, // enable scoped runs\n // some models *may* have memory leaks, this wrapps everything in a local scope at a cost of performance\n // typically not needed\n videoOptimized: true, // perform additional optimizations when input is video, must be disabled for images\n filter: {\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models: detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: '../models/blazeface/back/model.json', // can be 'front' or 'back'.\n // 'front' is optimized for large faces such as front-facing camera and 'back' is optimized for distanct faces.\n inputSize: 256, // fixed value: 128 for front and 256 for 'back'\n maxFaces: 10, // maximum number of faces detected in the input, should be set to the minimum number for performance\n skipFrames: 10, // how many frames to go without re-running the face bounding box detector, only used for video inputs\n // if model is running st 25 FPS, we can re-use existing bounding box for updated face mesh analysis\n // as face probably hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.3, // threshold for deciding whether boxes overlap too much in non-maximum suppression\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n },\n mesh: {\n enabled: true,\n modelPath: '../models/facemesh/model.json',\n inputSize: 192, // fixed value\n },\n iris: {\n enabled: true,\n modelPath: '../models/iris/model.json',\n enlargeFactor: 2.3, // empiric tuning\n inputSize: 64, // fixed value\n },\n age: {\n enabled: true,\n modelPath: '../models/ssrnet-age/imdb/model.json', // can be 'imdb' or 'wiki'\n // which determines training set for model\n inputSize: 64, // fixed value\n skipFrames: 10, // how many frames to go without re-running the detector, only used for video inputs\n },\n gender: {\n enabled: true,\n minConfidence: 0.8, // threshold for discarding a prediction\n modelPath: '../models/ssrnet-gender/imdb/model.json',\n },\n emotion: {\n enabled: true,\n inputSize: 64, // fixed value\n minConfidence: 0.5, // threshold for discarding a prediction\n skipFrames: 10, // how many frames to go without re-running the detector\n modelPath: '../models/emotion/model.json',\n },\n },\n body: {\n enabled: true,\n modelPath: '../models/posenet/model.json',\n inputResolution: 257, // fixed value\n outputStride: 16, // fixed value\n maxDetections: 10, // maximum number of people detected in the input, should be set to the minimum number for performance\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n nmsRadius: 20, // radius for deciding points are too close in non-maximum suppression\n },\n hand: {\n enabled: true,\n inputSize: 256, // fixed value\n skipFrames: 10, // how many frames to go without re-running the hand bounding box detector, only used for video inputs\n // if model is running st 25 FPS, we can re-use existing bounding box for updated hand skeleton analysis\n // as the hand probably hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.3, // threshold for deciding whether boxes overlap too much in non-maximum suppression\n scoreThreshold: 0.7, // threshold for deciding when to remove boxes based on score in non-maximum suppression\n enlargeFactor: 1.65, // empiric tuning as skeleton prediction prefers hand box with some whitespace\n maxHands: 10, // maximum number of hands detected in the input, should be set to the minimum number for performance\n detector: {\n anchors: '../models/handdetect/anchors.json',\n modelPath: '../models/handdetect/model.json',\n },\n skeleton: {\n modelPath: '../models/handskeleton/model.json',\n },\n },\n};\n", "const tf = require('@tensorflow/tfjs');\nconst facemesh = require('./facemesh/facemesh.js');\nconst ssrnet = require('./ssrnet/ssrnet.js');\nconst emotion = require('./emotion/emotion.js');\nconst posenet = require('./posenet/posenet.js');\nconst handpose = require('./handpose/handpose.js');\nconst fxImage = require('./imagefx.js');\nconst defaults = require('../config.js').default;\nconst app = require('../package.json');\n\nlet first = true;\n\n// static config override for non-video detection\nconst override = {\n face: { detector: { skipFrames: 0 }, age: { skipFrames: 0 }, emotion: { skipFrames: 0 } },\n hand: { skipFrames: 0 },\n};\n\n// helper function: gets elapsed time on both browser and nodejs\nconst now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt(Number(process.hrtime.bigint()) / 1000 / 1000);\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nfunction mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) {\n prev[key] = pVal.concat(...oVal);\n } else if (isObject(pVal) && isObject(oVal)) {\n prev[key] = mergeDeep(pVal, oVal);\n } else {\n prev[key] = oVal;\n }\n });\n return prev;\n }, {});\n}\n\nfunction sanity(input) {\n if (!input) return 'input is not defined';\n if (tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) {\n return 'input must be a tensor';\n }\n try {\n tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n}\n\nclass Human {\n constructor() {\n this.tf = tf;\n this.version = app.version;\n this.defaults = defaults;\n this.config = defaults;\n this.fx = (tf.ENV.flags.IS_BROWSER && (typeof document !== 'undefined')) ? new fxImage.Canvas() : null;\n this.state = 'idle';\n this.numTensors = 0;\n this.analyzeMemoryLeaks = false;\n // object that contains all initialized models\n this.models = {\n facemesh: null,\n posenet: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n };\n // export raw access to underlying models\n this.facemesh = facemesh;\n this.ssrnet = ssrnet;\n this.emotion = emotion;\n this.posenet = posenet;\n this.handpose = handpose;\n }\n\n // helper function: wrapper around console output\n log(...msg) {\n // eslint-disable-next-line no-console\n if (msg && this.config.console) console.log(...msg);\n }\n\n // helper function: measure tensor leak\n analyze(...msg) {\n if (!this.analyzeMemoryLeaks) return;\n const current = tf.engine().state.numTensors;\n const previous = this.numTensors;\n this.numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) this.log(...msg, leaked);\n }\n\n async load(userConfig) {\n if (userConfig) this.config = mergeDeep(defaults, userConfig);\n if (this.config.face.enabled && !this.models.facemesh) {\n this.log('Load model: Face');\n this.models.facemesh = await facemesh.load(this.config.face);\n }\n if (this.config.body.enabled && !this.models.posenet) {\n this.log('Load model: Body');\n this.models.posenet = await posenet.load(this.config.body);\n }\n if (this.config.hand.enabled && !this.models.handpose) {\n this.log('Load model: Hand');\n this.models.handpose = await handpose.load(this.config.hand);\n }\n if (this.config.face.enabled && this.config.face.age.enabled && !this.models.age) {\n this.log('Load model: Age');\n this.models.age = await ssrnet.loadAge(this.config);\n }\n if (this.config.face.enabled && this.config.face.gender.enabled && !this.models.gender) {\n this.log('Load model: Gender');\n this.models.gender = await ssrnet.loadGender(this.config);\n }\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) {\n this.log('Load model: Emotion');\n this.models.emotion = await emotion.load(this.config);\n }\n }\n\n tfImage(input) {\n // let imageData;\n let filtered;\n if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {\n const originalWidth = input.naturalWidth || input.videoWidth || input.width || (input.shape && (input.shape[1] > 0));\n const originalHeight = input.naturalHeight || input.videoHeight || input.height || (input.shape && (input.shape[2] > 0));\n\n let targetWidth = originalWidth;\n if (this.config.filter.width > 0) targetWidth = this.config.filter.width;\n else if (this.config.filter.height > 0) targetWidth = originalWidth * (this.config.filter.height / originalHeight);\n let targetHeight = originalHeight;\n if (this.config.filter.height > 0) targetHeight = this.config.filter.height;\n else if (this.config.filter.width > 0) targetHeight = originalHeight * (this.config.filter.width / originalWidth);\n\n const offscreenCanvas = new OffscreenCanvas(targetWidth, targetHeight);\n const ctx = offscreenCanvas.getContext('2d');\n if (input instanceof ImageData) ctx.putImageData(input, 0, 0);\n else ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, offscreenCanvas.width, offscreenCanvas.height);\n this.fx.reset();\n this.fx.addFilter('brightness', this.config.filter.brightness); // must have at least one filter enabled\n if (this.config.filter.contrast !== 0) this.fx.addFilter('contrast', this.config.filter.contrast);\n if (this.config.filter.sharpness !== 0) this.fx.addFilter('sharpen', this.config.filter.sharpness);\n if (this.config.filter.blur !== 0) this.fx.addFilter('blur', this.config.filter.blur);\n if (this.config.filter.saturation !== 0) this.fx.addFilter('saturation', this.config.filter.saturation);\n if (this.config.filter.hue !== 0) this.fx.addFilter('hue', this.config.filter.hue);\n if (this.config.filter.negative) this.fx.addFilter('negative');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.vintage) this.fx.addFilter('brownie');\n if (this.config.filter.sepia) this.fx.addFilter('sepia');\n if (this.config.filter.kodachrome) this.fx.addFilter('kodachrome');\n if (this.config.filter.technicolor) this.fx.addFilter('technicolor');\n if (this.config.filter.polaroid) this.fx.addFilter('polaroid');\n if (this.config.filter.pixelate !== 0) this.fx.addFilter('pixelate', this.config.filter.pixelate);\n filtered = this.fx.apply(offscreenCanvas);\n }\n let tensor;\n if (input instanceof tf.Tensor) {\n tensor = tf.clone(input);\n } else {\n const pixels = tf.browser.fromPixels(filtered || input);\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n return { tensor, canvas: this.config.filter.return ? filtered : null };\n }\n\n async detect(input, userConfig = {}) {\n this.state = 'config';\n const perf = {};\n let timeStamp;\n\n timeStamp = now();\n this.config = mergeDeep(defaults, userConfig);\n if (!this.config.videoOptimized) this.config = mergeDeep(this.config, override);\n perf.config = Math.trunc(now() - timeStamp);\n\n // sanity checks\n timeStamp = now();\n this.state = 'check';\n const error = sanity(input);\n if (error) {\n this.log(error, input);\n return { error };\n }\n perf.sanity = Math.trunc(now() - timeStamp);\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve) => {\n const timeStart = now();\n\n // configure backend\n timeStamp = now();\n if (tf.getBackend() !== this.config.backend) {\n this.state = 'backend';\n this.log('Human library setting backend:', this.config.backend);\n await tf.setBackend(this.config.backend);\n await tf.ready();\n }\n perf.backend = Math.trunc(now() - timeStamp);\n\n // check number of loaded models\n if (first) {\n this.log('Human library starting');\n this.log('Configuration:', this.config);\n this.log('Flags:', tf.ENV.flags);\n first = false;\n }\n\n // load models if enabled\n timeStamp = now();\n this.state = 'load';\n await this.load();\n perf.load = Math.trunc(now() - timeStamp);\n\n if (this.config.scoped) tf.engine().startScope();\n\n this.analyze('Start Detect:');\n\n timeStamp = now();\n const image = this.tfImage(input);\n perf.image = Math.trunc(now() - timeStamp);\n const imageTensor = image.tensor;\n\n // run posenet\n this.state = 'run:body';\n timeStamp = now();\n this.analyze('Start PoseNet');\n const poseRes = this.config.body.enabled ? await this.models.posenet.estimatePoses(imageTensor, this.config.body) : [];\n this.analyze('End PoseNet:');\n perf.body = Math.trunc(now() - timeStamp);\n\n // run handpose\n this.state = 'run:hand';\n timeStamp = now();\n this.analyze('Start HandPose:');\n const handRes = this.config.hand.enabled ? await this.models.handpose.estimateHands(imageTensor, this.config.hand) : [];\n this.analyze('End HandPose:');\n perf.hand = Math.trunc(now() - timeStamp);\n\n // run facemesh, includes blazeface and iris\n const faceRes = [];\n if (this.config.face.enabled) {\n this.state = 'run:face';\n timeStamp = now();\n this.analyze('Start FaceMesh:');\n const faces = await this.models.facemesh.estimateFaces(imageTensor, this.config.face);\n perf.face = Math.trunc(now() - timeStamp);\n for (const face of faces) {\n // is something went wrong, skip the face\n if (!face.image || face.image.isDisposedInternal) {\n this.log('face object is disposed:', face.image);\n continue;\n }\n // run ssr-net age & gender, inherits face from blazeface\n this.state = 'run:agegender';\n timeStamp = now();\n const ssrData = (this.config.face.age.enabled || this.config.face.gender.enabled) ? await ssrnet.predict(face.image, this.config) : {};\n perf.agegender = Math.trunc(now() - timeStamp);\n // run emotion, inherits face from blazeface\n this.state = 'run:emotion';\n timeStamp = now();\n const emotionData = this.config.face.emotion.enabled ? await emotion.predict(face.image, this.config) : {};\n perf.emotion = Math.trunc(now() - timeStamp);\n\n // dont need face anymore\n face.image.dispose();\n // calculate iris distance\n // iris: array[ bottom, left, top, right, center ]\n const iris = (face.annotations.leftEyeIris && face.annotations.rightEyeIris)\n ? Math.max(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0], face.annotations.rightEyeIris[3][0] - face.annotations.rightEyeIris[1][0])\n : 0;\n faceRes.push({\n confidence: face.confidence,\n box: face.box,\n mesh: face.mesh,\n annotations: face.annotations,\n age: ssrData.age,\n gender: ssrData.gender,\n agConfidence: ssrData.confidence,\n emotion: emotionData,\n iris: (iris !== 0) ? Math.trunc(100 * 11.7 /* human iris size in mm */ / iris) / 100 : 0,\n });\n this.analyze('End FaceMesh:');\n }\n }\n\n imageTensor.dispose();\n this.state = 'idle';\n\n if (this.config.scoped) tf.engine().endScope();\n this.analyze('End Scope:');\n\n perf.total = Math.trunc(now() - timeStart);\n resolve({ face: faceRes, body: poseRes, hand: handRes, performance: perf, canvas: image.canvas });\n });\n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KAAK,YAAY,aAAa,GAAG,KAAK,KAAK,YAAY,aAAa,GAAG,MACzJ;AACJ,kBAAQ,KAAK;AAAA,YACX,YAAY,KAAK;AAAA,YACjB,KAAK,KAAK;AAAA,YACV,MAAM,KAAK;AAAA,YACX,aAAa,KAAK;AAAA,YAClB,KAAK,QAAQ;AAAA,YACb,QAAQ,QAAQ;AAAA,YAChB,cAAc,QAAQ;AAAA,YACtB,SAAS;AAAA,YACT,MAAO,SAAS,IAAK,KAAK,MAAM,MAAM,OAAmC,QAAQ,MAAM;AAAA;AAEzF,eAAK,QAAQ;AAAA;AAAA;AAIjB,kBAAY;AACZ,WAAK,QAAQ;AAEb,UAAI,KAAK,OAAO;AAAQ,WAAG,SAAS;AACpC,WAAK,QAAQ;AAEb,WAAK,QAAQ,KAAK,MAAM,QAAQ;AAChC,cAAQ,CAAE,MAAM,SAAS,MAAM,SAAS,MAAM,SAAS,aAAa,MAAM,QAAQ,MAAM;AAAA;AAAA;AAAA;",
"names": []
}
diff --git a/dist/human.esm-nobundle.json b/dist/human.esm-nobundle.json
index 9fa5709e..2e320b98 100644
--- a/dist/human.esm-nobundle.json
+++ b/dist/human.esm-nobundle.json
@@ -1,7 +1,7 @@
{
"inputs": {
"config.js": {
- "bytes": 5942,
+ "bytes": 6295,
"imports": []
},
"package.json": {
@@ -116,7 +116,7 @@
"imports": []
},
"src/human.js": {
- "bytes": 11355,
+ "bytes": 11887,
"imports": [
{
"path": "src/facemesh/facemesh.js"
@@ -260,7 +260,7 @@
"dist/human.esm-nobundle.js.map": {
"imports": [],
"inputs": {},
- "bytes": 252197
+ "bytes": 248624
},
"dist/human.esm-nobundle.js": {
"imports": [],
@@ -350,19 +350,19 @@
"bytesInOutput": 20195
},
"config.js": {
- "bytesInOutput": 2197
+ "bytesInOutput": 2230
},
"package.json": {
"bytesInOutput": 2747
},
"src/human.js": {
- "bytesInOutput": 10193
+ "bytesInOutput": 10755
},
"src/human.js": {
"bytesInOutput": 0
}
},
- "bytes": 154393
+ "bytes": 154953
}
}
}
diff --git a/dist/human.esm.js b/dist/human.esm.js
index d115a9c4..56277525 100644
--- a/dist/human.esm.js
+++ b/dist/human.esm.js
@@ -1,4 +1,5 @@
-var __defineProperty = Object.defineProperty;
+var __defProp = Object.defineProperty;
+var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
var __commonJS = (callback, module) => () => {
if (!module) {
module = {exports: {}};
@@ -6,13 +7,10 @@ var __commonJS = (callback, module) => () => {
}
return module.exports;
};
-var __markAsModule = (target) => {
- return __defineProperty(target, "__esModule", {value: true});
-};
var __export = (target, all) => {
__markAsModule(target);
for (var name in all)
- __defineProperty(target, name, {get: all[name], enumerable: true});
+ __defProp(target, name, {get: all[name], enumerable: true});
};
// empty:/home/vlado/dev/human/node_modules/node-fetch/browser.js
@@ -180,7 +178,7 @@ var require_tf_core_node = __commonJS((exports) => {
}
/**
* @license
- * Copyright 2018 Google LLC. All Rights Reserved.
+ * Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -680,162 +678,6 @@ var require_tf_core_node = __commonJS((exports) => {
function notYetImplemented(kernelName) {
throw new Error("'" + kernelName + "' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen");
}
- /**
- * @license
- * Copyright 2017 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var TENSORFLOWJS_FLAGS_PREFIX = "tfjsflags";
- var Environment = function() {
- function Environment2(global2) {
- this.global = global2;
- this.flags = {};
- this.flagRegistry = {};
- this.urlFlags = {};
- this.populateURLFlags();
- }
- Environment2.prototype.setPlatform = function(platformName, platform) {
- if (this.platform != null) {
- console.warn("Platform " + this.platformName + " has already been set. " + ("Overwriting the platform with " + platform + "."));
- }
- this.platformName = platformName;
- this.platform = platform;
- };
- Environment2.prototype.registerFlag = function(flagName, evaluationFn, setHook) {
- this.flagRegistry[flagName] = {evaluationFn, setHook};
- if (this.urlFlags[flagName] != null) {
- var flagValue = this.urlFlags[flagName];
- console.warn("Setting feature override from URL " + flagName + ": " + flagValue + ".");
- this.set(flagName, flagValue);
- }
- };
- Environment2.prototype.getAsync = function(flagName) {
- return __awaiter(this, void 0, void 0, function() {
- var _a, _b;
- return __generator(this, function(_c) {
- switch (_c.label) {
- case 0:
- if (flagName in this.flags) {
- return [2, this.flags[flagName]];
- }
- _a = this.flags;
- _b = flagName;
- return [4, this.evaluateFlag(flagName)];
- case 1:
- _a[_b] = _c.sent();
- return [2, this.flags[flagName]];
- }
- });
- });
- };
- Environment2.prototype.get = function(flagName) {
- if (flagName in this.flags) {
- return this.flags[flagName];
- }
- var flagValue = this.evaluateFlag(flagName);
- if (flagValue instanceof Promise) {
- throw new Error("Flag " + flagName + " cannot be synchronously evaluated. Please use getAsync() instead.");
- }
- this.flags[flagName] = flagValue;
- return this.flags[flagName];
- };
- Environment2.prototype.getNumber = function(flagName) {
- return this.get(flagName);
- };
- Environment2.prototype.getBool = function(flagName) {
- return this.get(flagName);
- };
- Environment2.prototype.getFlags = function() {
- return this.flags;
- };
- Object.defineProperty(Environment2.prototype, "features", {
- get: function() {
- return this.flags;
- },
- enumerable: true,
- configurable: true
- });
- Environment2.prototype.set = function(flagName, value) {
- if (this.flagRegistry[flagName] == null) {
- throw new Error("Cannot set flag " + flagName + " as it has not been registered.");
- }
- this.flags[flagName] = value;
- if (this.flagRegistry[flagName].setHook != null) {
- this.flagRegistry[flagName].setHook(value);
- }
- };
- Environment2.prototype.evaluateFlag = function(flagName) {
- if (this.flagRegistry[flagName] == null) {
- throw new Error("Cannot evaluate flag '" + flagName + "': no evaluation function found.");
- }
- return this.flagRegistry[flagName].evaluationFn();
- };
- Environment2.prototype.setFlags = function(flags) {
- this.flags = Object.assign({}, flags);
- };
- Environment2.prototype.reset = function() {
- this.flags = {};
- this.urlFlags = {};
- this.populateURLFlags();
- };
- Environment2.prototype.populateURLFlags = function() {
- var _this = this;
- if (typeof this.global === "undefined" || typeof this.global.location === "undefined" || typeof this.global.location.search === "undefined") {
- return;
- }
- var urlParams = getQueryParams(this.global.location.search);
- if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {
- var keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(",");
- keyValues.forEach(function(keyValue) {
- var _a = keyValue.split(":"), key = _a[0], value = _a[1];
- _this.urlFlags[key] = parseValue(key, value);
- });
- }
- };
- return Environment2;
- }();
- function getQueryParams(queryString) {
- var params = {};
- queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, function(s) {
- var t = [];
- for (var _i2 = 1; _i2 < arguments.length; _i2++) {
- t[_i2 - 1] = arguments[_i2];
- }
- decodeParam(params, t[0], t[1]);
- return t.join("=");
- });
- return params;
- }
- function decodeParam(params, name, value) {
- params[decodeURIComponent(name)] = decodeURIComponent(value || "");
- }
- function parseValue(flagName, value) {
- value = value.toLowerCase();
- if (value === "true" || value === "false") {
- return value === "true";
- } else if ("" + +value === value) {
- return +value;
- }
- throw new Error("Could not parse value flag value " + value + " for flag " + flagName + ".");
- }
- function env() {
- return exports.ENV;
- }
- exports.ENV = null;
- function setEnvironmentGlobal(environment) {
- exports.ENV = environment;
- }
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -852,292 +694,6 @@ var require_tf_core_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var globalNameSpace;
- function getGlobalNamespace() {
- if (globalNameSpace == null) {
- var ns = void 0;
- if (typeof window !== "undefined") {
- ns = window;
- } else if (typeof global !== "undefined") {
- ns = global;
- } else if (typeof process !== "undefined") {
- ns = process;
- } else if (typeof self !== "undefined") {
- ns = self;
- } else {
- throw new Error("Could not find a global object");
- }
- globalNameSpace = ns;
- }
- return globalNameSpace;
- }
- function getGlobalMap() {
- var ns = getGlobalNamespace();
- if (ns._tfGlobals == null) {
- ns._tfGlobals = new Map();
- }
- return ns._tfGlobals;
- }
- function getGlobal(key, init) {
- var globalMap = getGlobalMap();
- if (globalMap.has(key)) {
- return globalMap.get(key);
- } else {
- var singleton = init();
- globalMap.set(key, singleton);
- return globalMap.get(key);
- }
- }
- var Abs = "Abs";
- var Acos = "Acos";
- var Acosh = "Acosh";
- var Add = "Add";
- var AddN = "AddN";
- var All = "All";
- var Any = "Any";
- var ArgMax = "ArgMax";
- var ArgMin = "ArgMin";
- var Asin = "Asin";
- var Asinh = "Asinh";
- var Atan = "Atan";
- var Atanh = "Atanh";
- var Atan2 = "Atan2";
- var AvgPool = "AvgPool";
- var AvgPoolBackprop = "AvgPoolBackprop";
- var AvgPool3D = "AvgPool3D";
- var AvgPool3DBackprop = "AvgPool3DBackprop";
- var BatchMatMul = "BatchMatMul";
- var BatchToSpaceND = "BatchToSpaceND";
- var BroadcastTo = "BroadcastTo";
- var Cast = "Cast";
- var Ceil = "Ceil";
- var ClipByValue = "ClipByValue";
- var Complex = "Complex";
- var Concat = "Concat";
- var Conv2D = "Conv2D";
- var Conv2DBackpropFilter = "Conv2DBackpropFilter";
- var Conv2DBackpropInput = "Conv2DBackpropInput";
- var Conv3D = "Conv3D";
- var Conv3DBackpropFilterV2 = "Conv3DBackpropFilterV2";
- var Conv3DBackpropInputV2 = "Conv3DBackpropInputV2";
- var Cos = "Cos";
- var Cosh = "Cosh";
- var Cumsum = "Cumsum";
- var CropAndResize = "CropAndResize";
- var DepthToSpace = "DepthToSpace";
- var DepthwiseConv2dNative = "DepthwiseConv2dNative";
- var DepthwiseConv2dNativeBackpropFilter = "DepthwiseConv2dNativeBackpropFilter";
- var DepthwiseConv2dNativeBackpropInput = "DepthwiseConv2dNativeBackpropInput";
- var Diag = "Diag";
- var Dilation2D = "Dilation2D";
- var Dilation2DBackpropInput = "Dilation2DBackpropInput";
- var Dilation2DBackpropFilter = "Dilation2DBackpropFilter";
- var Div = "Div";
- var Elu = "Elu";
- var EluGrad = "EluGrad";
- var Erf = "Erf";
- var Equal = "Equal";
- var Exp = "Exp";
- var Expm1 = "Expm1";
- var FFT = "FFT";
- var Fill = "Fill";
- var FlipLeftRight = "FlipLeftRight";
- var Floor = "Floor";
- var FloorDiv = "FloorDiv";
- var FusedBatchNorm = "FusedBatchNorm";
- var GatherV2 = "GatherV2";
- var GatherNd = "GatherNd";
- var Greater = "Greater";
- var GreaterEqual = "GreaterEqual";
- var Identity = "Identity";
- var IFFT = "IFFT";
- var Imag = "Imag";
- var IsFinite = "IsFinite";
- var IsInf = "IsInf";
- var IsNan = "IsNan";
- var Less = "Less";
- var LessEqual = "LessEqual";
- var LinSpace = "LinSpace";
- var Log = "Log";
- var Log1p = "Log1p";
- var LogicalAnd = "LogicalAnd";
- var LogicalNot = "LogicalNot";
- var LogicalOr = "LogicalOr";
- var LogSoftmax = "LogSoftmax";
- var LRN = "LRN";
- var LRNBackprop = "LRNBackprop";
- var Max = "Max";
- var Maximum = "Maximum";
- var MaxPool = "MaxPool";
- var MaxPoolBackprop = "MaxPoolBackprop";
- var MaxPool3D = "MaxPool3D";
- var MaxPool3DBackprop = "MaxPool3DBackprop";
- var MaxPoolWithArgmax = "MaxPoolWithArgmax";
- var Mean = "Mean";
- var Min = "Min";
- var Minimum = "Minimum";
- var Mod = "Mod";
- var Multiply = "Multiply";
- var Negate = "Negate";
- var NotEqual = "NotEqual";
- var NonMaxSuppressionV3 = "NonMaxSuppressionV3";
- var NonMaxSuppressionV4 = "NonMaxSuppressionV4";
- var NonMaxSuppressionV5 = "NonMaxSuppressionV5";
- var OnesLike = "OnesLike";
- var OneHot = "OneHot";
- var PadV2 = "PadV2";
- var Pool = "Pool";
- var Pow = "Pow";
- var Prelu = "Prelu";
- var Prod = "Prod";
- var Range = "Range";
- var Real = "Real";
- var Reciprocal = "Reciprocal";
- var Relu = "Relu";
- var Reshape = "Reshape";
- var ResizeNearestNeighbor = "ResizeNearestNeighbor";
- var ResizeNearestNeighborGrad = "ResizeNearestNeighborGrad";
- var ResizeBilinear = "ResizeBilinear";
- var ResizeBilinearGrad = "ResizeBilinearGrad";
- var Relu6 = "Relu6";
- var Reverse = "Reverse";
- var Round = "Round";
- var Rsqrt = "Rsqrt";
- var ScatterNd = "ScatterNd";
- var SelectV2 = "SelectV2";
- var Selu = "Selu";
- var Slice = "Slice";
- var Sin = "Sin";
- var Sinh = "Sinh";
- var Sign = "Sign";
- var Sigmoid = "Sigmoid";
- var Softplus = "Softplus";
- var Sqrt = "Sqrt";
- var Sum = "Sum";
- var SpaceToBatchND = "SpaceToBatchND";
- var SplitV = "SplitV";
- var Softmax = "Softmax";
- var SquaredDifference = "SquaredDifference";
- var Square = "Square";
- var Sub = "Sub";
- var SparseToDense = "SparseToDense";
- var StridedSlice = "StridedSlice";
- var Tan = "Tan";
- var Tanh = "Tanh";
- var Tile = "Tile";
- var TopK = "TopK";
- var Transpose = "Transpose";
- var Unique = "Unique";
- var Unpack = "Unpack";
- var UnsortedSegmentSum = "UnsortedSegmentSum";
- var ZerosLike = "ZerosLike";
- var Step = "Step";
- var FromPixels = "FromPixels";
- var RotateWithOffset = "RotateWithOffset";
- var _FusedMatMul = "_FusedMatMul";
- var FusedConv2D = "FusedConv2D";
- var FusedDepthwiseConv2D = "FusedDepthwiseConv2D";
- /**
- * @license
- * Copyright 2019 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var kernelRegistry = getGlobal("kernelRegistry", function() {
- return new Map();
- });
- var gradRegistry = getGlobal("gradRegistry", function() {
- return new Map();
- });
- function getKernel(kernelName, backendName) {
- var key = makeKey(kernelName, backendName);
- return kernelRegistry.get(key);
- }
- function getGradient(kernelName) {
- return gradRegistry.get(kernelName);
- }
- function getKernelsForBackend(backendName) {
- var it = kernelRegistry.entries();
- var result = [];
- while (true) {
- var _a = it.next(), done = _a.done, value = _a.value;
- if (done) {
- break;
- }
- var key = value[0], config = value[1];
- var backend2 = key.split("_")[0];
- if (backend2 === backendName) {
- result.push(config);
- }
- }
- return result;
- }
- function registerKernel(config) {
- var kernelName = config.kernelName, backendName = config.backendName;
- var key = makeKey(kernelName, backendName);
- if (kernelRegistry.has(key)) {
- console.warn("The kernel '" + kernelName + "' for backend " + ("'" + backendName + "' is already registered"));
- }
- kernelRegistry.set(key, config);
- }
- function registerGradient(config) {
- var kernelName = config.kernelName;
- if (gradRegistry.has(kernelName)) {
- if (env().getBool("DEBUG")) {
- console.warn("Overriding the gradient for '" + kernelName + "'");
- }
- }
- gradRegistry.set(kernelName, config);
- }
- function unregisterKernel(kernelName, backendName) {
- var key = makeKey(kernelName, backendName);
- if (!kernelRegistry.has(key)) {
- throw new Error("The kernel '" + kernelName + "' for backend " + ("'" + backendName + "' is not registered"));
- }
- kernelRegistry.delete(key);
- }
- function unregisterGradient(kernelName) {
- if (!gradRegistry.has(kernelName)) {
- throw new Error("The gradient '" + kernelName + "' for backend is not registered");
- }
- gradRegistry.delete(kernelName);
- }
- function copyRegisteredKernels(registeredBackendName, newBackendName) {
- var kernels = getKernelsForBackend(registeredBackendName);
- kernels.forEach(function(kernelConfig) {
- var newKernelConfig = Object.assign({}, kernelConfig, {backendName: newBackendName});
- registerKernel(newKernelConfig);
- });
- }
- function makeKey(kernelName, backendName) {
- return backendName + "_" + kernelName;
- }
- /**
- * @license
- * Copyright 2017 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
function shuffle(array) {
var counter = array.length;
var temp = 0;
@@ -1503,41 +1059,6 @@ var require_tf_core_node = __commonJS((exports) => {
}
return strides;
}
- function createScalarValue(value, dtype) {
- if (dtype === "string") {
- return encodeString(value);
- }
- return toTypedArray([value], dtype);
- }
- function toTypedArray(a, dtype) {
- if (dtype === "string") {
- throw new Error("Cannot convert a string[] to a TypedArray");
- }
- if (Array.isArray(a)) {
- a = flatten(a);
- }
- if (env().getBool("DEBUG")) {
- checkConversionForErrors(a, dtype);
- }
- if (noConversionNeeded(a, dtype)) {
- return a;
- }
- if (dtype == null || dtype === "float32" || dtype === "complex64") {
- return new Float32Array(a);
- } else if (dtype === "int32") {
- return new Int32Array(a);
- } else if (dtype === "bool") {
- var bool = new Uint8Array(a.length);
- for (var i = 0; i < bool.length; ++i) {
- if (Math.round(a[i]) !== 0) {
- bool[i] = 1;
- }
- }
- return bool;
- } else {
- throw new Error("Unknown data type " + dtype);
- }
- }
function createNestedArray(offset, shape, a) {
var ret = new Array();
if (shape.length === 1) {
@@ -1572,9 +1093,6 @@ var require_tf_core_node = __commonJS((exports) => {
}
return createNestedArray(0, shape, a);
}
- function noConversionNeeded(a, dtype) {
- return a instanceof Float32Array && dtype === "float32" || a instanceof Int32Array && dtype === "int32" || a instanceof Uint8Array && dtype === "bool";
- }
function makeOnesTypedArray(size, dtype) {
var array = makeZerosTypedArray(size, dtype);
for (var i = 0; i < array.length; i++) {
@@ -1607,9 +1125,6 @@ var require_tf_core_node = __commonJS((exports) => {
throw new Error("Unknown data type " + dtype);
}
}
- function now2() {
- return env().platform.now();
- }
function assertNonNegativeIntegerDimensions(shape) {
shape.forEach(function(dimSize) {
assert(Number.isInteger(dimSize) && dimSize >= 0, function() {
@@ -1617,23 +1132,6 @@ var require_tf_core_node = __commonJS((exports) => {
});
});
}
- function fetch$1(path, requestInits) {
- return env().platform.fetch(path, requestInits);
- }
- function encodeString(s, encoding) {
- if (encoding === void 0) {
- encoding = "utf-8";
- }
- encoding = encoding || "utf-8";
- return env().platform.encode(s, encoding);
- }
- function decodeString(bytes, encoding) {
- if (encoding === void 0) {
- encoding = "utf-8";
- }
- encoding = encoding || "utf-8";
- return env().platform.decode(bytes, encoding);
- }
function locToIndex(locs, rank, strides) {
if (rank === 0) {
return 0;
@@ -1660,8 +1158,534 @@ var require_tf_core_node = __commonJS((exports) => {
locs[locs.length - 1] = index;
return locs;
}
+ function isPromise(object) {
+ return object && object.then && typeof object.then === "function";
+ }
+ /**
+ * @license
+ * Copyright 2017 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var TENSORFLOWJS_FLAGS_PREFIX = "tfjsflags";
+ var Environment = function() {
+ function Environment2(global2) {
+ this.global = global2;
+ this.flags = {};
+ this.flagRegistry = {};
+ this.urlFlags = {};
+ this.populateURLFlags();
+ }
+ Environment2.prototype.setPlatform = function(platformName, platform) {
+ if (this.platform != null) {
+ console.warn("Platform " + this.platformName + " has already been set. " + ("Overwriting the platform with " + platform + "."));
+ }
+ this.platformName = platformName;
+ this.platform = platform;
+ };
+ Environment2.prototype.registerFlag = function(flagName, evaluationFn, setHook) {
+ this.flagRegistry[flagName] = {evaluationFn, setHook};
+ if (this.urlFlags[flagName] != null) {
+ var flagValue = this.urlFlags[flagName];
+ console.warn("Setting feature override from URL " + flagName + ": " + flagValue + ".");
+ this.set(flagName, flagValue);
+ }
+ };
+ Environment2.prototype.getAsync = function(flagName) {
+ return __awaiter(this, void 0, void 0, function() {
+ var _a, _b;
+ return __generator(this, function(_c) {
+ switch (_c.label) {
+ case 0:
+ if (flagName in this.flags) {
+ return [2, this.flags[flagName]];
+ }
+ _a = this.flags;
+ _b = flagName;
+ return [4, this.evaluateFlag(flagName)];
+ case 1:
+ _a[_b] = _c.sent();
+ return [2, this.flags[flagName]];
+ }
+ });
+ });
+ };
+ Environment2.prototype.get = function(flagName) {
+ if (flagName in this.flags) {
+ return this.flags[flagName];
+ }
+ var flagValue = this.evaluateFlag(flagName);
+ if (isPromise(flagValue)) {
+ throw new Error("Flag " + flagName + " cannot be synchronously evaluated. Please use getAsync() instead.");
+ }
+ this.flags[flagName] = flagValue;
+ return this.flags[flagName];
+ };
+ Environment2.prototype.getNumber = function(flagName) {
+ return this.get(flagName);
+ };
+ Environment2.prototype.getBool = function(flagName) {
+ return this.get(flagName);
+ };
+ Environment2.prototype.getFlags = function() {
+ return this.flags;
+ };
+ Object.defineProperty(Environment2.prototype, "features", {
+ get: function() {
+ return this.flags;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ Environment2.prototype.set = function(flagName, value) {
+ if (this.flagRegistry[flagName] == null) {
+ throw new Error("Cannot set flag " + flagName + " as it has not been registered.");
+ }
+ this.flags[flagName] = value;
+ if (this.flagRegistry[flagName].setHook != null) {
+ this.flagRegistry[flagName].setHook(value);
+ }
+ };
+ Environment2.prototype.evaluateFlag = function(flagName) {
+ if (this.flagRegistry[flagName] == null) {
+ throw new Error("Cannot evaluate flag '" + flagName + "': no evaluation function found.");
+ }
+ return this.flagRegistry[flagName].evaluationFn();
+ };
+ Environment2.prototype.setFlags = function(flags) {
+ this.flags = Object.assign({}, flags);
+ };
+ Environment2.prototype.reset = function() {
+ this.flags = {};
+ this.urlFlags = {};
+ this.populateURLFlags();
+ };
+ Environment2.prototype.populateURLFlags = function() {
+ var _this = this;
+ if (typeof this.global === "undefined" || typeof this.global.location === "undefined" || typeof this.global.location.search === "undefined") {
+ return;
+ }
+ var urlParams = getQueryParams(this.global.location.search);
+ if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {
+ var keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(",");
+ keyValues.forEach(function(keyValue) {
+ var _a = keyValue.split(":"), key = _a[0], value = _a[1];
+ _this.urlFlags[key] = parseValue(key, value);
+ });
+ }
+ };
+ return Environment2;
+ }();
+ function getQueryParams(queryString) {
+ var params = {};
+ queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, function(s) {
+ var t = [];
+ for (var _i2 = 1; _i2 < arguments.length; _i2++) {
+ t[_i2 - 1] = arguments[_i2];
+ }
+ decodeParam(params, t[0], t[1]);
+ return t.join("=");
+ });
+ return params;
+ }
+ function decodeParam(params, name, value) {
+ params[decodeURIComponent(name)] = decodeURIComponent(value || "");
+ }
+ function parseValue(flagName, value) {
+ value = value.toLowerCase();
+ if (value === "true" || value === "false") {
+ return value === "true";
+ } else if ("" + +value === value) {
+ return +value;
+ }
+ throw new Error("Could not parse value flag value " + value + " for flag " + flagName + ".");
+ }
+ function env() {
+ return exports.ENV;
+ }
+ exports.ENV = null;
+ function setEnvironmentGlobal(environment) {
+ exports.ENV = environment;
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var globalNameSpace;
+ function getGlobalNamespace() {
+ if (globalNameSpace == null) {
+ var ns = void 0;
+ if (typeof window !== "undefined") {
+ ns = window;
+ } else if (typeof global !== "undefined") {
+ ns = global;
+ } else if (typeof process !== "undefined") {
+ ns = process;
+ } else if (typeof self !== "undefined") {
+ ns = self;
+ } else {
+ throw new Error("Could not find a global object");
+ }
+ globalNameSpace = ns;
+ }
+ return globalNameSpace;
+ }
+ function getGlobalMap() {
+ var ns = getGlobalNamespace();
+ if (ns._tfGlobals == null) {
+ ns._tfGlobals = new Map();
+ }
+ return ns._tfGlobals;
+ }
+ function getGlobal(key, init) {
+ var globalMap = getGlobalMap();
+ if (globalMap.has(key)) {
+ return globalMap.get(key);
+ } else {
+ var singleton = init();
+ globalMap.set(key, singleton);
+ return globalMap.get(key);
+ }
+ }
+ var Abs = "Abs";
+ var Acos = "Acos";
+ var Acosh = "Acosh";
+ var Add = "Add";
+ var AddN = "AddN";
+ var All = "All";
+ var Any = "Any";
+ var ArgMax = "ArgMax";
+ var ArgMin = "ArgMin";
+ var Asin = "Asin";
+ var Asinh = "Asinh";
+ var Atan = "Atan";
+ var Atanh = "Atanh";
+ var Atan2 = "Atan2";
+ var AvgPool = "AvgPool";
+ var AvgPoolBackprop = "AvgPoolBackprop";
+ var AvgPool3D = "AvgPool3D";
+ var AvgPool3DBackprop = "AvgPool3DBackprop";
+ var BatchMatMul = "BatchMatMul";
+ var BatchToSpaceND = "BatchToSpaceND";
+ var BroadcastTo = "BroadcastTo";
+ var Cast = "Cast";
+ var Ceil = "Ceil";
+ var ClipByValue = "ClipByValue";
+ var Complex = "Complex";
+ var Concat = "Concat";
+ var Conv2D = "Conv2D";
+ var Conv2DBackpropFilter = "Conv2DBackpropFilter";
+ var Conv2DBackpropInput = "Conv2DBackpropInput";
+ var Conv3D = "Conv3D";
+ var Conv3DBackpropFilterV2 = "Conv3DBackpropFilterV2";
+ var Conv3DBackpropInputV2 = "Conv3DBackpropInputV2";
+ var Cos = "Cos";
+ var Cosh = "Cosh";
+ var Cumsum = "Cumsum";
+ var CropAndResize = "CropAndResize";
+ var DepthToSpace = "DepthToSpace";
+ var DepthwiseConv2dNative = "DepthwiseConv2dNative";
+ var DepthwiseConv2dNativeBackpropFilter = "DepthwiseConv2dNativeBackpropFilter";
+ var DepthwiseConv2dNativeBackpropInput = "DepthwiseConv2dNativeBackpropInput";
+ var Diag = "Diag";
+ var Dilation2D = "Dilation2D";
+ var Dilation2DBackpropInput = "Dilation2DBackpropInput";
+ var Dilation2DBackpropFilter = "Dilation2DBackpropFilter";
+ var Div = "Div";
+ var Elu = "Elu";
+ var EluGrad = "EluGrad";
+ var Erf = "Erf";
+ var Equal = "Equal";
+ var Exp = "Exp";
+ var Expm1 = "Expm1";
+ var FFT = "FFT";
+ var Fill = "Fill";
+ var FlipLeftRight = "FlipLeftRight";
+ var Floor = "Floor";
+ var FloorDiv = "FloorDiv";
+ var FusedBatchNorm = "FusedBatchNorm";
+ var GatherV2 = "GatherV2";
+ var GatherNd = "GatherNd";
+ var Greater = "Greater";
+ var GreaterEqual = "GreaterEqual";
+ var Identity = "Identity";
+ var IFFT = "IFFT";
+ var Imag = "Imag";
+ var IsFinite = "IsFinite";
+ var IsInf = "IsInf";
+ var IsNan = "IsNan";
+ var Less = "Less";
+ var LessEqual = "LessEqual";
+ var LinSpace = "LinSpace";
+ var Log = "Log";
+ var Log1p = "Log1p";
+ var LogicalAnd = "LogicalAnd";
+ var LogicalNot = "LogicalNot";
+ var LogicalOr = "LogicalOr";
+ var LogSoftmax = "LogSoftmax";
+ var LRN = "LRN";
+ var LRNBackprop = "LRNBackprop";
+ var Max = "Max";
+ var Maximum = "Maximum";
+ var MaxPool = "MaxPool";
+ var MaxPoolBackprop = "MaxPoolBackprop";
+ var MaxPool3D = "MaxPool3D";
+ var MaxPool3DBackprop = "MaxPool3DBackprop";
+ var MaxPoolWithArgmax = "MaxPoolWithArgmax";
+ var Mean = "Mean";
+ var Min = "Min";
+ var Minimum = "Minimum";
+ var MirrorPad = "MirrorPad";
+ var Mod = "Mod";
+ var Multiply = "Multiply";
+ var Negate = "Negate";
+ var NotEqual = "NotEqual";
+ var NonMaxSuppressionV3 = "NonMaxSuppressionV3";
+ var NonMaxSuppressionV4 = "NonMaxSuppressionV4";
+ var NonMaxSuppressionV5 = "NonMaxSuppressionV5";
+ var OnesLike = "OnesLike";
+ var OneHot = "OneHot";
+ var PadV2 = "PadV2";
+ var Pool = "Pool";
+ var Pow = "Pow";
+ var Prelu = "Prelu";
+ var Prod = "Prod";
+ var Range = "Range";
+ var Real = "Real";
+ var Reciprocal = "Reciprocal";
+ var Relu = "Relu";
+ var Reshape = "Reshape";
+ var ResizeNearestNeighbor = "ResizeNearestNeighbor";
+ var ResizeNearestNeighborGrad = "ResizeNearestNeighborGrad";
+ var ResizeBilinear = "ResizeBilinear";
+ var ResizeBilinearGrad = "ResizeBilinearGrad";
+ var Relu6 = "Relu6";
+ var Reverse = "Reverse";
+ var Round = "Round";
+ var Rsqrt = "Rsqrt";
+ var ScatterNd = "ScatterNd";
+ var SelectV2 = "SelectV2";
+ var Selu = "Selu";
+ var Slice = "Slice";
+ var Sin = "Sin";
+ var Sinh = "Sinh";
+ var Sign = "Sign";
+ var Sigmoid = "Sigmoid";
+ var Softplus = "Softplus";
+ var Sqrt = "Sqrt";
+ var Sum = "Sum";
+ var SpaceToBatchND = "SpaceToBatchND";
+ var SplitV = "SplitV";
+ var Softmax = "Softmax";
+ var SquaredDifference = "SquaredDifference";
+ var Square = "Square";
+ var Sub = "Sub";
+ var SparseToDense = "SparseToDense";
+ var StridedSlice = "StridedSlice";
+ var Tan = "Tan";
+ var Tanh = "Tanh";
+ var Tile = "Tile";
+ var TopK = "TopK";
+ var Transpose = "Transpose";
+ var Unique = "Unique";
+ var Unpack = "Unpack";
+ var UnsortedSegmentSum = "UnsortedSegmentSum";
+ var ZerosLike = "ZerosLike";
+ var Step = "Step";
+ var FromPixels = "FromPixels";
+ var RotateWithOffset = "RotateWithOffset";
+ var _FusedMatMul = "_FusedMatMul";
+ var FusedConv2D = "FusedConv2D";
+ var FusedDepthwiseConv2D = "FusedDepthwiseConv2D";
+ /**
+ * @license
+ * Copyright 2019 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var kernelRegistry = getGlobal("kernelRegistry", function() {
+ return new Map();
+ });
+ var gradRegistry = getGlobal("gradRegistry", function() {
+ return new Map();
+ });
+ function getKernel(kernelName, backendName) {
+ var key = makeKey(kernelName, backendName);
+ return kernelRegistry.get(key);
+ }
+ function getGradient(kernelName) {
+ return gradRegistry.get(kernelName);
+ }
+ function getKernelsForBackend(backendName) {
+ var it = kernelRegistry.entries();
+ var result = [];
+ while (true) {
+ var _a = it.next(), done = _a.done, value = _a.value;
+ if (done) {
+ break;
+ }
+ var key = value[0], config = value[1];
+ var backend2 = key.split("_")[0];
+ if (backend2 === backendName) {
+ result.push(config);
+ }
+ }
+ return result;
+ }
+ function registerKernel(config) {
+ var kernelName = config.kernelName, backendName = config.backendName;
+ var key = makeKey(kernelName, backendName);
+ if (kernelRegistry.has(key)) {
+ console.warn("The kernel '" + kernelName + "' for backend " + ("'" + backendName + "' is already registered"));
+ }
+ kernelRegistry.set(key, config);
+ }
+ function registerGradient(config) {
+ var kernelName = config.kernelName;
+ if (gradRegistry.has(kernelName)) {
+ if (env().getBool("DEBUG")) {
+ console.warn("Overriding the gradient for '" + kernelName + "'");
+ }
+ }
+ gradRegistry.set(kernelName, config);
+ }
+ function unregisterKernel(kernelName, backendName) {
+ var key = makeKey(kernelName, backendName);
+ if (!kernelRegistry.has(key)) {
+ throw new Error("The kernel '" + kernelName + "' for backend " + ("'" + backendName + "' is not registered"));
+ }
+ kernelRegistry.delete(key);
+ }
+ function unregisterGradient(kernelName) {
+ if (!gradRegistry.has(kernelName)) {
+ throw new Error("The gradient '" + kernelName + "' for backend is not registered");
+ }
+ gradRegistry.delete(kernelName);
+ }
+ function copyRegisteredKernels(registeredBackendName, newBackendName) {
+ var kernels = getKernelsForBackend(registeredBackendName);
+ kernels.forEach(function(kernelConfig) {
+ var newKernelConfig = Object.assign({}, kernelConfig, {backendName: newBackendName});
+ registerKernel(newKernelConfig);
+ });
+ }
+ function makeKey(kernelName, backendName) {
+ return backendName + "_" + kernelName;
+ }
+ /**
+ * @license
+ * Copyright 2017 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function createScalarValue(value, dtype) {
+ if (dtype === "string") {
+ return encodeString(value);
+ }
+ return toTypedArray([value], dtype);
+ }
+ function noConversionNeeded(a, dtype) {
+ return a instanceof Float32Array && dtype === "float32" || a instanceof Int32Array && dtype === "int32" || a instanceof Uint8Array && dtype === "bool";
+ }
+ function toTypedArray(a, dtype) {
+ if (dtype === "string") {
+ throw new Error("Cannot convert a string[] to a TypedArray");
+ }
+ if (Array.isArray(a)) {
+ a = flatten(a);
+ }
+ if (env().getBool("DEBUG")) {
+ checkConversionForErrors(a, dtype);
+ }
+ if (noConversionNeeded(a, dtype)) {
+ return a;
+ }
+ if (dtype == null || dtype === "float32" || dtype === "complex64") {
+ return new Float32Array(a);
+ } else if (dtype === "int32") {
+ return new Int32Array(a);
+ } else if (dtype === "bool") {
+ var bool = new Uint8Array(a.length);
+ for (var i = 0; i < bool.length; ++i) {
+ if (Math.round(a[i]) !== 0) {
+ bool[i] = 1;
+ }
+ }
+ return bool;
+ } else {
+ throw new Error("Unknown data type " + dtype);
+ }
+ }
+ function now2() {
+ return env().platform.now();
+ }
+ function fetch$1(path, requestInits) {
+ return env().platform.fetch(path, requestInits);
+ }
+ function encodeString(s, encoding) {
+ if (encoding === void 0) {
+ encoding = "utf-8";
+ }
+ encoding = encoding || "utf-8";
+ return env().platform.encode(s, encoding);
+ }
+ function decodeString(bytes, encoding) {
+ if (encoding === void 0) {
+ encoding = "utf-8";
+ }
+ encoding = encoding || "utf-8";
+ return env().platform.decode(bytes, encoding);
+ }
var util = {
__proto__: null,
+ createScalarValue,
+ toTypedArray,
+ now: now2,
+ fetch: fetch$1,
+ encodeString,
+ decodeString,
shuffle,
clamp,
nearestLargerEven,
@@ -1699,19 +1723,14 @@ var require_tf_core_node = __commonJS((exports) => {
isFunction,
nearestDivisor,
computeStrides,
- createScalarValue,
- toTypedArray,
toNestedArray,
makeOnesTypedArray,
makeZerosTypedArray,
makeZerosNestedTypedArray,
- now: now2,
assertNonNegativeIntegerDimensions,
- fetch: fetch$1,
- encodeString,
- decodeString,
locToIndex,
- indexToLoc
+ indexToLoc,
+ isPromise
};
/**
* @license
@@ -3665,7 +3684,7 @@ var require_tf_core_node = __commonJS((exports) => {
ENGINE.startScope(opName);
try {
var result = fn.apply(void 0, args);
- if (result instanceof Promise) {
+ if (isPromise(result)) {
console.error("Cannot return a Promise inside of tidy.");
}
ENGINE.endScope(result);
@@ -3968,6 +3987,8 @@ var require_tf_core_node = __commonJS((exports) => {
var realTensor = tensor(real2, shape, "float32");
var imageTensor = tensor(image2, shape, "float32");
out[name_2] = complex(realTensor, imageTensor);
+ realTensor.dispose();
+ imageTensor.dispose();
} else {
throw new Error("Unsupported dtype in weight '" + name_2 + "': " + dtype);
}
@@ -5924,34 +5945,33 @@ var require_tf_core_node = __commonJS((exports) => {
var $a = convertToTensor(a, "a", "matMul");
var $b = convertToTensor(b, "b", "matMul");
_a = makeTypesMatch($a, $b), $a = _a[0], $b = _a[1];
- assert($a.rank >= 2 && $b.rank >= 2 && $a.rank === $b.rank, function() {
- return "Error in matMul: inputs must have the same rank of at least 2, " + ("got ranks " + $a.rank + " and " + $b.rank + ".");
- });
- var innerShapeA = transposeA ? $a.shape[$a.rank - 2] : $a.shape[$a.rank - 1];
- var innerShapeB = transposeB ? $b.shape[$b.rank - 1] : $b.shape[$b.rank - 2];
- var outerShapeA = transposeA ? $a.shape[$a.rank - 1] : $a.shape[$a.rank - 2];
- var outerShapeB = transposeB ? $b.shape[$b.rank - 2] : $b.shape[$b.rank - 1];
- var outerDimsA = $a.shape.slice(0, -2);
- var outerDimsB = $b.shape.slice(0, -2);
- var batchDimA = sizeFromShape(outerDimsA);
- var batchDimB = sizeFromShape(outerDimsB);
- assert(arraysEqual(outerDimsA, outerDimsB), function() {
- return "Error in matMul: outer dimensions (" + outerDimsA + ") and (" + (outerDimsB + ") of Tensors with shapes " + $a.shape + " and ") + ($b.shape + " must match.");
- });
- assert(innerShapeA === innerShapeB, function() {
- return "Error in matMul: inner shapes (" + innerShapeA + ") and (" + (innerShapeB + ") of Tensors with shapes " + $a.shape + " and ") + ($b.shape + " and transposeA=" + transposeA) + (" and transposeB=" + transposeB + " must match.");
- });
- var outShape = $a.shape.slice(0, -2).concat([outerShapeA, outerShapeB]);
- var a3D = transposeA ? reshape($a, [batchDimA, innerShapeA, outerShapeA]) : reshape($a, [batchDimA, outerShapeA, innerShapeA]);
- var b3D = transposeB ? reshape($b, [batchDimB, outerShapeB, innerShapeB]) : reshape($b, [batchDimB, innerShapeB, outerShapeB]);
var forward = function(backend2, save) {
- save([a3D, b3D]);
- return backend2.batchMatMul(a3D, b3D, transposeA, transposeB);
+ save([$a, $b]);
+ var innerShapeA = transposeA ? $a.shape[$a.rank - 2] : $a.shape[$a.rank - 1];
+ var innerShapeB = transposeB ? $b.shape[$b.rank - 1] : $b.shape[$b.rank - 2];
+ var outerShapeA = transposeA ? $a.shape[$a.rank - 1] : $a.shape[$a.rank - 2];
+ var outerShapeB = transposeB ? $b.shape[$b.rank - 2] : $b.shape[$b.rank - 1];
+ var outerDimsA = $a.shape.slice(0, -2);
+ var outerDimsB = $b.shape.slice(0, -2);
+ var batchDimA = sizeFromShape(outerDimsA);
+ var batchDimB = sizeFromShape(outerDimsB);
+ var batchDimsCompatible = batchDimA === batchDimB || batchDimA === 1 || batchDimB === 1;
+ assert($a.rank >= 2 && $b.rank >= 2 && batchDimsCompatible, function() {
+ return "Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input " + ("batch dimensions of (" + outerDimsA + ") and (" + outerDimsB + ").");
+ });
+ assert(innerShapeA === innerShapeB, function() {
+ return "Error in matMul: inner shapes (" + innerShapeA + ") and (" + (innerShapeB + ") of Tensors with shapes " + $a.shape + " and ") + ($b.shape + " and transposeA=" + transposeA) + (" and transposeB=" + transposeB + " must match.");
+ });
+ var outShapeOuterDims = batchDimA > batchDimB ? outerDimsA : outerDimsB;
+ var outShape = outShapeOuterDims.concat([outerShapeA, outerShapeB]);
+ var a3D = transposeA ? reshape($a, [batchDimA, innerShapeA, outerShapeA]) : reshape($a, [batchDimA, outerShapeA, innerShapeA]);
+ var b3D = transposeB ? reshape($b, [batchDimB, outerShapeB, innerShapeB]) : reshape($b, [batchDimB, innerShapeB, outerShapeB]);
+ var res3d = backend2.batchMatMul(a3D, b3D, transposeA, transposeB);
+ return reshape(res3d, outShape);
};
- var inputs = {a: a3D, b: b3D};
+ var inputs = {a: $a, b: $b};
var attrs = {transposeA, transposeB};
- var res = ENGINE.runKernelFunc(forward, inputs, null, BatchMatMul, attrs);
- return reshape(res, outShape);
+ return ENGINE.runKernelFunc(forward, inputs, null, BatchMatMul, attrs);
}
var matMul = op({matMul_});
/**
@@ -6069,7 +6089,8 @@ var require_tf_core_node = __commonJS((exports) => {
var oneHotLabels = oneHot(cast($labels, "int32"), numClasses);
var oneHotPredictions = oneHot(cast($predictions, "int32"), numClasses);
var oneHotLabelsT = transpose(oneHotLabels);
- return cast(matMul(oneHotLabelsT, oneHotPredictions), "int32");
+ var product = matMul(oneHotLabelsT, oneHotPredictions);
+ return cast(product, "int32");
}
var confusionMatrix = op({confusionMatrix_});
/**
@@ -6838,7 +6859,7 @@ var require_tf_core_node = __commonJS((exports) => {
expectArrayBuffersEqual
};
/** @license See the LICENSE file. */
- var version = "2.6.0";
+ var version = "2.7.0";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
@@ -8910,8 +8931,8 @@ var require_tf_core_node = __commonJS((exports) => {
var convInfo = computeConv3DInfo(xShape5D, filter.shape, strides, dilations, pad2);
return backend2.conv3dDerInput(dy5D, filter, convInfo);
};
- var inputs = {dy: dy5D};
- var attrs = {pad: pad2};
+ var inputs = {dy: dy5D, filter};
+ var attrs = {pad: pad2, strides, inputShape: xShape5D};
var res = ENGINE.runKernelFunc(forward, inputs, null, Conv3DBackpropInputV2, attrs);
if (reshapedTo5D) {
return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]);
@@ -11064,11 +11085,16 @@ var require_tf_core_node = __commonJS((exports) => {
var shapes = computeOutAndReduceShapes($x.shape, axes);
var reduceShape = shapes[1];
var reduceSize = sizeFromShape(reduceShape);
- var customOp = customGrad(function(x2) {
+ var inputs = {x: $x};
+ var attrs = {axis, keepDims};
+ var forward = function() {
var reduceSizeScalar = scalar(reduceSize);
- var xReduce = reduceSizeScalar.dtype === x2.dtype ? x2 : cast(x2, reduceSizeScalar.dtype);
+ var xReduce = reduceSizeScalar.dtype === $x.dtype ? $x : cast($x, reduceSizeScalar.dtype);
var res = div(xReduce, reduceSizeScalar);
- var value = sum$1(res, axis, keepDims);
+ return sum$1(res, axis, keepDims);
+ };
+ var customOp = customGrad(function(x2) {
+ var value = ENGINE.runKernelFunc(forward, inputs, null, Mean, attrs);
var gradFunc = function(dy) {
var expandedDyShape = x2.shape.slice();
axes.forEach(function(axis2) {
@@ -11153,6 +11179,50 @@ var require_tf_core_node = __commonJS((exports) => {
return ENGINE.runKernelFunc(forward, inputs, null, Minimum);
}
var minimum = op({minimum_});
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function mirrorPad_(x, paddings, mode) {
+ assert(mode === "reflect" || mode === "symmetric", function() {
+ return "Invalid mode. Mode must be either reflect or symmetric. " + ("Got " + mode + ".");
+ });
+ var $x = convertToTensor(x, "x", "mirrorPad");
+ if ($x.rank === 0) {
+ throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");
+ }
+ assert(paddings.length === $x.rank, function() {
+ return "Padding doesn't match input. Must be " + $x.rank + ". " + ("Got " + paddings.length + ".");
+ });
+ var shapeOffset = mode === "reflect" ? 1 : 0;
+ var _loop_1 = function(i2) {
+ assert(paddings[i2].length === 2, function() {
+ return "Invalid number of paddings. Must be length of 2 each.";
+ });
+ assert(paddings[i2][0] >= 0 && paddings[i2][0] <= $x.shape[i2] - shapeOffset && paddings[i2][1] >= 0 && paddings[i2][1] <= $x.shape[i2] - shapeOffset, function() {
+ return "Padding in dimension " + i2 + " cannot be greater than or equal " + ("to " + ($x.shape[i2] - shapeOffset) + " or less than 0 for input of ") + ("shape " + $x.shape);
+ });
+ };
+ for (var i = 0; i < $x.rank; i++) {
+ _loop_1(i);
+ }
+ var attrs = {paddings, mode};
+ var inputs = {x: $x};
+ return ENGINE.runKernel(MirrorPad, inputs, attrs);
+ }
+ var mirrorPad = op({mirrorPad_});
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -11693,10 +11763,10 @@ var require_tf_core_node = __commonJS((exports) => {
keepDims = false;
}
var $x = convertToTensor(x, "x", "prod");
+ if ($x.dtype === "bool") {
+ $x = cast($x, "int32");
+ }
var forward = function(backend2) {
- if ($x.dtype === "bool") {
- $x = cast($x, "int32");
- }
var axes = parseAxisParam(axis, $x.shape);
var permutation = getAxesPermutation(axes, $x.rank);
var reductionAxes = axes;
@@ -14807,7 +14877,7 @@ var require_tf_core_node = __commonJS((exports) => {
return backend2.conv2dDerFilter(x4D, dy4D, convInfo);
};
var inputs = {x: x4D, dy: dy4D};
- var attrs = {strides, pad: pad2, dataFormat, dimRoundingMode};
+ var attrs = {strides, pad: pad2, dataFormat, dimRoundingMode, filterShape};
return ENGINE.runKernelFunc(forward, inputs, null, Conv2DBackpropFilter, attrs);
}
var conv2DBackpropFilter = op({conv2DBackpropFilter_});
@@ -14999,7 +15069,10 @@ var require_tf_core_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, convInfo) {
+ function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad2, dilations, dimRoundingMode) {
+ if (dilations === void 0) {
+ dilations = [1, 1];
+ }
var x4D = x;
if (x.rank === 3) {
x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]);
@@ -15009,10 +15082,12 @@ var require_tf_core_node = __commonJS((exports) => {
dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);
}
var forward = function(backend2) {
+ var convInfo = computeConv2DInfo(x.shape, filterShape, strides, dilations, pad2, dimRoundingMode, true);
return backend2.depthwiseConv2DDerFilter(x4D, dy4D, convInfo);
};
var inputs = {x: x4D, dy: dy4D};
- return ENGINE.runKernelFunc(forward, inputs, null, DepthwiseConv2dNativeBackpropFilter);
+ var attrs = {strides, pad: pad2, dimRoundingMode, dilations, filterShape};
+ return ENGINE.runKernelFunc(forward, inputs, null, DepthwiseConv2dNativeBackpropFilter, attrs);
}
var depthwiseConv2dNativeBackpropFilter = op({depthwiseConv2dNativeBackpropFilter_});
/**
@@ -15031,7 +15106,10 @@ var require_tf_core_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, convInfo) {
+ function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad2, dilations, dimRoundingMode) {
+ if (dilations === void 0) {
+ dilations = [1, 1];
+ }
var dy4D = dy;
var reshapedTo4D = false;
if (dy.rank === 3) {
@@ -15039,10 +15117,12 @@ var require_tf_core_node = __commonJS((exports) => {
dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]);
}
var forward = function(backend2) {
+ var convInfo = computeConv2DInfo(xShape, filter.shape, strides, dilations, pad2, dimRoundingMode, true);
return backend2.depthwiseConv2DDerInput(dy4D, filter, convInfo);
};
- var inputs = {dy: dy4D};
- var res = ENGINE.runKernelFunc(forward, inputs, null, DepthwiseConv2dNativeBackpropInput);
+ var inputs = {dy: dy4D, filter};
+ var attrs = {strides, pad: pad2, dimRoundingMode, dilations, inputShape: xShape};
+ var res = ENGINE.runKernelFunc(forward, inputs, null, DepthwiseConv2dNativeBackpropInput, attrs);
if (reshapedTo4D) {
return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);
}
@@ -15119,8 +15199,8 @@ var require_tf_core_node = __commonJS((exports) => {
});
var $filter2 = saved[0], x4D2 = saved[1], y = saved[2], bias2 = saved[3];
var dyActivation = getFusedDyActivation(dy, y, activation);
- var xDer = depthwiseConv2dNativeBackpropInput(x4D2.shape, dyActivation, $filter2, convInfo);
- var filterDer = depthwiseConv2dNativeBackpropFilter(x4D2, dyActivation, $filter2.shape, convInfo);
+ var xDer = depthwiseConv2dNativeBackpropInput(x4D2.shape, dyActivation, $filter2, strides, pad2, dilations, dimRoundingMode);
+ var filterDer = depthwiseConv2dNativeBackpropFilter(x4D2, dyActivation, $filter2.shape, strides, pad2, dilations, dimRoundingMode);
if (bias2 != null) {
var biasDer = getFusedBiasGradient($bias, dyActivation);
return [xDer, filterDer, biasDer];
@@ -19031,8 +19111,8 @@ var require_tf_core_node = __commonJS((exports) => {
kernelName: BatchMatMul,
inputsToSave: ["a", "b"],
gradFunc: function(dy, saved, attrs) {
- var _a = saved, a = _a[0], b = _a[1];
- var _b = attrs, transposeA = _b.transposeA, transposeB = _b.transposeB;
+ var a = saved[0], b = saved[1];
+ var _a = attrs, transposeA = _a.transposeA, transposeB = _a.transposeB;
if (!transposeA && !transposeB) {
return {
a: function() {
@@ -19363,8 +19443,8 @@ var require_tf_core_node = __commonJS((exports) => {
var convInfo = computeConv3DInfo(x5D.shape, filterShape, strides, dilations, pad2);
return backend2.conv3dDerFilter(x5D, dy5D, convInfo);
};
- var inputs = {x: x5D, y: dy5D};
- var attrs = {strides, pad: pad2};
+ var inputs = {x: x5D, dy: dy5D};
+ var attrs = {strides, pad: pad2, filterShape};
return ENGINE.runKernelFunc(forward, inputs, null, Conv3DBackpropFilterV2, attrs);
}
var conv3DBackpropFilter = op({conv3DBackpropFilter_});
@@ -19532,13 +19612,12 @@ var require_tf_core_node = __commonJS((exports) => {
return "Error in depthwiseConv2d: pad must be an integer when using, " + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad2 + ".");
});
}
- var convInfo = computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad2, dimRoundingMode, true);
return {
x: function() {
- return depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, convInfo);
+ return depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad2, dilations, dimRoundingMode);
},
filter: function() {
- return depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, convInfo);
+ return depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad2, dilations, dimRoundingMode);
}
};
}
@@ -20229,7 +20308,7 @@ var require_tf_core_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- function gradForMinAndMax(dy, y, xOrig, origAxes, permutedAxes) {
+ function gradForMinAndMax(dy, y, xOrig, origAxes) {
if (y.rank < xOrig.rank) {
y = reshape(y, expandShapeToKeepDim(y.shape, origAxes));
}
@@ -20239,7 +20318,7 @@ var require_tf_core_node = __commonJS((exports) => {
return {
x: function() {
var dx = mul(dy, cast(equal(xOrig, y), dy.dtype));
- return permutedAxes == null ? dx : transpose(dx, permutedAxes);
+ return dx;
}
};
}
@@ -20266,17 +20345,13 @@ var require_tf_core_node = __commonJS((exports) => {
gradFunc: function(dy, saved, attrs) {
var maxAttrs = attrs;
var reductionIndices = maxAttrs.reductionIndices;
- var x = saved[0], y = saved[1];
+ var x = saved[0];
+ var y = saved[1];
var origAxes = parseAxisParam(reductionIndices, x.shape);
- var permutedAxes = getAxesPermutation(origAxes, x.rank);
- var maxGrad = gradForMinAndMax(dy, y, x, origAxes, permutedAxes);
+ var maxGrad = gradForMinAndMax(dy, y, x, origAxes);
return {
x: function() {
- var out = maxGrad["x"]();
- if (permutedAxes != null) {
- out = transpose(out);
- }
- return out;
+ return maxGrad["x"]();
}
};
}
@@ -20515,15 +20590,10 @@ var require_tf_core_node = __commonJS((exports) => {
var axis = minAttrs.axis;
var x = saved[0], y = saved[1];
var origAxes = parseAxisParam(axis, x.shape);
- var permutedAxes = getAxesPermutation(origAxes, x.rank);
- var minGrad = gradForMinAndMax(dy, y, x, origAxes, permutedAxes);
+ var minGrad = gradForMinAndMax(dy, y, x, origAxes);
return {
x: function() {
- var out = minGrad["x"]();
- if (permutedAxes != null) {
- out = transpose(out);
- }
- return out;
+ return minGrad["x"]();
}
};
}
@@ -20558,6 +20628,36 @@ var require_tf_core_node = __commonJS((exports) => {
return {a: derA, b: derB};
}
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var mirrorPadGradConfig = {
+ kernelName: MirrorPad,
+ inputsToSave: ["x"],
+ gradFunc: function(dy, saved, attrs) {
+ var x = saved[0];
+ var paddings = attrs.paddings;
+ var begin = paddings.map(function(p) {
+ return p[0];
+ });
+ return {x: function() {
+ return slice(dy, begin, x.shape);
+ }};
+ }
+ };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -21870,6 +21970,7 @@ var require_tf_core_node = __commonJS((exports) => {
maxPoolGradConfig,
minGradConfig,
minimumGradConfig,
+ mirrorPadGradConfig,
modGradConfig,
multiplyGradConfig,
negateGradConfig,
@@ -23686,6 +23787,26 @@ var require_tf_core_node = __commonJS((exports) => {
this.throwIfDisposed();
return minimum(this, b);
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ Tensor.prototype.mirrorPad = function(paddings, mode) {
+ this.throwIfDisposed();
+ return mirrorPad(this, paddings, mode);
+ };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -25031,6 +25152,7 @@ var require_tf_core_node = __commonJS((exports) => {
exports.Mean = Mean;
exports.Min = Min;
exports.Minimum = Minimum;
+ exports.MirrorPad = MirrorPad;
exports.Mod = Mod;
exports.MomentumOptimizer = MomentumOptimizer;
exports.Multiply = Multiply;
@@ -25236,6 +25358,7 @@ var require_tf_core_node = __commonJS((exports) => {
exports.min = min;
exports.minimum = minimum;
exports.minimumStrict = minimumStrict;
+ exports.mirrorPad = mirrorPad;
exports.mod = mod;
exports.modStrict = modStrict;
exports.moments = moments;
@@ -29447,7 +29570,7 @@ var require_tf_layers_node = __commonJS((exports) => {
}
}
/** @license See the LICENSE file. */
- var version = "2.6.0";
+ var version = "2.7.0";
/**
* @license
* Copyright 2018 Google LLC
@@ -39095,6 +39218,32 @@ var require_tf_converter_node = __commonJS((exports) => {
return {value: op[0] ? op[1] : void 0, done: true};
}
}
+ function __read(o, n) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
+ if (!m)
+ return o;
+ var i = m.call(o), r, ar = [], e;
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
+ ar.push(r.value);
+ } catch (error) {
+ e = {error};
+ } finally {
+ try {
+ if (r && !r.done && (m = i["return"]))
+ m.call(i);
+ } finally {
+ if (e)
+ throw e.error;
+ }
+ }
+ return ar;
+ }
+ function __spread() {
+ for (var ar = [], i = 0; i < arguments.length; i++)
+ ar = ar.concat(__read(arguments[i]));
+ return ar;
+ }
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
@@ -39202,29 +39351,35 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- function getParamValue(paramName, node, tensorMap, context) {
+ function getParamValue(paramName, node, tensorMap, context, resourceManager) {
var inputParam = node.inputParams[paramName];
if (inputParam && inputParam.inputIndexStart !== void 0) {
var start = inputParam.inputIndexStart;
var end = inputParam.inputIndexEnd === 0 ? void 0 : inputParam.inputIndexEnd === void 0 ? start + 1 : inputParam.inputIndexEnd;
if (inputParam.type === "tensor") {
- return getTensor(node.inputNames[inputParam.inputIndexStart], tensorMap, context);
+ return getTensor(node.inputNames[inputParam.inputIndexStart], tensorMap, context, resourceManager);
}
if (inputParam.type === "tensors") {
var inputs = node.inputNames.slice(start, end);
return inputs.map(function(name) {
- return getTensor(name, tensorMap, context);
+ return getTensor(name, tensorMap, context, resourceManager);
});
}
- var tensor = getTensor(node.inputNames.slice(start)[0], tensorMap, context);
+ var tensor = getTensor(node.inputNames.slice(start)[0], tensorMap, context, resourceManager);
var data = tensor.dataSync();
return inputParam.type === "number" ? data[0] : tfOps.util.toNestedArray(tensor.shape, data);
}
var attrParam = node.attrParams[paramName];
return attrParam && attrParam.value;
}
- function getTensor(name, tensorsMap, context) {
- var _a = parseNodeName(name), nodeName = _a[0], index = _a[1];
+ function getTensor(name, tensorsMap, context, resourceManager) {
+ var _a = __read(parseNodeName(name), 2), nodeName = _a[0], index = _a[1];
+ if (resourceManager != null) {
+ var tensor = resourceManager.getHashTableHandleByName(nodeName);
+ if (tensor != null) {
+ return tensor;
+ }
+ }
var contextId = context.currentContextIds.find(function(contextId2) {
return !!tensorsMap[getNodeNameWithContextId(nodeName, contextId2)];
});
@@ -39234,7 +39389,7 @@ var require_tf_converter_node = __commonJS((exports) => {
return tensorsMap[getNodeNameWithContextId(name, context.currentContextId)];
}
function getNodeNameAndIndex(inputName, context) {
- var _a = parseNodeName(inputName), nodeName = _a[0], index = _a[1];
+ var _a = __read(parseNodeName(inputName), 2), nodeName = _a[0], index = _a[1];
return [
getNodeNameWithContextId(nodeName, context && context.currentContextId),
index
@@ -39941,22 +40096,6 @@ var require_tf_converter_node = __commonJS((exports) => {
__proto__: null,
json: json$1
};
- /**
- * @license
- * Copyright 2018 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
var json$2 = [
{
tfOpName: "LoopCond",
@@ -40284,7 +40423,9 @@ var require_tf_converter_node = __commonJS((exports) => {
{start: 0, name: "tensorListId", type: "tensor"},
{start: 1, name: "tensor", type: "tensor"}
],
- attrs: [{tfName: "element_dtype", name: "elementDType", type: "dtype"}]
+ attrs: [
+ {tfName: "element_dtype", name: "elementDType", type: "dtype"}
+ ]
}
];
var control = {
@@ -41097,6 +41238,114 @@ var require_tf_converter_node = __commonJS((exports) => {
__proto__: null,
json: json$7
};
+ var json$8 = [
+ {
+ tfOpName: "HashTable",
+ category: "hash_table",
+ inputs: [],
+ attrs: [
+ {tfName: "shared_name", name: "sharedName", type: "string"},
+ {
+ tfName: "use_node_name_sharing",
+ name: "useNodeNameSharing",
+ type: "bool"
+ },
+ {tfName: "key_dtype", name: "keyDType", type: "dtype"},
+ {tfName: "value_dtype", name: "valueDType", type: "dtype"}
+ ]
+ },
+ {
+ tfOpName: "HashTableV2",
+ category: "hash_table",
+ inputs: [],
+ attrs: [
+ {tfName: "shared_name", name: "sharedName", type: "string"},
+ {
+ tfName: "use_node_name_sharing",
+ name: "useNodeNameSharing",
+ type: "bool"
+ },
+ {tfName: "key_dtype", name: "keyDType", type: "dtype"},
+ {tfName: "value_dtype", name: "valueDType", type: "dtype"}
+ ]
+ },
+ {
+ tfOpName: "LookupTableImport",
+ category: "hash_table",
+ inputs: [
+ {start: 0, name: "tableHandle", type: "tensor"},
+ {start: 1, name: "keys", type: "tensor"},
+ {start: 2, name: "values", type: "tensor"}
+ ],
+ attrs: [
+ {tfName: "Tin", name: "tIn", type: "dtype", notSupported: true},
+ {
+ tfName: "Tout",
+ name: "tOut",
+ type: "dtype",
+ notSupported: true
+ }
+ ]
+ },
+ {
+ tfOpName: "LookupTableImportV2",
+ category: "hash_table",
+ inputs: [
+ {start: 0, name: "tableHandle", type: "tensor"},
+ {start: 1, name: "keys", type: "tensor"},
+ {start: 2, name: "values", type: "tensor"}
+ ],
+ attrs: [
+ {tfName: "Tin", name: "tIn", type: "dtype", notSupported: true},
+ {
+ tfName: "Tout",
+ name: "tOut",
+ type: "dtype",
+ notSupported: true
+ }
+ ]
+ },
+ {
+ tfOpName: "LookupTableFind",
+ category: "hash_table",
+ inputs: [
+ {start: 0, name: "tableHandle", type: "tensor"},
+ {start: 1, name: "keys", type: "tensor"},
+ {start: 2, name: "defaultValue", type: "tensor"}
+ ],
+ attrs: [
+ {tfName: "Tin", name: "tIn", type: "dtype", notSupported: true},
+ {
+ tfName: "Tout",
+ name: "tOut",
+ type: "dtype",
+ notSupported: true
+ }
+ ]
+ },
+ {
+ tfOpName: "LookupTableFindV2",
+ category: "hash_table",
+ inputs: [
+ {start: 0, name: "tableHandle", type: "tensor"},
+ {start: 1, name: "keys", type: "tensor"},
+ {start: 2, name: "defaultValue", type: "tensor"}
+ ],
+ attrs: [
+ {tfName: "Tin", name: "tIn", type: "dtype", notSupported: true},
+ {
+ tfName: "Tout",
+ name: "tOut",
+ type: "dtype",
+ notSupported: true
+ }
+ ]
+ }
+ ];
+ var hashTable = {
+ __proto__: null,
+ json: json$8
+ };
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
@@ -41113,7 +41362,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var json$8 = [
+ var json$9 = [
{
tfOpName: "ResizeBilinear",
category: "image",
@@ -41159,7 +41408,7 @@ var require_tf_converter_node = __commonJS((exports) => {
];
var image = {
__proto__: null,
- json: json$8
+ json: json$9
};
/**
* @license
@@ -41177,7 +41426,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var json$9 = [
+ var json$a = [
{
tfOpName: "Equal",
category: "logical",
@@ -41306,7 +41555,7 @@ var require_tf_converter_node = __commonJS((exports) => {
];
var logical = {
__proto__: null,
- json: json$9
+ json: json$a
};
/**
* @license
@@ -41324,7 +41573,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var json$a = [
+ var json$b = [
{
tfOpName: "_FusedMatMul",
category: "matrices",
@@ -41448,7 +41697,7 @@ var require_tf_converter_node = __commonJS((exports) => {
];
var matrices = {
__proto__: null,
- json: json$a
+ json: json$b
};
/**
* @license
@@ -41466,7 +41715,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var json$b = [
+ var json$c = [
{
tfOpName: "FusedBatchNorm",
category: "normalization",
@@ -41600,7 +41849,7 @@ var require_tf_converter_node = __commonJS((exports) => {
];
var normalization = {
__proto__: null,
- json: json$b
+ json: json$c
};
/**
* @license
@@ -41618,7 +41867,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var json$c = [
+ var json$d = [
{
tfOpName: "Max",
category: "reduction",
@@ -41713,7 +41962,7 @@ var require_tf_converter_node = __commonJS((exports) => {
];
var reduction = {
__proto__: null,
- json: json$c
+ json: json$d
};
/**
* @license
@@ -41731,7 +41980,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var json$d = [
+ var json$e = [
{
tfOpName: "ConcatV2",
category: "slice_join",
@@ -41938,7 +42187,7 @@ var require_tf_converter_node = __commonJS((exports) => {
];
var sliceJoin = {
__proto__: null,
- json: json$d
+ json: json$e
};
/**
* @license
@@ -41956,7 +42205,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var json$e = [
+ var json$f = [
{
tfOpName: "FFT",
category: "spectral",
@@ -41996,7 +42245,7 @@ var require_tf_converter_node = __commonJS((exports) => {
];
var spectral = {
__proto__: null,
- json: json$e
+ json: json$f
};
/**
* @license
@@ -42014,7 +42263,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var json$f = [
+ var json$g = [
{
tfOpName: "Cast",
category: "transformation",
@@ -42039,6 +42288,15 @@ var require_tf_converter_node = __commonJS((exports) => {
{start: 1, name: "axis", type: "number"}
]
},
+ {
+ tfOpName: "MirrorPad",
+ category: "transformation",
+ inputs: [
+ {start: 0, name: "x", type: "tensor"},
+ {start: 1, name: "padding", type: "number[]"}
+ ],
+ attrs: [{tfName: "mode", name: "mode", type: "string"}]
+ },
{
tfOpName: "Pad",
category: "transformation",
@@ -42129,7 +42387,7 @@ var require_tf_converter_node = __commonJS((exports) => {
];
var transformation = {
__proto__: null,
- json: json$f
+ json: json$g
};
/**
* @license
@@ -42165,11 +42423,12 @@ var require_tf_converter_node = __commonJS((exports) => {
reduction,
sliceJoin,
spectral,
- transformation
+ transformation,
+ hashTable
];
- var mappersJson = [].concat.apply([], ops.map(function(op) {
+ var mappersJson = [].concat.apply([], __spread(ops.map(function(op) {
return op.json;
- }));
+ })));
this.opMappers = mappersJson.reduce(function(map, mapper) {
map[mapper.tfOpName] = mapper;
return map;
@@ -42214,7 +42473,7 @@ var require_tf_converter_node = __commonJS((exports) => {
allNodes.forEach(function(key) {
var node = nodes[key];
node.inputNames.forEach(function(name) {
- var nodeName = getNodeNameAndIndex(name)[0];
+ var _a = __read(getNodeNameAndIndex(name), 1), nodeName = _a[0];
node.inputs.push(nodes[nodeName]);
nodes[nodeName].children.push(node);
});
@@ -42228,7 +42487,7 @@ var require_tf_converter_node = __commonJS((exports) => {
});
} else {
Object.keys(outputNodeNameToKey).forEach(function(name) {
- var nodeName = getNodeNameAndIndex(name)[0];
+ var _a = __read(getNodeNameAndIndex(name), 1), nodeName = _a[0];
var node = nodes[nodeName];
if (node != null) {
node.signatureKey = outputNodeNameToKey[name];
@@ -42238,7 +42497,7 @@ var require_tf_converter_node = __commonJS((exports) => {
}
if (Object.keys(inputNodeNameToKey).length > 0) {
Object.keys(inputNodeNameToKey).forEach(function(name) {
- var nodeName = getNodeNameAndIndex(name)[0];
+ var _a = __read(getNodeNameAndIndex(name), 1), nodeName = _a[0];
var node = nodes[nodeName];
if (node) {
node.signatureKey = inputNodeNameToKey[name];
@@ -42396,7 +42655,7 @@ var require_tf_converter_node = __commonJS((exports) => {
var inputs = [];
var outputs = [];
functionDef.signature.inputArg.forEach(function(arg) {
- var nodeName = getNodeNameAndIndex(arg.name)[0];
+ var _a = __read(getNodeNameAndIndex(arg.name), 1), nodeName = _a[0];
var node = {
name: nodeName,
op: "Placeholder",
@@ -42415,14 +42674,14 @@ var require_tf_converter_node = __commonJS((exports) => {
allNodes.forEach(function(key) {
var node = nodes[key];
node.inputNames.forEach(function(name) {
- var nodeName = getNodeNameAndIndex(name)[0];
+ var _a = __read(getNodeNameAndIndex(name), 1), nodeName = _a[0];
node.inputs.push(nodes[nodeName]);
nodes[nodeName].children.push(node);
});
});
var returnNodeMap = functionDef.ret;
functionDef.signature.outputArg.forEach(function(output) {
- var _a = getNodeNameAndIndex(returnNodeMap[output.name]), nodeName = _a[0], index = _a[1];
+ var _a = __read(getNodeNameAndIndex(returnNodeMap[output.name]), 2), nodeName = _a[0], index = _a[1];
var node = nodes[nodeName];
if (node != null) {
node.defaultOutput = index;
@@ -43031,7 +43290,7 @@ var require_tf_converter_node = __commonJS((exports) => {
if (indices.length !== tensor.shape[0]) {
throw new Error("Expected len(indices) == tensor.shape[0], but saw: " + indices.length + " vs. " + tensor.shape[0]);
}
- var maxIndex = Math.max.apply(Math, indices);
+ var maxIndex = Math.max.apply(Math, __spread(indices));
if (!this.dynamicSize && maxIndex >= this.maxSize) {
throw new Error("Max index must be < array size (" + maxIndex + " vs. " + this.maxSize + ")");
}
@@ -43118,7 +43377,7 @@ var require_tf_converter_node = __commonJS((exports) => {
configurable: true
});
TensorList2.prototype.copy = function() {
- return new TensorList2(this.tensors.slice(), this.elementShape, this.elementDtype);
+ return new TensorList2(__spread(this.tensors), this.elementShape, this.elementDtype);
};
TensorList2.prototype.clearAndClose = function(keepIds) {
this.tensors.forEach(function(tensor) {
@@ -43261,7 +43520,7 @@ var require_tf_converter_node = __commonJS((exports) => {
if (indices.length !== tensor.shape[0]) {
throw new Error("Expected len(indices) == tensor.shape[0], but saw: " + indices.length + " vs. " + tensor.shape[0]);
}
- var maxIndex = Math.max.apply(Math, indices);
+ var maxIndex = Math.max.apply(Math, __spread(indices));
if (numElements != null && numElements !== -1 && maxIndex >= numElements) {
throw new Error("Max index must be < array size (" + maxIndex + " vs. " + numElements + ")");
}
@@ -43677,7 +43936,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* =============================================================================
*/
function fusedConvAndDepthWiseParams(node, tensorMap, context) {
- var _a = getParamValue("fusedOps", node, tensorMap, context), extraOp = _a[0], activationFunc = _a[1];
+ var _a = __read(getParamValue("fusedOps", node, tensorMap, context), 2), extraOp = _a[0], activationFunc = _a[1];
var isBiasAdd = extraOp === "biasadd";
var isPrelu = activationFunc === "prelu";
var isBatchNorm = extraOp === "fusedbatchnorm";
@@ -43697,7 +43956,7 @@ var require_tf_converter_node = __commonJS((exports) => {
var pad = getPadding(node, tensorMap, context);
var dataFormat = getParamValue("dataFormat", node, tensorMap, context).toUpperCase();
var dilations = getParamValue("dilations", node, tensorMap, context);
- var _b = getParamValue("args", node, tensorMap, context), biasArg = _b[0], preluArg = _b[1];
+ var _b = __read(getParamValue("args", node, tensorMap, context), 2), biasArg = _b[0], preluArg = _b[1];
return {
stride,
pad,
@@ -44090,6 +44349,171 @@ var require_tf_converter_node = __commonJS((exports) => {
throw TypeError("Node type " + node.op + " is not implemented");
}
};
+ var HashTable = function() {
+ function HashTable2(keyDType, valueDType) {
+ this.keyDType = keyDType;
+ this.valueDType = valueDType;
+ this.handle = tfOps.scalar(0);
+ this.tensorMap = new Map();
+ tfOps.keep(this.handle);
+ }
+ Object.defineProperty(HashTable2.prototype, "id", {
+ get: function() {
+ return this.handle.id;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ HashTable2.prototype.clearAndClose = function() {
+ this.tensorMap.forEach(function(value) {
+ return value.dispose();
+ });
+ this.tensorMap.clear();
+ this.handle.dispose();
+ };
+ HashTable2.prototype.size = function() {
+ return this.tensorMap.size;
+ };
+ HashTable2.prototype.import = function(keys, values) {
+ return __awaiter(this, void 0, void 0, function() {
+ var $keys;
+ var _this2 = this;
+ return __generator(this, function(_a) {
+ switch (_a.label) {
+ case 0:
+ this.checkKeyAndValueTensor(keys, values);
+ return [4, keys.data()];
+ case 1:
+ $keys = _a.sent();
+ this.tensorMap.forEach(function(value) {
+ return value.dispose();
+ });
+ this.tensorMap.clear();
+ return [2, tfOps.tidy(function() {
+ var $values = tfOps.unstack(values);
+ var keysLength = $keys.length;
+ var valuesLength = $values.length;
+ tfOps.util.assert(keysLength === valuesLength, function() {
+ return "The number of elements doesn't match, keys has " + (keysLength + " elements, the values has " + valuesLength + " ") + "elements.";
+ });
+ for (var i = 0; i < keysLength; i++) {
+ var key = $keys[i];
+ var value = $values[i];
+ tfOps.keep(value);
+ _this2.tensorMap.set(key, value);
+ }
+ return _this2.handle;
+ })];
+ }
+ });
+ });
+ };
+ HashTable2.prototype.find = function(keys, defaultValue) {
+ return __awaiter(this, void 0, void 0, function() {
+ var $keys;
+ var _this2 = this;
+ return __generator(this, function(_a) {
+ switch (_a.label) {
+ case 0:
+ this.checkKeyAndValueTensor(keys, defaultValue);
+ return [4, keys.data()];
+ case 1:
+ $keys = _a.sent();
+ return [2, tfOps.tidy(function() {
+ var result = [];
+ for (var i = 0; i < $keys.length; i++) {
+ var key = $keys[i];
+ var value = _this2.findWithDefault(key, defaultValue);
+ result.push(value);
+ }
+ return tfOps.stack(result);
+ })];
+ }
+ });
+ });
+ };
+ HashTable2.prototype.findWithDefault = function(key, defaultValue) {
+ var result = this.tensorMap.get(key);
+ return result != null ? result : defaultValue;
+ };
+ HashTable2.prototype.checkKeyAndValueTensor = function(key, value) {
+ if (key.dtype !== this.keyDType) {
+ throw new Error("Expect key dtype " + this.keyDType + ", but got " + ("" + key.dtype));
+ }
+ if (value.dtype !== this.valueDType) {
+ throw new Error("Expect value dtype " + this.valueDType + ", but got " + ("" + value.dtype));
+ }
+ };
+ return HashTable2;
+ }();
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var _this$2 = void 0;
+ var executeOp$8 = function(node, tensorMap, context, resourceManager) {
+ return __awaiter(_this$2, void 0, void 0, function() {
+ var _a, keyDType, valueDType, hashTable2, handle, keys, values, hashTable2, handle, keys, defaultValue, hashTable2;
+ return __generator(this, function(_b) {
+ switch (_b.label) {
+ case 0:
+ _a = node.op;
+ switch (_a) {
+ case "HashTable":
+ return [3, 1];
+ case "HashTableV2":
+ return [3, 1];
+ case "LookupTableImport":
+ return [3, 2];
+ case "LookupTableImportV2":
+ return [3, 2];
+ case "LookupTableFind":
+ return [3, 4];
+ case "LookupTableFindV2":
+ return [3, 4];
+ }
+ return [3, 6];
+ case 1: {
+ keyDType = getParamValue("keyDType", node, tensorMap, context);
+ valueDType = getParamValue("valueDType", node, tensorMap, context);
+ hashTable2 = new HashTable(keyDType, valueDType);
+ resourceManager.addHashTable(node.name, hashTable2);
+ return [2, [hashTable2.handle]];
+ }
+ case 2:
+ handle = getParamValue("tableHandle", node, tensorMap, context, resourceManager);
+ keys = getParamValue("keys", node, tensorMap, context);
+ values = getParamValue("values", node, tensorMap, context);
+ hashTable2 = resourceManager.getHashTableById(handle.id);
+ return [4, hashTable2.import(keys, values)];
+ case 3:
+ return [2, [_b.sent()]];
+ case 4:
+ handle = getParamValue("tableHandle", node, tensorMap, context, resourceManager);
+ keys = getParamValue("keys", node, tensorMap, context);
+ defaultValue = getParamValue("defaultValue", node, tensorMap, context);
+ hashTable2 = resourceManager.getHashTableById(handle.id);
+ return [4, hashTable2.find(keys, defaultValue)];
+ case 5:
+ return [2, [_b.sent()]];
+ case 6:
+ throw TypeError("Node type " + node.op + " is not implemented");
+ }
+ });
+ });
+ };
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
@@ -44106,7 +44530,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var executeOp$8 = function(node, tensorMap, context) {
+ var executeOp$9 = function(node, tensorMap, context) {
switch (node.op) {
case "ResizeBilinear": {
var images = getParamValue("images", node, tensorMap, context);
@@ -44149,7 +44573,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var executeOp$9 = function(node, tensorMap, context) {
+ var executeOp$a = function(node, tensorMap, context) {
switch (node.op) {
case "Equal": {
return [tfOps.equal(getParamValue("a", node, tensorMap, context), getParamValue("b", node, tensorMap, context))];
@@ -44202,7 +44626,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var executeOp$a = function(node, tensorMap, context) {
+ var executeOp$b = function(node, tensorMap, context) {
switch (node.op) {
case "BatchMatMul":
case "BatchMatMulV2":
@@ -44211,7 +44635,7 @@ var require_tf_converter_node = __commonJS((exports) => {
case "Transpose":
return [tfOps.transpose(getParamValue("x", node, tensorMap, context), getParamValue("perm", node, tensorMap, context))];
case "_FusedMatMul":
- var _a = getParamValue("fusedOps", node, tensorMap, context), extraOp = _a[0], activationFunc = _a[1];
+ var _a = __read(getParamValue("fusedOps", node, tensorMap, context), 2), extraOp = _a[0], activationFunc = _a[1];
var isBiasAdd = extraOp === "biasadd";
var isPrelu = activationFunc === "prelu";
var numArgs = getParamValue("numArgs", node, tensorMap, context);
@@ -44223,7 +44647,7 @@ var require_tf_converter_node = __commonJS((exports) => {
throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.");
}
}
- var _b = getParamValue("args", node, tensorMap, context), biasArg = _b[0], preluArg = _b[1];
+ var _b = __read(getParamValue("args", node, tensorMap, context), 2), biasArg = _b[0], preluArg = _b[1];
return [tfOps.fused.matMul({
a: getParamValue("a", node, tensorMap, context),
b: getParamValue("b", node, tensorMap, context),
@@ -44253,7 +44677,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var executeOp$b = function(node, tensorMap, context) {
+ var executeOp$c = function(node, tensorMap, context) {
switch (node.op) {
case "FusedBatchNorm":
case "FusedBatchNormV2": {
@@ -44294,7 +44718,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var executeOp$c = function(node, tensorMap, context) {
+ var executeOp$d = function(node, tensorMap, context) {
switch (node.op) {
case "Max": {
var axis = getParamValue("axis", node, tensorMap, context);
@@ -44365,7 +44789,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var executeOp$d = function(node, tensorMap, context) {
+ var executeOp$e = function(node, tensorMap, context) {
switch (node.op) {
case "ConcatV2":
case "Concat": {
@@ -44475,7 +44899,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var executeOp$e = function(node, tensorMap, context) {
+ var executeOp$f = function(node, tensorMap, context) {
switch (node.op) {
case "FFT": {
return [tfOps.fft(getParamValue("x", node, tensorMap, context))];
@@ -44509,7 +44933,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var executeOp$f = function(node, tensorMap, context) {
+ var executeOp$g = function(node, tensorMap, context) {
switch (node.op) {
case "Cast": {
return [tfOps.cast(getParamValue("x", node, tensorMap, context), getParamValue("dtype", node, tensorMap, context))];
@@ -44525,6 +44949,9 @@ var require_tf_converter_node = __commonJS((exports) => {
case "Reshape": {
return [tfOps.reshape(getParamValue("x", node, tensorMap, context), getParamValue("shape", node, tensorMap, context))];
}
+ case "MirrorPad": {
+ return [tfOps.mirrorPad(getParamValue("x", node, tensorMap, context), getParamValue("padding", node, tensorMap, context), getParamValue("mode", node, tensorMap, context))];
+ }
case "PadV2":
case "Pad": {
return [tfOps.pad(getParamValue("x", node, tensorMap, context), getParamValue("padding", node, tensorMap, context), getParamValue("constantValue", node, tensorMap, context))];
@@ -44567,7 +44994,7 @@ var require_tf_converter_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- function executeOp$g(node, tensorMap, context) {
+ function executeOp$h(node, tensorMap, context, resourceManager) {
var value = function(node2, tensorMap2, context2) {
switch (node2.category) {
case "arithmetic":
@@ -44596,7 +45023,7 @@ var require_tf_converter_node = __commonJS((exports) => {
});
case "image":
return tfOps.tidy(function() {
- return executeOp$8(node2, tensorMap2, context2);
+ return executeOp$9(node2, tensorMap2, context2);
});
case "graph":
return tfOps.tidy(function() {
@@ -44604,32 +45031,34 @@ var require_tf_converter_node = __commonJS((exports) => {
});
case "logical":
return tfOps.tidy(function() {
- return executeOp$9(node2, tensorMap2, context2);
+ return executeOp$a(node2, tensorMap2, context2);
});
case "matrices":
return tfOps.tidy(function() {
- return executeOp$a(node2, tensorMap2, context2);
+ return executeOp$b(node2, tensorMap2, context2);
});
case "normalization":
return tfOps.tidy(function() {
- return executeOp$b(node2, tensorMap2, context2);
+ return executeOp$c(node2, tensorMap2, context2);
});
case "reduction":
return tfOps.tidy(function() {
- return executeOp$c(node2, tensorMap2, context2);
+ return executeOp$d(node2, tensorMap2, context2);
});
case "slice_join":
return tfOps.tidy(function() {
- return executeOp$d(node2, tensorMap2, context2);
+ return executeOp$e(node2, tensorMap2, context2);
});
case "spectral":
return tfOps.tidy(function() {
- return executeOp$e(node2, tensorMap2, context2);
+ return executeOp$f(node2, tensorMap2, context2);
});
case "transformation":
return tfOps.tidy(function() {
- return executeOp$f(node2, tensorMap2, context2);
+ return executeOp$g(node2, tensorMap2, context2);
});
+ case "hash_table":
+ return executeOp$8(node2, tensorMap2, context2, resourceManager);
case "custom":
var opMapper = getRegisteredOp(node2.op);
if (opMapper && opMapper.customExecutor) {
@@ -44641,7 +45070,7 @@ var require_tf_converter_node = __commonJS((exports) => {
throw TypeError("Unknown op '" + node2.op + "'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()");
}
}(node, tensorMap, context);
- if (value instanceof Promise) {
+ if (tfOps.util.isPromise(value)) {
return value.then(function(data) {
return [].concat(data);
});
@@ -44801,10 +45230,10 @@ var require_tf_converter_node = __commonJS((exports) => {
return parseNodeName(node2.name)[0];
});
}
- var frontier = outputs.slice();
+ var frontier = __spread(outputs);
while (frontier.length > 0) {
var node = frontier.pop();
- if (isControlFlow(node) || isDynamicShape(node)) {
+ if (isControlFlow(node) || isDynamicShape(node) || isHashTable(node)) {
if (dynamicNode == null) {
dynamicNode = node;
syncInputs = dynamicNode.children.map(function(child) {
@@ -44899,12 +45328,23 @@ var require_tf_converter_node = __commonJS((exports) => {
"NonMaxSuppressionV5",
"Where"
];
+ var HASH_TABLE_OPS = [
+ "HashTable",
+ "HashTableV2",
+ "LookupTableImport",
+ "LookupTableImportV2",
+ "LookupTableFind",
+ "LookupTableFindV2"
+ ];
function isControlFlow(node) {
return CONTROL_FLOW_OPS.indexOf(node.op) >= 0;
}
function isDynamicShape(node) {
return DYNAMIC_SHAPE_OPS.indexOf(node.op) >= 0;
}
+ function isHashTable(node) {
+ return HASH_TABLE_OPS.indexOf(node.op) >= 0;
+ }
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
@@ -44966,12 +45406,19 @@ var require_tf_converter_node = __commonJS((exports) => {
return tensor.id;
});
});
- this._weightIds = [].concat.apply([], weightIds);
+ this._weightIds = [].concat.apply([], __spread(weightIds));
this._weightMap = weightMap;
},
enumerable: true,
configurable: true
});
+ Object.defineProperty(GraphExecutor2.prototype, "resourceManager", {
+ set: function(resourceManager) {
+ this._resourceManager = resourceManager;
+ },
+ enumerable: true,
+ configurable: true
+ });
Object.defineProperty(GraphExecutor2.prototype, "inputs", {
get: function() {
return this._inputs.map(function(node) {
@@ -45084,7 +45531,7 @@ var require_tf_converter_node = __commonJS((exports) => {
var context = new ExecutionContext(_this2.weightMap, tensorArrayMap, tensorListMap, _this2.functionExecutorMap);
var tensorsMap = __assign({}, _this2.weightMap);
Object.keys(inputs).forEach(function(name) {
- var _a = parseNodeName(name), nodeName = _a[0], index = _a[1];
+ var _a = __read(parseNodeName(name), 2), nodeName = _a[0], index = _a[1];
var tensors2 = [];
tensors2[index] = inputs[name];
tensorsMap[nodeName] = tensors2;
@@ -45094,8 +45541,8 @@ var require_tf_converter_node = __commonJS((exports) => {
for (var i = 0; i < orderedNodes.length; i++) {
var node = orderedNodes[i];
if (!tensorsMap[node.name]) {
- var tensors = executeOp$g(node, tensorsMap, context);
- if (tensors instanceof Promise) {
+ var tensors = executeOp$h(node, tensorsMap, context, _this2._resourceManager);
+ if (tfOps.util.isPromise(tensors)) {
throw new Error("The execution of the op '" + node.op + "' returned a promise. Please use model.executeAsync() instead.");
}
tensorsMap[node.name] = tensors;
@@ -45190,7 +45637,7 @@ var require_tf_converter_node = __commonJS((exports) => {
inputIds = Object.keys(inputs).map(function(name) {
return inputs[name].id;
});
- keepIds = new Set(outputIds.concat(inputIds, this.weightIds));
+ keepIds = new Set(__spread(outputIds, inputIds, this.weightIds));
Object.keys(tensorMap).forEach(function(key) {
var tensorArray = tensorMap[key];
tensorArray.forEach(function(tensor) {
@@ -45237,13 +45684,16 @@ var require_tf_converter_node = __commonJS((exports) => {
outputNodes = outputNodeNames.map(function(name) {
return _this2.graph.nodes[name];
});
- _a = getExecutionSubgraph(inputs, outputNodes, this.weightMap), usedNodes = _a.usedNodes, missingInputs = _a.missingInputs, dynamicNode = _a.dynamicNode, syncInputs = _a.syncInputs;
- stack = inputNodes.concat(this.graph.weights).map(function(node) {
+ if (outputNodes.length === 0) {
+ outputNodes = this._outputs;
+ }
+ _a = getExecutionSubgraph(inputs, outputNodes, this.weightMap, this._initNodes), usedNodes = _a.usedNodes, missingInputs = _a.missingInputs, dynamicNode = _a.dynamicNode, syncInputs = _a.syncInputs;
+ stack = __spread(inputNodes, this.graph.weights, this._initNodes || []).map(function(node) {
return {node, contexts: context.currentContext};
});
tensorsMap = __assign({}, this.weightMap);
Object.keys(inputs).forEach(function(name) {
- var _a2 = parseNodeName(name), nodeName = _a2[0], index = _a2[1];
+ var _a2 = __read(parseNodeName(name), 2), nodeName = _a2[0], index = _a2[1];
var tensors = [];
tensors[index] = inputs[name];
tensorsMap[nodeName] = tensors;
@@ -45285,19 +45735,20 @@ var require_tf_converter_node = __commonJS((exports) => {
var _this2 = this;
var promises = [];
var _loop_1 = function() {
+ var _a, _b;
var item = stack.pop();
context.currentContext = item.contexts;
var nodeName = "";
if (item.node.op === "Enter" && getParamValue("isConstant", item.node, tensorMap, context)) {
- nodeName = getNodeNameAndIndex(item.node.name, context)[0];
+ _a = __read(getNodeNameAndIndex(item.node.name, context), 1), nodeName = _a[0];
}
- if (inputNodes.indexOf(item.node) === -1) {
- var tensors = executeOp$g(item.node, tensorMap, context);
+ if (tensorMap[item.node.name] == null) {
+ var tensors = executeOp$h(item.node, tensorMap, context, this_1._resourceManager);
if (!nodeName) {
- nodeName = getNodeNameAndIndex(item.node.name, context)[0];
+ _b = __read(getNodeNameAndIndex(item.node.name, context), 1), nodeName = _b[0];
}
var currentContext_1 = context.currentContext;
- if (tensors instanceof Promise) {
+ if (tfOps.util.isPromise(tensors)) {
promises.push(tensors.then(function(t) {
tensorMap[nodeName] = t;
context.currentContext = currentContext_1;
@@ -45322,7 +45773,7 @@ var require_tf_converter_node = __commonJS((exports) => {
};
GraphExecutor2.prototype.processChildNodes = function(node, stack, context, tensorMap, added, usedNodes) {
node.children.forEach(function(childNode) {
- var nodeName = getNodeNameAndIndex(childNode.name, context)[0];
+ var _a = __read(getNodeNameAndIndex(childNode.name, context), 1), nodeName = _a[0];
if (added[nodeName] || !usedNodes.has(childNode.name)) {
return;
}
@@ -45353,7 +45804,7 @@ var require_tf_converter_node = __commonJS((exports) => {
var _this2 = this;
Object.keys(inputs).forEach(function(name) {
var input = inputs[name];
- var nodeName = parseNodeName(name)[0];
+ var _a = __read(parseNodeName(name), 1), nodeName = _a[0];
var node = _this2.graph.nodes[nodeName];
if (node.attrParams["shape"] && node.attrParams["shape"].value) {
var shape_1 = node.attrParams["shape"].value;
@@ -45386,7 +45837,7 @@ var require_tf_converter_node = __commonJS((exports) => {
GraphExecutor2.prototype.checkInputs = function(inputs) {
var _this2 = this;
var notInGraph = Object.keys(inputs).filter(function(name) {
- var nodeName = parseNodeName(name)[0];
+ var _a = __read(parseNodeName(name), 1), nodeName = _a[0];
return _this2.graph.nodes[nodeName] == null;
});
if (notInGraph.length > 0) {
@@ -45406,7 +45857,7 @@ var require_tf_converter_node = __commonJS((exports) => {
GraphExecutor2.prototype.checkOutputs = function(outputs) {
var _this2 = this;
outputs.forEach(function(name) {
- var normalizedName = parseNodeName(name)[0];
+ var _a = __read(parseNodeName(name), 1), normalizedName = _a[0];
if (!_this2.graph.nodes[normalizedName]) {
throw new Error("The output '" + name + "' is not found in the graph");
}
@@ -45414,6 +45865,39 @@ var require_tf_converter_node = __commonJS((exports) => {
};
return GraphExecutor2;
}();
+ var ResourceManager = function() {
+ function ResourceManager2(hashTableNameToHandle, hashTableMap) {
+ if (hashTableNameToHandle === void 0) {
+ hashTableNameToHandle = {};
+ }
+ if (hashTableMap === void 0) {
+ hashTableMap = {};
+ }
+ this.hashTableNameToHandle = hashTableNameToHandle;
+ this.hashTableMap = hashTableMap;
+ }
+ ResourceManager2.prototype.addHashTable = function(name, hashTable2) {
+ this.hashTableNameToHandle[name] = hashTable2.handle;
+ this.hashTableMap[hashTable2.id] = hashTable2;
+ };
+ ResourceManager2.prototype.getHashTableHandleByName = function(name) {
+ return this.hashTableNameToHandle[name];
+ };
+ ResourceManager2.prototype.getHashTableById = function(id) {
+ return this.hashTableMap[id];
+ };
+ ResourceManager2.prototype.dispose = function() {
+ for (var key in this.hashTableMap) {
+ this.hashTableMap[key].clearAndClose();
+ delete this.hashTableMap[key];
+ }
+ for (var name_1 in this.hashTableNameToHandle) {
+ this.hashTableNameToHandle[name_1].dispose();
+ delete this.hashTableNameToHandle[name_1];
+ }
+ };
+ return ResourceManager2;
+ }();
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
@@ -45443,6 +45927,7 @@ var require_tf_converter_node = __commonJS((exports) => {
if (loadOptions == null) {
this.loadOptions = {};
}
+ this.resourceManager = new ResourceManager();
}
Object.defineProperty(GraphModel2.prototype, "modelVersion", {
get: function() {
@@ -45531,11 +46016,13 @@ var require_tf_converter_node = __commonJS((exports) => {
var weightMap = tfOps.io.decodeWeights(this.artifacts.weightData, this.artifacts.weightSpecs);
this.executor = new GraphExecutor(OperationMapper.Instance.transformGraph(graph2, signature));
this.executor.weightMap = this.convertTensorMapToTensorsMap(weightMap);
+ this.executor.resourceManager = this.resourceManager;
if (artifacts.modelInitializer != null) {
var initializer = OperationMapper.Instance.transformGraph(artifacts.modelInitializer);
this.initializer = new GraphExecutor(initializer);
this.initializer.weightMap = this.executor.weightMap;
- this.initializer.execute({}, []);
+ this.initializer.resourceManager = this.resourceManager;
+ this.initializer.executeAsync({}, []);
}
return true;
};
@@ -45612,6 +46099,7 @@ var require_tf_converter_node = __commonJS((exports) => {
if (this.initializer) {
this.initializer.dispose();
}
+ this.resourceManager.dispose();
};
return GraphModel2;
}();
@@ -45648,7 +46136,7 @@ var require_tf_converter_node = __commonJS((exports) => {
});
}
/** @license See the LICENSE file. */
- var version = "2.6.0";
+ var version = "2.7.0";
exports.GraphModel = GraphModel;
exports.deregisterOp = deregisterOp;
exports.loadGraphModel = loadGraphModel;
@@ -46542,7 +47030,7 @@ var require_tf_data_node = __commonJS((exports) => {
return [3, 4];
key = _a[_i];
value = seen.get(key);
- if (!(value instanceof Promise))
+ if (!tf2.util.isPromise(value))
return [3, 3];
return [4, value];
case 2:
@@ -49362,7 +49850,7 @@ var require_tf_data_node = __commonJS((exports) => {
});
}
/** @license See the LICENSE file. */
- var version = "2.6.0";
+ var version = "2.7.0";
exports.CSVDataset = CSVDataset;
exports.Dataset = Dataset;
exports.FileDataSource = FileDataSource;
@@ -50076,22 +50564,22 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
return new (P || (P = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
- step(generator.next(value));
+ step2(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
- step(generator["throw"](value));
+ step2(generator["throw"](value));
} catch (e) {
reject(e);
}
}
- function step(result) {
+ function step2(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
- step((generator = generator.apply(thisArg, _arguments || [])).next());
+ step2((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
@@ -50105,10 +50593,10 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
}), g;
function verb(n) {
return function(v) {
- return step([n, v]);
+ return step2([n, v]);
};
}
- function step(op) {
+ function step2(op) {
if (f)
throw new TypeError("Generator is already executing.");
while (_)
@@ -50219,20 +50707,6 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var tile = tf2.kernel_impls.tile;
var topkImpl = tf2.kernel_impls.topkImpl;
var whereImpl = tf2.kernel_impls.whereImpl;
- function mapActivation(backend, x, activation, preluActivationWeights) {
- if (activation === "linear") {
- return backend.linear(x);
- } else if (activation === "relu") {
- return backend.relu(x);
- } else if (activation === "elu") {
- return tf2.elu(x);
- } else if (activation === "relu6") {
- return backend.relu6(x);
- } else if (activation === "prelu") {
- return backend.prelu(x, preluActivationWeights);
- }
- throw new Error("Activation " + activation + " has not been implemented for the CPU backend.");
- }
var MathBackendCPU = function(_super) {
__extends(MathBackendCPU2, _super);
function MathBackendCPU2() {
@@ -50246,7 +50720,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
if (this.firstUse) {
this.firstUse = false;
if (tf2.env().get("IS_NODE")) {
- tf2.backend_util.warn("\n============================\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================");
+ tf2.backend_util.warn("\n============================\nHi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================");
}
}
var dataId = {};
@@ -50254,7 +50728,15 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
return dataId;
};
MathBackendCPU2.prototype.makeTensorInfo = function(shape, dtype, values) {
- var outId = this.write(values, shape, dtype);
+ var outId;
+ if (dtype === "string" && values != null && values.length > 0 && tf2.util.isString(values[0])) {
+ var encodedValues = values.map(function(d) {
+ return tf2.util.encodeString(d);
+ });
+ outId = this.write(encodedValues, shape, dtype);
+ } else {
+ outId = this.write(values, shape, dtype);
+ }
return {dataId: outId, shape, dtype};
};
MathBackendCPU2.prototype.incRef = function(dataId) {
@@ -50444,53 +50926,6 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
return Math.pow(aValue, bValue);
});
};
- MathBackendCPU2.prototype.batchMatMul = function(a, b, transposeA, transposeB) {
- assertNotComplex([a, b], "matMul");
- var sharedDim = transposeA ? a.shape[1] : a.shape[2];
- var leftDim = transposeA ? a.shape[2] : a.shape[1];
- var rightDim = transposeB ? b.shape[1] : b.shape[2];
- var batchDim = a.shape[0];
- var aValues = this.readSync(a.dataId);
- var bValues = this.readSync(b.dataId);
- var _a = transposeA ? [a.strides[0], 1, a.strides[1]] : [a.strides[0], a.strides[1], 1], aBatch = _a[0], aOuterStep = _a[1], aInnerStep = _a[2];
- var _b = transposeB ? [1, b.strides[1], b.strides[0]] : [b.strides[1], 1, b.strides[0]], bInnerStep = _b[0], bOuterStep = _b[1], bBatch = _b[2];
- var size = leftDim * rightDim;
- var result = tf2.buffer([batchDim, leftDim, rightDim], a.dtype);
- var resVals = result.values;
- var blockSize = this.blockSize;
- for (var b_1 = 0; b_1 < batchDim; b_1++) {
- for (var i0 = 0; i0 < leftDim; i0 += blockSize) {
- for (var j0 = 0; j0 < rightDim; j0 += blockSize) {
- for (var k0 = 0; k0 < sharedDim; k0 += blockSize) {
- var iBlock = Math.min(i0 + blockSize, leftDim);
- var jBlock = Math.min(j0 + blockSize, rightDim);
- var kBlock = Math.min(k0 + blockSize, sharedDim);
- for (var i = i0; i < iBlock; i++) {
- for (var j = j0; j < jBlock; j++) {
- var sum = 0;
- for (var k = k0; k < kBlock; k++) {
- sum += aValues[b_1 * aBatch + i * aOuterStep + k * aInnerStep] * bValues[k * bInnerStep + j * bOuterStep + b_1 * bBatch];
- }
- resVals[b_1 * size + (i * rightDim + j)] += sum;
- }
- }
- }
- }
- }
- }
- return result.toTensor();
- };
- MathBackendCPU2.prototype.fusedBatchMatMul = function(_a) {
- var a = _a.a, b = _a.b, transposeA = _a.transposeA, transposeB = _a.transposeB, bias = _a.bias, activation = _a.activation, preluActivationWeights = _a.preluActivationWeights;
- var result = this.batchMatMul(a, b, transposeA, transposeB);
- if (bias) {
- result = tf2.add(result, bias);
- }
- if (activation) {
- result = mapActivation(this, result, activation, preluActivationWeights);
- }
- return result;
- };
MathBackendCPU2.prototype.floorDiv = function(a, b) {
assertNotComplex([a, b], "floorDiv");
var op = function(a6, b2) {
@@ -50794,35 +51229,6 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
return diff * diff;
});
};
- MathBackendCPU2.prototype.linear = function(x) {
- return x;
- };
- MathBackendCPU2.prototype.relu = function(x) {
- assertNotComplex(x, "relu");
- var res = tf2.zeros(x.shape, x.dtype);
- var resVals = this.readSync(res.dataId);
- var inVals = this.readSync(x.dataId);
- for (var i = 0; i < inVals.length; ++i) {
- resVals[i] = Math.max(0, inVals[i]);
- }
- return res;
- };
- MathBackendCPU2.prototype.relu6 = function(x) {
- assertNotComplex(x, "relu");
- var res = tf2.zeros(x.shape, x.dtype);
- var resVals = this.readSync(res.dataId);
- var inVals = this.readSync(x.dataId);
- for (var i = 0; i < inVals.length; ++i) {
- resVals[i] = Math.min(Math.max(0, inVals[i]), 6);
- }
- return res;
- };
- MathBackendCPU2.prototype.prelu = function(x, a) {
- assertNotComplex([x, a], "prelu");
- return this.broadcastedBinaryOp(x, a, x.dtype, function(xValue, aValue) {
- return xValue < 0 ? aValue * xValue : xValue;
- });
- };
MathBackendCPU2.prototype.eluDer = function(dy, y) {
assertNotComplex([dy, y], "eluDer");
var resultValues = new Float32Array(y.size);
@@ -50844,490 +51250,6 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
return Math.atan2(aValue, bValue);
});
};
- MathBackendCPU2.prototype.fusedConv2d = function(_a) {
- var input = _a.input, filter = _a.filter, convInfo = _a.convInfo, bias = _a.bias, activation = _a.activation, preluActivationWeights = _a.preluActivationWeights;
- var result = this.conv2d(input, filter, convInfo);
- if (bias) {
- result = tf2.add(result, bias);
- }
- if (activation) {
- result = mapActivation(this, result, activation, preluActivationWeights);
- }
- return result;
- };
- MathBackendCPU2.prototype.conv2d = function(x, filter, convInfo) {
- assertNotComplex([x, filter], "conv2d");
- var filterHeight = convInfo.filterHeight;
- var filterWidth = convInfo.filterWidth;
- var dilationHeight = convInfo.dilationHeight;
- var dilationWidth = convInfo.dilationWidth;
- var padLeft = convInfo.padInfo.left;
- var padTop = convInfo.padInfo.top;
- var isChannelsLast = convInfo.dataFormat === "channelsLast";
- var y = tf2.buffer(convInfo.outShape, x.dtype);
- var xBatchStride = x.strides[0];
- var xRowStride = isChannelsLast ? x.strides[1] : x.strides[2];
- var xColStride = isChannelsLast ? x.strides[2] : 1;
- var xChannelStride = isChannelsLast ? 1 : x.strides[1];
- var yBatchStride = y.strides[0];
- var yRowStride = isChannelsLast ? y.strides[1] : y.strides[2];
- var yColStride = isChannelsLast ? y.strides[2] : 1;
- var yChannelStride = isChannelsLast ? 1 : y.strides[1];
- var xVals = this.readSync(x.dataId);
- var wVals = this.readSync(filter.dataId);
- var yVals = y.values;
- for (var b = 0; b < convInfo.batchSize; ++b) {
- var xOffset1 = b * xBatchStride;
- var yOffset1 = b * yBatchStride;
- for (var yR = 0; yR < convInfo.outHeight; ++yR) {
- var yOffset2 = yOffset1 + yR * yRowStride;
- var xRCorner = yR * convInfo.strideHeight - padTop;
- for (var wR = 0; wR < filterHeight; wR++) {
- var xR = xRCorner + wR * dilationHeight;
- if (xR < 0 || xR >= convInfo.inHeight) {
- continue;
- }
- var wOffset1 = wR * filter.strides[0];
- var xOffset2 = xOffset1 + xR * xRowStride;
- for (var yC = 0; yC < convInfo.outWidth; ++yC) {
- var yOffset3 = yOffset2 + yC * yColStride;
- var xCCorner = yC * convInfo.strideWidth - padLeft;
- for (var wC = 0; wC < filterWidth; wC++) {
- var xC = xCCorner + wC * dilationWidth;
- if (xC < 0 || xC >= convInfo.inWidth) {
- continue;
- }
- var wOffset2 = wOffset1 + wC * filter.strides[1];
- var xOffset3 = xOffset2 + xC * xColStride;
- var wOffset3 = wOffset2;
- for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
- var xVal = xVals[xOffset3 + d1 * xChannelStride];
- for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
- yVals[yOffset3 + d2 * yChannelStride] += xVal * wVals[wOffset3 + d2];
- }
- wOffset3 += convInfo.outChannels;
- }
- }
- }
- }
- }
- }
- return y.toTensor();
- };
- MathBackendCPU2.prototype.conv3d = function(x, filter, convInfo) {
- var filterDepth = convInfo.filterDepth;
- var filterHeight = convInfo.filterHeight;
- var filterWidth = convInfo.filterWidth;
- var dilationDepth = convInfo.dilationDepth;
- var dilationHeight = convInfo.dilationHeight;
- var dilationWidth = convInfo.dilationWidth;
- var padFront = convInfo.padInfo.front;
- var padLeft = convInfo.padInfo.left;
- var padTop = convInfo.padInfo.top;
- var y = tf2.buffer(convInfo.outShape, x.dtype);
- var xVals = this.readSync(x.dataId);
- var wVals = this.readSync(filter.dataId);
- var yVals = y.values;
- for (var b = 0; b < convInfo.batchSize; ++b) {
- var xOffset1 = b * x.strides[0];
- var yOffset1 = b * y.strides[0];
- for (var yF = 0; yF < convInfo.outDepth; ++yF) {
- var yOffset2 = yOffset1 + yF * y.strides[1];
- var xFCorner = yF * convInfo.strideDepth - padFront;
- for (var wF = 0; wF < filterDepth; wF++) {
- var xF = xFCorner + wF * dilationDepth;
- if (xF < 0 || xF >= convInfo.inDepth) {
- continue;
- }
- var wOffset1 = wF * filter.strides[0];
- var xOffset2 = xOffset1 + xF * x.strides[1];
- for (var yR = 0; yR < convInfo.outHeight; ++yR) {
- var yOffset3 = yOffset2 + yR * y.strides[2];
- var xRCorner = yR * convInfo.strideHeight - padTop;
- for (var wR = 0; wR < filterHeight; wR++) {
- var xR = xRCorner + wR * dilationHeight;
- if (xR < 0 || xR >= convInfo.inHeight) {
- continue;
- }
- var wOffset2 = wOffset1 + wR * filter.strides[1];
- var xOffset3 = xOffset2 + xR * x.strides[2];
- for (var yC = 0; yC < convInfo.outWidth; ++yC) {
- var yOffset4 = yOffset3 + yC * convInfo.outChannels;
- var xCCorner = yC * convInfo.strideWidth - padLeft;
- for (var wC = 0; wC < filterWidth; wC++) {
- var xC = xCCorner + wC * dilationWidth;
- if (xC < 0 || xC >= convInfo.inWidth) {
- continue;
- }
- var wOffset3 = wOffset2 + wC * filter.strides[2];
- var xOffset4 = xOffset3 + xC * convInfo.inChannels;
- var wOffset4 = wOffset3;
- for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
- var xVal = xVals[xOffset4 + d1];
- for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
- yVals[yOffset4 + d2] += xVal * wVals[wOffset4 + d2];
- }
- wOffset4 += convInfo.outChannels;
- }
- }
- }
- }
- }
- }
- }
- }
- return y.toTensor();
- };
- MathBackendCPU2.prototype.conv2dDerInput = function(dy, filter, convInfo) {
- assertNotComplex([dy, filter], "conv2dDerInput");
- var dx = tf2.buffer(convInfo.inShape, "float32");
- var dxValues = dx.values;
- var dyValues = this.readSync(dy.dataId);
- var fltValues = this.readSync(filter.dataId);
- var _a = filter.strides, fltS0 = _a[0], fltS1 = _a[1], fltS2 = _a[2];
- var batchSize = convInfo.batchSize, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth, dataFormat = convInfo.dataFormat;
- var topPad = filterHeight - 1 - convInfo.padInfo.top;
- var leftPad = filterWidth - 1 - convInfo.padInfo.left;
- var isChannelsLast = dataFormat === "channelsLast";
- var xBatchStride = dx.strides[0];
- var xRowStride = isChannelsLast ? dx.strides[1] : dx.strides[2];
- var xColStride = isChannelsLast ? dx.strides[2] : 1;
- var xChannelStride = isChannelsLast ? 1 : dx.strides[1];
- var yBatchStride = dy.strides[0];
- var yRowStride = isChannelsLast ? dy.strides[1] : dy.strides[2];
- var yColStride = isChannelsLast ? dy.strides[2] : 1;
- var yChannelStride = isChannelsLast ? 1 : dy.strides[1];
- for (var b = 0; b < batchSize; ++b) {
- for (var d1 = 0; d1 < inChannels; ++d1) {
- for (var xR = 0; xR < inHeight; ++xR) {
- var xRCorner = xR - topPad;
- var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));
- var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);
- for (var xC = 0; xC < inWidth; ++xC) {
- var xCCorner = xC - leftPad;
- var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));
- var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);
- var dotProd = 0;
- for (var yR = xRMin; yR < yRMax; ++yR) {
- var wR = yR * strideHeight - xRCorner;
- for (var yC = xCMin; yC < yCMax; ++yC) {
- var wC = yC * strideWidth - xCCorner;
- var dyOffset = yBatchStride * b + yRowStride * yR + yColStride * yC;
- var fltOffset = fltS0 * (filterHeight - 1 - wR) + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;
- for (var d2 = 0; d2 < outChannels; ++d2) {
- var pixel = dyValues[dyOffset + yChannelStride * d2];
- var weight = fltValues[fltOffset + d2];
- dotProd += pixel * weight;
- }
- }
- }
- var dxOffset = xBatchStride * b + xRowStride * xR + xColStride * xC + xChannelStride * d1;
- dxValues[dxOffset] = dotProd;
- }
- }
- }
- }
- return dx.toTensor();
- };
- MathBackendCPU2.prototype.conv3dDerInput = function(dy, filter, convInfo) {
- var dx = tf2.buffer(convInfo.inShape, "float32");
- var dxValues = dx.values;
- var _a = dx.strides, dxS0 = _a[0], dxS1 = _a[1], dxS2 = _a[2], dxS3 = _a[3];
- var dyValues = this.readSync(dy.dataId);
- var _b = dy.strides, dyS0 = _b[0], dyS1 = _b[1], dyS2 = _b[2], dyS3 = _b[3];
- var fltValues = this.readSync(filter.dataId);
- var _c = filter.strides, fltS0 = _c[0], fltS1 = _c[1], fltS2 = _c[2], fltS3 = _c[3];
- var batchSize = convInfo.batchSize, filterDepth = convInfo.filterDepth, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inDepth = convInfo.inDepth, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outDepth = convInfo.outDepth, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideDepth = convInfo.strideDepth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth;
- var frontPad = filterDepth - 1 - convInfo.padInfo.front;
- var topPad = filterHeight - 1 - convInfo.padInfo.top;
- var leftPad = filterWidth - 1 - convInfo.padInfo.left;
- for (var b = 0; b < batchSize; ++b) {
- for (var d1 = 0; d1 < inChannels; ++d1) {
- for (var xF = 0; xF < inDepth; ++xF) {
- var xFCorner = xF - frontPad;
- var xFMin = Math.max(0, Math.ceil(xFCorner / strideDepth));
- var yFMax = Math.min(outDepth, (filterDepth + xFCorner) / strideDepth);
- for (var xR = 0; xR < inHeight; ++xR) {
- var xRCorner = xR - topPad;
- var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));
- var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);
- for (var xC = 0; xC < inWidth; ++xC) {
- var xCCorner = xC - leftPad;
- var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));
- var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);
- var dotProd = 0;
- for (var yF = xFMin; yF < yFMax; ++yF) {
- var wF = yF * strideDepth - xFCorner;
- for (var yR = xRMin; yR < yRMax; ++yR) {
- var wR = yR * strideHeight - xRCorner;
- for (var yC = xCMin; yC < yCMax; ++yC) {
- var wC = yC * strideWidth - xCCorner;
- var dyOffset = dyS0 * b + dyS1 * yF + dyS2 * yR + dyS3 * yC;
- var fltOffset = fltS0 * (filterDepth - 1 - wF) + fltS1 * (filterHeight - 1 - wR) + fltS2 * (filterWidth - 1 - wC) + fltS3 * d1;
- for (var d2 = 0; d2 < outChannels; ++d2) {
- var pixel = dyValues[dyOffset + d2];
- var weight = fltValues[fltOffset + d2];
- dotProd += pixel * weight;
- }
- }
- }
- }
- dxValues[dxS0 * b + dxS1 * xF + dxS2 * xR + dxS3 * xC + d1] = dotProd;
- }
- }
- }
- }
- }
- return dx.toTensor();
- };
- MathBackendCPU2.prototype.conv2dDerFilter = function(x, dy, convInfo) {
- assertNotComplex([x, dy], "conv2dDerFilter");
- var strideHeight = convInfo.strideHeight;
- var strideWidth = convInfo.strideWidth;
- var filterHeight = convInfo.filterHeight;
- var filterWidth = convInfo.filterWidth;
- var isChannelsLast = convInfo.dataFormat === "channelsLast";
- var dW = tf2.buffer(convInfo.filterShape, "float32");
- var leftPad = convInfo.padInfo.left;
- var topPad = convInfo.padInfo.top;
- var xBuf = this.bufferSync(x);
- var dyBuf = this.bufferSync(dy);
- for (var wR = 0; wR < filterHeight; ++wR) {
- var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));
- var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);
- for (var wC = 0; wC < filterWidth; ++wC) {
- var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));
- var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);
- for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
- for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
- var dotProd = 0;
- for (var b = 0; b < convInfo.batchSize; ++b) {
- for (var yR = yRMin; yR < yRMax; ++yR) {
- var xR = wR + yR * strideHeight - topPad;
- for (var yC = yCMin; yC < yCMax; ++yC) {
- var xC = wC + yC * strideWidth - leftPad;
- if (isChannelsLast) {
- dotProd += xBuf.get(b, xR, xC, d1) * dyBuf.get(b, yR, yC, d2);
- } else {
- dotProd += xBuf.get(b, d1, xR, xC) * dyBuf.get(b, d2, yR, yC);
- }
- }
- }
- }
- dW.set(dotProd, wR, wC, d1, d2);
- }
- }
- }
- }
- return dW.toTensor();
- };
- MathBackendCPU2.prototype.conv3dDerFilter = function(x, dy, convInfo) {
- var strideDepth = convInfo.strideDepth;
- var strideHeight = convInfo.strideHeight;
- var strideWidth = convInfo.strideWidth;
- var filterDepth = convInfo.filterDepth;
- var filterHeight = convInfo.filterHeight;
- var filterWidth = convInfo.filterWidth;
- var dw = tf2.buffer(convInfo.filterShape, "float32");
- var dwValues = dw.values;
- var _a = dw.strides, dwS0 = _a[0], dwS1 = _a[1], dwS2 = _a[2], dwS3 = _a[3];
- var dyValues = this.readSync(dy.dataId);
- var _b = dy.strides, dyS0 = _b[0], dyS1 = _b[1], dyS2 = _b[2], dyS3 = _b[3];
- var xValues = this.readSync(x.dataId);
- var _c = x.strides, xS0 = _c[0], xS1 = _c[1], xS2 = _c[2], xS3 = _c[3];
- var frontPad = convInfo.padInfo.front;
- var leftPad = convInfo.padInfo.left;
- var topPad = convInfo.padInfo.top;
- for (var wF = 0; wF < filterDepth; ++wF) {
- var yFMin = Math.max(0, Math.ceil((frontPad - wF) / strideDepth));
- var yFMax = Math.min(convInfo.outDepth, (convInfo.inDepth + frontPad - wF) / strideDepth);
- var wOffset1 = wF * dwS0;
- for (var wR = 0; wR < filterHeight; ++wR) {
- var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));
- var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);
- var wOffset2 = wR * dwS1 + wOffset1;
- for (var wC = 0; wC < filterWidth; ++wC) {
- var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));
- var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);
- var wOffset3 = wC * dwS2 + wOffset2;
- for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
- var wOffset4 = d1 * dwS3 + wOffset3;
- for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
- var dotProd = 0;
- for (var b = 0; b < convInfo.batchSize; ++b) {
- var xOffset1 = b * xS0;
- var yOffset1 = b * dyS0;
- for (var yF = yFMin; yF < yFMax; ++yF) {
- var xF = wF + yF * strideDepth - frontPad;
- var xOffset2 = xF * xS1 + xOffset1;
- var yOffset2 = yF * dyS1 + yOffset1;
- for (var yR = yRMin; yR < yRMax; ++yR) {
- var xR = wR + yR * strideHeight - topPad;
- var xOffset3 = xR * xS2 + xOffset2;
- var yOffset3 = yR * dyS2 + yOffset2;
- for (var yC = yCMin; yC < yCMax; ++yC) {
- var xC = wC + yC * strideWidth - leftPad;
- var xOffset4 = xC * xS3 + xOffset3;
- var yOffset4 = yC * dyS3 + yOffset3;
- dotProd += xValues[xOffset4 + d1] * dyValues[yOffset4 + d2];
- }
- }
- }
- }
- dwValues[wOffset4 + d2] = dotProd;
- }
- }
- }
- }
- }
- return dw.toTensor();
- };
- MathBackendCPU2.prototype.fusedDepthwiseConv2D = function(_a) {
- var input = _a.input, filter = _a.filter, convInfo = _a.convInfo, bias = _a.bias, activation = _a.activation, preluActivationWeights = _a.preluActivationWeights;
- var result = this.depthwiseConv2D(input, filter, convInfo);
- if (bias) {
- result = tf2.add(result, bias);
- }
- if (activation) {
- result = mapActivation(this, result, activation, preluActivationWeights);
- }
- return result;
- };
- MathBackendCPU2.prototype.depthwiseConv2D = function(x, filter, convInfo) {
- assertNotComplex([x, filter], "depthwiseConv2D");
- var filterHeight = convInfo.filterHeight;
- var filterWidth = convInfo.filterWidth;
- var dilationHeight = convInfo.dilationHeight;
- var dilationWidth = convInfo.dilationWidth;
- var padLeft = convInfo.padInfo.left;
- var padTop = convInfo.padInfo.top;
- var chMul = convInfo.outChannels / convInfo.inChannels;
- var y = tf2.buffer(convInfo.outShape, x.dtype);
- var xVals = this.readSync(x.dataId);
- var wVals = this.readSync(filter.dataId);
- var yVals = y.values;
- for (var b = 0; b < convInfo.batchSize; ++b) {
- var xOffset1 = b * x.strides[0];
- var yOffset1 = b * y.strides[0];
- for (var yR = 0; yR < convInfo.outHeight; ++yR) {
- var yOffset2 = yOffset1 + yR * y.strides[1];
- var xRCorner = yR * convInfo.strideHeight - padLeft;
- for (var wR = 0; wR < filterHeight; ++wR) {
- var xR = xRCorner + wR * dilationHeight;
- if (xR < 0 || xR >= convInfo.inHeight) {
- continue;
- }
- var wOffset1 = wR * filter.strides[0];
- var xOffset2 = xOffset1 + xR * x.strides[1];
- for (var yC = 0; yC < convInfo.outWidth; ++yC) {
- var yOffset3 = yOffset2 + yC * y.strides[2];
- var xCCorner = yC * convInfo.strideWidth - padTop;
- for (var wC = 0; wC < filterWidth; ++wC) {
- var xC = xCCorner + wC * dilationWidth;
- if (xC < 0 || xC >= convInfo.inWidth) {
- continue;
- }
- var wOffset2 = wOffset1 + wC * filter.strides[1];
- var xOffset3 = xOffset2 + xC * convInfo.inChannels;
- var yOffset4 = yOffset3;
- var wOffset3 = wOffset2;
- for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
- var xVal = xVals[xOffset3 + d1];
- for (var q = 0; q < chMul; ++q) {
- yVals[yOffset4 + q] += xVal * wVals[wOffset3 + q];
- }
- yOffset4 += chMul;
- wOffset3 += chMul;
- }
- }
- }
- }
- }
- }
- return y.toTensor();
- };
- MathBackendCPU2.prototype.depthwiseConv2DDerInput = function(dy, filter, convInfo) {
- assertNotComplex([dy, filter], "depthwiseConv2DDerInput");
- var dx = tf2.buffer(convInfo.inShape, "float32");
- var dxValues = dx.values;
- var _a = dx.strides, dxS0 = _a[0], dxS1 = _a[1], dxS2 = _a[2];
- var dyValues = this.readSync(dy.dataId);
- var _b = dy.strides, dyS0 = _b[0], dyS1 = _b[1], dyS2 = _b[2];
- var fltValues = this.readSync(filter.dataId);
- var _c = filter.strides, fltS0 = _c[0], fltS1 = _c[1], fltS2 = _c[2];
- var batchSize = convInfo.batchSize, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth;
- var topPad = filterHeight - 1 - convInfo.padInfo.top;
- var leftPad = filterWidth - 1 - convInfo.padInfo.left;
- var chMul = outChannels / inChannels;
- for (var b = 0; b < batchSize; ++b) {
- for (var d1 = 0; d1 < inChannels; ++d1) {
- for (var xR = 0; xR < inHeight; ++xR) {
- var xRCorner = xR - topPad;
- var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));
- var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);
- for (var xC = 0; xC < inWidth; ++xC) {
- var xCCorner = xC - leftPad;
- var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));
- var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);
- var dotProd = 0;
- for (var yR = xRMin; yR < yRMax; ++yR) {
- var wR = yR * strideHeight - xRCorner;
- for (var yC = xCMin; yC < yCMax; ++yC) {
- var wC = yC * strideWidth - xCCorner;
- var dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC;
- var fltOffset = fltS0 * (filterHeight - 1 - wR) + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;
- for (var dm = 0; dm < chMul; ++dm) {
- var d2 = d1 * chMul + dm;
- var pixel = dyValues[dyOffset + d2];
- var weight = fltValues[fltOffset + dm];
- dotProd += pixel * weight;
- }
- }
- }
- dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd;
- }
- }
- }
- }
- return dx.toTensor();
- };
- MathBackendCPU2.prototype.depthwiseConv2DDerFilter = function(x, dy, convInfo) {
- assertNotComplex([x, dy], "depthwiseConv2DDerFilter");
- var strideHeight = convInfo.strideHeight;
- var strideWidth = convInfo.strideWidth;
- var filterHeight = convInfo.filterHeight;
- var filterWidth = convInfo.filterWidth;
- var dW = tf2.buffer(convInfo.filterShape, "float32");
- var leftPad = convInfo.padInfo.left;
- var topPad = convInfo.padInfo.top;
- var chMul = convInfo.outChannels / convInfo.inChannels;
- var xBuf = this.bufferSync(x);
- var dyBuf = this.bufferSync(dy);
- for (var wR = 0; wR < filterHeight; ++wR) {
- var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));
- var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);
- for (var wC = 0; wC < filterWidth; ++wC) {
- var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));
- var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);
- for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
- var d1 = Math.trunc(d2 / chMul);
- var dm = d2 % chMul;
- var dotProd = 0;
- for (var b = 0; b < convInfo.batchSize; ++b) {
- for (var yR = yRMin; yR < yRMax; ++yR) {
- var xR = wR + yR * strideHeight - topPad;
- for (var yC = yCMin; yC < yCMax; ++yC) {
- var xC = wC + yC * strideWidth - leftPad;
- dotProd += xBuf.get(b, xR, xC, d1) * dyBuf.get(b, yR, yC, d2);
- }
- }
- }
- dW.set(dotProd, wR, wC, d1, dm);
- }
- }
- }
- return dW.toTensor();
- };
MathBackendCPU2.prototype.tile = function(x, reps) {
assertNotComplex(x, "tile");
return tile(this.bufferSync(x), reps);
@@ -52141,17 +52063,11 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var sumDupeIndices = true;
return this.scatter(indices, updates, shape, outputSize, sliceSize, numUpdates, sliceRank, strides, defaultValue, sumDupeIndices);
};
- MathBackendCPU2.prototype.fill = function(shape, value, dtype) {
- dtype = dtype || tf2.util.inferDtype(value);
- var values = tf2.util.getArrayFromDType(dtype, tf2.util.sizeFromShape(shape));
- values.fill(value);
- return tf2.engine().makeTensor(values, shape, dtype, this);
- };
MathBackendCPU2.prototype.onesLike = function(x) {
if (x.dtype === "string") {
throw new Error("onesLike is not supported for string tensors");
} else {
- return this.fill(x.shape, 1, x.dtype);
+ return tf2.fill(x.shape, 1, x.dtype);
}
};
MathBackendCPU2.prototype.zerosLike = function(x) {
@@ -52216,7 +52132,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
}
return resultValues;
}
- var absKernelFunc = function(args) {
+ var abs = function(args) {
var x = args.inputs.x;
var cpuBackend = args.backend;
var resultValues = new Float32Array(tf2.util.sizeFromShape(x.shape));
@@ -52240,7 +52156,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var absConfig = {
kernelName: tf2.Abs,
backendName: "cpu",
- kernelFunc: absKernelFunc
+ kernelFunc: abs
};
/**
* @license
@@ -52682,11 +52598,11 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var ceilImpl = createSimpleUnaryImpl(function(xi) {
return Math.ceil(xi);
});
- var ceilKernelFunc = unaryKernelFuncFromImpl(tf2.Ceil, ceilImpl);
+ var ceil = unaryKernelFuncFromImpl(tf2.Ceil, ceilImpl);
var ceilConfig = {
kernelName: tf2.Ceil,
backendName: "cpu",
- kernelFunc: ceilKernelFunc
+ kernelFunc: ceil
};
/**
* @license
@@ -52707,11 +52623,11 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var expImpl = createSimpleUnaryImpl(function(xi) {
return Math.exp(xi);
});
- var expKernelFunc = unaryKernelFuncFromImpl(tf2.Exp, expImpl);
+ var exp = unaryKernelFuncFromImpl(tf2.Exp, expImpl);
var expConfig = {
kernelName: tf2.Exp,
backendName: "cpu",
- kernelFunc: expKernelFunc
+ kernelFunc: exp
};
/**
* @license
@@ -52732,11 +52648,11 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var expm1Impl = createSimpleUnaryImpl(function(xi) {
return Math.expm1(xi);
});
- var expm1KernelFunc = unaryKernelFuncFromImpl(tf2.Expm1, expm1Impl);
+ var expm1 = unaryKernelFuncFromImpl(tf2.Expm1, expm1Impl);
var expm1Config = {
kernelName: tf2.Expm1,
backendName: "cpu",
- kernelFunc: expm1KernelFunc
+ kernelFunc: expm1
};
/**
* @license
@@ -52757,11 +52673,11 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var floorImpl = createSimpleUnaryImpl(function(xi) {
return Math.floor(xi);
});
- var floorKernelFunc = unaryKernelFuncFromImpl(tf2.Floor, floorImpl);
+ var floor = unaryKernelFuncFromImpl(tf2.Floor, floorImpl);
var floorConfig = {
kernelName: tf2.Floor,
backendName: "cpu",
- kernelFunc: floorKernelFunc
+ kernelFunc: floor
};
/**
* @license
@@ -52782,11 +52698,11 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var logImpl = createSimpleUnaryImpl(function(xi) {
return Math.log(xi);
});
- var logKernelFunc = unaryKernelFuncFromImpl(tf2.Log, logImpl);
+ var log = unaryKernelFuncFromImpl(tf2.Log, logImpl);
var logConfig = {
kernelName: tf2.Log,
backendName: "cpu",
- kernelFunc: logKernelFunc
+ kernelFunc: log
};
/**
* @license
@@ -52850,6 +52766,31 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
backendName: "cpu",
kernelFunc: multiply
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var notEqualImpl = createSimpleBinaryKernelImpl(function(a, b) {
+ return a !== b ? 1 : 0;
+ });
+ var notEqual = binaryKernelFunc(tf2.NotEqual, notEqualImpl, null, "bool");
+ var notEqualConfig = {
+ kernelName: tf2.NotEqual,
+ backendName: "cpu",
+ kernelFunc: notEqual
+ };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -52869,11 +52810,11 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var rsqrtImpl = createSimpleUnaryImpl(function(xi) {
return 1 / Math.sqrt(xi);
});
- var rsqrtKernelFunc = unaryKernelFuncFromImpl(tf2.Rsqrt, rsqrtImpl);
+ var rsqrt = unaryKernelFuncFromImpl(tf2.Rsqrt, rsqrtImpl);
var rsqrtConfig = {
kernelName: tf2.Rsqrt,
backendName: "cpu",
- kernelFunc: rsqrtKernelFunc
+ kernelFunc: rsqrt
};
/**
* @license
@@ -52928,6 +52869,32 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
backendName: "cpu",
kernelFunc: slice
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var squaredDifferenceImpl = createSimpleBinaryKernelImpl(function(a, b) {
+ var diff = a - b;
+ return diff * diff;
+ });
+ var squaredDifference = binaryKernelFunc(tf2.SquaredDifference, squaredDifferenceImpl);
+ var squaredDifferenceConfig = {
+ kernelName: tf2.SquaredDifference,
+ backendName: "cpu",
+ kernelFunc: squaredDifference
+ };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -53087,14 +53054,16 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
logImpl,
maxImpl,
multiplyImpl,
+ notEqualImpl,
rsqrtImpl,
sliceImpl,
+ squaredDifferenceImpl,
subImpl,
transposeImpl,
uniqueImpl
};
/** @license See the LICENSE file. */
- var version = "2.6.0";
+ var version = "2.7.0";
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -53130,13 +53099,327 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var acosKernelFunc = unaryKernelFunc(tf2.Acos, function(xi) {
+ var elu = unaryKernelFunc(tf2.Elu, function(xi) {
+ return xi >= 0 ? xi : Math.exp(xi) - 1;
+ });
+ var eluConfig = {
+ kernelName: tf2.Elu,
+ backendName: "cpu",
+ kernelFunc: elu
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var preluImpl = createSimpleBinaryKernelImpl(function(xValue, aValue) {
+ return xValue < 0 ? aValue * xValue : xValue;
+ });
+ function prelu(args) {
+ var inputs = args.inputs, backend = args.backend;
+ var x = inputs.x, alpha = inputs.alpha;
+ assertNotComplex([x, alpha], "prelu");
+ var aVals = backend.data.get(x.dataId).values;
+ var bVals = backend.data.get(alpha.dataId).values;
+ var _a = preluImpl(x.shape, alpha.shape, aVals, bVals, x.dtype), resultData = _a[0], resultShape = _a[1];
+ return backend.makeTensorInfo(resultShape, x.dtype, resultData);
+ }
+ var preluConfig = {
+ kernelName: tf2.Prelu,
+ backendName: "cpu",
+ kernelFunc: prelu
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var relu = unaryKernelFunc(tf2.Relu, function(xi) {
+ return Math.max(0, xi);
+ });
+ var reluConfig = {
+ kernelName: tf2.Relu,
+ backendName: "cpu",
+ kernelFunc: relu
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var relu6 = unaryKernelFunc(tf2.Relu6, function(xi) {
+ return Math.min(Math.max(0, xi), 6);
+ });
+ var relu6Config = {
+ kernelName: tf2.Relu6,
+ backendName: "cpu",
+ kernelFunc: relu6
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function applyActivation(backend, x, activation, preluActivationWeights) {
+ if (activation === "linear") {
+ return identity({inputs: {x}, backend});
+ } else if (activation === "relu") {
+ return relu({inputs: {x}, backend});
+ } else if (activation === "elu") {
+ return elu({inputs: {x}, backend});
+ } else if (activation === "relu6") {
+ return relu6({inputs: {x}, backend});
+ } else if (activation === "prelu") {
+ return prelu({inputs: {x, alpha: preluActivationWeights}, backend});
+ }
+ throw new Error("Activation " + activation + " has not been implemented for the CPU backend.");
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function reshape(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x;
+ var shape = attrs.shape;
+ var xSize = tf2.util.sizeFromShape(x.shape);
+ var $shape = tf2.util.inferFromImplicitShape(shape, xSize);
+ var $xSize = tf2.util.sizeFromShape($shape);
+ tf2.util.assert(xSize === $xSize, function() {
+ return "The new shape (" + $shape + ") has " + $xSize + " elements and the old " + ("shape (" + x.shape + ") has " + xSize + " elements. The new shape and old ") + "shape must have the same number of elements.";
+ });
+ backend.incRef(x.dataId);
+ var xData = backend.data.get(x.dataId);
+ if (xData.complexTensorInfos != null) {
+ var real2 = xData.complexTensorInfos.real;
+ var imag2 = xData.complexTensorInfos.imag;
+ real2.shape = $shape;
+ imag2.shape = $shape;
+ }
+ return {dataId: x.dataId, shape: $shape, dtype: x.dtype};
+ }
+ var reshapeConfig = {
+ kernelName: tf2.Reshape,
+ backendName: "cpu",
+ kernelFunc: reshape
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function batchMatMul(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var a = inputs.a, b = inputs.b;
+ var transposeA = attrs.transposeA, transposeB = attrs.transposeB;
+ assertNotComplex([a, b], "matMul");
+ var aRank = a.shape.length;
+ var bRank = b.shape.length;
+ var innerShapeA = transposeA ? a.shape[aRank - 2] : a.shape[aRank - 1];
+ var innerShapeB = transposeB ? b.shape[bRank - 1] : b.shape[bRank - 2];
+ var outerShapeA = transposeA ? a.shape[aRank - 1] : a.shape[aRank - 2];
+ var outerShapeB = transposeB ? b.shape[bRank - 2] : b.shape[bRank - 1];
+ var outerDimsA = a.shape.slice(0, -2);
+ var outerDimsB = b.shape.slice(0, -2);
+ var batchDimA = tf2.util.sizeFromShape(outerDimsA);
+ var batchDimB = tf2.util.sizeFromShape(outerDimsB);
+ var batchDimsCompatible = batchDimA === batchDimB || batchDimA === 1 || batchDimB === 1;
+ tf2.util.assert(aRank >= 2 && bRank >= 2 && batchDimsCompatible, function() {
+ return "Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input " + ("batch dimensions of (" + outerDimsA + ") and (" + outerDimsB + ").");
+ });
+ var outShapeOuterDims = batchDimA > batchDimB ? a.shape.slice(0, -2) : b.shape.slice(0, -2);
+ var outShape = outShapeOuterDims.concat([outerShapeA, outerShapeB]);
+ tf2.util.assert(innerShapeA === innerShapeB, function() {
+ return "Error in matMul: inner shapes (" + innerShapeA + ") and (" + (innerShapeB + ") of Tensors with shapes " + a.shape + " and ") + (b.shape + " and transposeA=" + transposeA) + (" and transposeB=" + transposeB + " must match.");
+ });
+ var a3dShape = transposeA ? [batchDimA, innerShapeA, outerShapeA] : [batchDimA, outerShapeA, innerShapeA];
+ var b3dShape = transposeB ? [batchDimB, outerShapeB, innerShapeB] : [batchDimB, innerShapeB, outerShapeB];
+ var a3d = reshape({inputs: {x: a}, backend, attrs: {shape: a3dShape}});
+ var b3d = reshape({inputs: {x: b}, backend, attrs: {shape: b3dShape}});
+ var sharedDim = transposeA ? a3d.shape[1] : a3d.shape[2];
+ var leftDim = transposeA ? a3d.shape[2] : a3d.shape[1];
+ var rightDim = transposeB ? b3d.shape[1] : b3d.shape[2];
+ var batchDim = Math.max(batchDimA, batchDimB);
+ var a3dValues = backend.data.get(a3d.dataId).values;
+ var b3dValues = backend.data.get(b3d.dataId).values;
+ var a3dStrides = tf2.util.computeStrides(a3d.shape);
+ var b3dStrides = tf2.util.computeStrides(b3d.shape);
+ var _a = transposeA ? [a3dStrides[0], 1, a3dStrides[1]] : [a3dStrides[0], a3dStrides[1], 1], aBatch = _a[0], aOuterStep = _a[1], aInnerStep = _a[2];
+ var _b = transposeB ? [1, b3dStrides[1], b3dStrides[0]] : [b3dStrides[1], 1, b3dStrides[0]], bInnerStep = _b[0], bOuterStep = _b[1], bBatch = _b[2];
+ var size = leftDim * rightDim;
+ var result = tf2.buffer([batchDim, leftDim, rightDim], a3d.dtype);
+ var resVals = result.values;
+ var blockSize = backend.blockSize;
+ for (var bi = 0; bi < batchDim; bi++) {
+ for (var i0 = 0; i0 < leftDim; i0 += blockSize) {
+ for (var j0 = 0; j0 < rightDim; j0 += blockSize) {
+ for (var k0 = 0; k0 < sharedDim; k0 += blockSize) {
+ var iBlock = Math.min(i0 + blockSize, leftDim);
+ var jBlock = Math.min(j0 + blockSize, rightDim);
+ var kBlock = Math.min(k0 + blockSize, sharedDim);
+ for (var i = i0; i < iBlock; i++) {
+ for (var j = j0; j < jBlock; j++) {
+ var sum = 0;
+ for (var k = k0; k < kBlock; k++) {
+ var batchOffsetA = Math.min(bi, batchDimA - 1) * aBatch;
+ var batchOffsetB = Math.min(bi, batchDimB - 1) * bBatch;
+ var aVal = a3dValues[batchOffsetA + i * aOuterStep + k * aInnerStep];
+ var bVal = b3dValues[k * bInnerStep + j * bOuterStep + batchOffsetB];
+ sum += aVal * bVal;
+ }
+ resVals[bi * size + (i * rightDim + j)] += sum;
+ }
+ }
+ }
+ }
+ }
+ }
+ backend.disposeIntermediateTensorInfo(a3d);
+ backend.disposeIntermediateTensorInfo(b3d);
+ return backend.makeTensorInfo(outShape, result.dtype, result.values);
+ }
+ var batchMatMulConfig = {
+ kernelName: tf2.BatchMatMul,
+ backendName: "cpu",
+ kernelFunc: batchMatMul
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function _fusedMatMul(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var a = inputs.a, b = inputs.b, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights;
+ var transposeA = attrs.transposeA, transposeB = attrs.transposeB, activation = attrs.activation;
+ var current;
+ var addRes;
+ var activationRes;
+ var intermediates = [];
+ var matMulRes = batchMatMul({inputs: {a, b}, attrs: {transposeA, transposeB}, backend});
+ current = matMulRes;
+ if (bias) {
+ addRes = add({inputs: {a: current, b: bias}, backend});
+ intermediates.push(current);
+ current = addRes;
+ }
+ if (activation) {
+ activationRes = applyActivation(backend, current, activation, preluActivationWeights);
+ intermediates.push(current);
+ current = activationRes;
+ }
+ for (var _i2 = 0, intermediates_1 = intermediates; _i2 < intermediates_1.length; _i2++) {
+ var i = intermediates_1[_i2];
+ backend.disposeIntermediateTensorInfo(i);
+ }
+ return current;
+ }
+ var _fusedMatMulConfig = {
+ kernelName: tf2._FusedMatMul,
+ backendName: "cpu",
+ kernelFunc: _fusedMatMul
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var acos = unaryKernelFunc(tf2.Acos, function(xi) {
return Math.acos(xi);
});
var acosConfig = {
kernelName: tf2.Acos,
backendName: "cpu",
- kernelFunc: acosKernelFunc
+ kernelFunc: acos
};
/**
* @license
@@ -53154,13 +53437,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var acoshKernelFunc = unaryKernelFunc(tf2.Acosh, function(xi) {
+ var acosh = unaryKernelFunc(tf2.Acosh, function(xi) {
return Math.acosh(xi);
});
var acoshConfig = {
kernelName: tf2.Acosh,
backendName: "cpu",
- kernelFunc: acoshKernelFunc
+ kernelFunc: acosh
};
/**
* @license
@@ -53178,13 +53461,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var asinKernelFunc = unaryKernelFunc(tf2.Asin, function(xi) {
+ var asin = unaryKernelFunc(tf2.Asin, function(xi) {
return Math.asin(xi);
});
var asinConfig = {
kernelName: tf2.Asin,
backendName: "cpu",
- kernelFunc: asinKernelFunc
+ kernelFunc: asin
};
/**
* @license
@@ -53202,13 +53485,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var asinhKernelFunc = unaryKernelFunc(tf2.Asinh, function(xi) {
+ var asinh = unaryKernelFunc(tf2.Asinh, function(xi) {
return Math.asinh(xi);
});
var asinhConfig = {
kernelName: tf2.Asinh,
backendName: "cpu",
- kernelFunc: asinhKernelFunc
+ kernelFunc: asinh
};
/**
* @license
@@ -53226,13 +53509,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var atanKernelFunc = unaryKernelFunc(tf2.Atan, function(xi) {
+ var atan = unaryKernelFunc(tf2.Atan, function(xi) {
return Math.atan(xi);
});
var atanConfig = {
kernelName: tf2.Atan,
backendName: "cpu",
- kernelFunc: atanKernelFunc
+ kernelFunc: atan
};
/**
* @license
@@ -53250,13 +53533,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var atanhKernelFunc = unaryKernelFunc(tf2.Atanh, function(xi) {
+ var atanh = unaryKernelFunc(tf2.Atanh, function(xi) {
return Math.atanh(xi);
});
var atanhConfig = {
kernelName: tf2.Atanh,
backendName: "cpu",
- kernelFunc: atanhKernelFunc
+ kernelFunc: atanh
};
/**
* @license
@@ -53514,7 +53797,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- function batchNormKernelFunc(args) {
+ function batchNorm(args) {
var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
var x = inputs.x, scale2 = inputs.scale, offset = inputs.offset, mean = inputs.mean, variance = inputs.variance;
tf2.util.assert(mean.shape.length === variance.shape.length, function() {
@@ -53565,7 +53848,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var batchNormConfig = {
kernelName: tf2.FusedBatchNorm,
backendName: "cpu",
- kernelFunc: batchNormKernelFunc
+ kernelFunc: batchNorm
};
/**
* @license
@@ -53583,7 +53866,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var clipKernelFunc = unaryKernelFunc(tf2.ClipByValue, function(xi, attrs) {
+ var clip = unaryKernelFunc(tf2.ClipByValue, function(xi, attrs) {
var clipAttrs = attrs;
if (xi > clipAttrs.clipValueMax) {
return clipAttrs.clipValueMax;
@@ -53593,7 +53876,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var clipConfig = {
kernelName: tf2.ClipByValue,
backendName: "cpu",
- kernelFunc: clipKernelFunc
+ kernelFunc: clip
};
/**
* @license
@@ -53623,47 +53906,6 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
backendName: "cpu",
kernelFunc: imag
};
- /**
- * @license
- * Copyright 2020 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- function reshape(args) {
- var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
- var x = inputs.x;
- var shape = attrs.shape;
- var xSize = tf2.util.sizeFromShape(x.shape);
- var $shape = tf2.util.inferFromImplicitShape(shape, xSize);
- var $xSize = tf2.util.sizeFromShape($shape);
- tf2.util.assert(xSize === $xSize, function() {
- return "The new shape (" + $shape + ") has " + $xSize + " elements and the old " + ("shape (" + x.shape + ") has " + xSize + " elements. The new shape and old ") + "shape must have the same number of elements.";
- });
- backend.incRef(x.dataId);
- var xData = backend.data.get(x.dataId);
- if (xData.complexTensorInfos != null) {
- var real2 = xData.complexTensorInfos.real;
- var imag2 = xData.complexTensorInfos.imag;
- real2.shape = $shape;
- imag2.shape = $shape;
- }
- return {dataId: x.dataId, shape: $shape, dtype: x.dtype};
- }
- var reshapeConfig = {
- kernelName: tf2.Reshape,
- backendName: "cpu",
- kernelFunc: reshape
- };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -53707,8 +53949,8 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var imags = $inputs.map(function(t) {
return imag({inputs: {input: t}, backend});
});
- var realConcated = concat({inputs: reals, backend, attrs: {axis}});
- var imagConcated = concat({inputs: imags, backend, attrs: {axis}});
+ var realConcated = concat({inputs: reals, backend, attrs: {axis: $axis}});
+ var imagConcated = concat({inputs: imags, backend, attrs: {axis: $axis}});
var result = complex({inputs: {real: realConcated, imag: imagConcated}, backend});
reals.forEach(function(r) {
return backend.disposeIntermediateTensorInfo(r);
@@ -53781,13 +54023,501 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var cosKernelFunc = unaryKernelFunc(tf2.Cos, function(xi) {
+ function conv2D(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x, filter = inputs.filter;
+ var strides = attrs.strides, pad = attrs.pad, dataFormat = attrs.dataFormat, dilations = attrs.dilations, dimRoundingMode = attrs.dimRoundingMode;
+ assertNotComplex([x, filter], "conv2d");
+ var $dataFormat = tf2.backend_util.convertConv2DDataFormat(dataFormat);
+ var convInfo = tf2.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad, dimRoundingMode, false, $dataFormat);
+ var filterHeight = convInfo.filterHeight;
+ var filterWidth = convInfo.filterWidth;
+ var dilationHeight = convInfo.dilationHeight;
+ var dilationWidth = convInfo.dilationWidth;
+ var padLeft = convInfo.padInfo.left;
+ var padTop = convInfo.padInfo.top;
+ var isChannelsLast = convInfo.dataFormat === "channelsLast";
+ var y = new tf2.TensorBuffer(convInfo.outShape, x.dtype);
+ var xStrides = tf2.util.computeStrides(x.shape);
+ var filterStrides = tf2.util.computeStrides(filter.shape);
+ var xBatchStride = xStrides[0];
+ var xRowStride = isChannelsLast ? xStrides[1] : xStrides[2];
+ var xColStride = isChannelsLast ? xStrides[2] : 1;
+ var xChannelStride = isChannelsLast ? 1 : xStrides[1];
+ var yBatchStride = y.strides[0];
+ var yRowStride = isChannelsLast ? y.strides[1] : y.strides[2];
+ var yColStride = isChannelsLast ? y.strides[2] : 1;
+ var yChannelStride = isChannelsLast ? 1 : y.strides[1];
+ var xVals = backend.data.get(x.dataId).values;
+ var wVals = backend.data.get(filter.dataId).values;
+ var yVals = y.values;
+ for (var b = 0; b < convInfo.batchSize; ++b) {
+ var xOffset1 = b * xBatchStride;
+ var yOffset1 = b * yBatchStride;
+ for (var yR = 0; yR < convInfo.outHeight; ++yR) {
+ var yOffset2 = yOffset1 + yR * yRowStride;
+ var xRCorner = yR * convInfo.strideHeight - padTop;
+ for (var wR = 0; wR < filterHeight; ++wR) {
+ var xR = xRCorner + wR * dilationHeight;
+ if (xR < 0 || xR >= convInfo.inHeight) {
+ continue;
+ }
+ var wOffset1 = wR * filterStrides[0];
+ var xOffset2 = xOffset1 + xR * xRowStride;
+ for (var yC = 0; yC < convInfo.outWidth; ++yC) {
+ var yOffset3 = yOffset2 + yC * yColStride;
+ var xCCorner = yC * convInfo.strideWidth - padLeft;
+ for (var wC = 0; wC < filterWidth; ++wC) {
+ var xC = xCCorner + wC * dilationWidth;
+ if (xC < 0 || xC >= convInfo.inWidth) {
+ continue;
+ }
+ var wOffset2 = wOffset1 + wC * filterStrides[1];
+ var xOffset3 = xOffset2 + xC * xColStride;
+ var wOffset3 = wOffset2;
+ for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
+ var xVal = xVals[xOffset3 + d1 * xChannelStride];
+ for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
+ yVals[yOffset3 + d2 * yChannelStride] += xVal * wVals[wOffset3 + d2];
+ }
+ wOffset3 += convInfo.outChannels;
+ }
+ }
+ }
+ }
+ }
+ }
+ return backend.makeTensorInfo(y.shape, y.dtype, yVals);
+ }
+ var conv2DConfig = {
+ kernelName: tf2.Conv2D,
+ backendName: "cpu",
+ kernelFunc: conv2D
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function conv2DBackpropFilter(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x, dy = inputs.dy;
+ var strides = attrs.strides, pad = attrs.pad, dataFormat = attrs.dataFormat, dimRoundingMode = attrs.dimRoundingMode, filterShape = attrs.filterShape;
+ assertNotComplex([x, dy], "conv2dBackpropFilter");
+ var $dataFormat = tf2.backend_util.convertConv2DDataFormat(dataFormat);
+ var convInfo = tf2.backend_util.computeConv2DInfo(x.shape, filterShape, strides, 1, pad, dimRoundingMode, false, $dataFormat);
+ var strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth;
+ var isChannelsLast = convInfo.dataFormat === "channelsLast";
+ var dW = new tf2.TensorBuffer(convInfo.filterShape, "float32");
+ var leftPad = convInfo.padInfo.left;
+ var topPad = convInfo.padInfo.top;
+ var xVals = backend.data.get(x.dataId).values;
+ var dyVals = backend.data.get(dy.dataId).values;
+ var xBuf = new tf2.TensorBuffer(x.shape, x.dtype, xVals);
+ var dyBuf = new tf2.TensorBuffer(dy.shape, dy.dtype, dyVals);
+ for (var wR = 0; wR < filterHeight; ++wR) {
+ var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));
+ var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);
+ for (var wC = 0; wC < filterWidth; ++wC) {
+ var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));
+ var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);
+ for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
+ for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
+ var dotProd = 0;
+ for (var b = 0; b < convInfo.batchSize; ++b) {
+ for (var yR = yRMin; yR < yRMax; ++yR) {
+ var xR = wR + yR * strideHeight - topPad;
+ for (var yC = yCMin; yC < yCMax; ++yC) {
+ var xC = wC + yC * strideWidth - leftPad;
+ if (isChannelsLast) {
+ dotProd += xBuf.get(b, xR, xC, d1) * dyBuf.get(b, yR, yC, d2);
+ } else {
+ dotProd += xBuf.get(b, d1, xR, xC) * dyBuf.get(b, d2, yR, yC);
+ }
+ }
+ }
+ }
+ dW.set(dotProd, wR, wC, d1, d2);
+ }
+ }
+ }
+ }
+ return backend.makeTensorInfo(dW.shape, dW.dtype, dW.values);
+ }
+ var conv2DBackpropFilterConfig = {
+ kernelName: tf2.Conv2DBackpropFilter,
+ backendName: "cpu",
+ kernelFunc: conv2DBackpropFilter
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function conv2DBackpropInput(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var dy = inputs.dy, filter = inputs.filter;
+ var inputShape = attrs.inputShape, strides = attrs.strides, pad = attrs.pad, dataFormat = attrs.dataFormat, dimRoundingMode = attrs.dimRoundingMode;
+ assertNotComplex([dy, filter], "conv2dBackpropInput");
+ var filterStrides = tf2.util.computeStrides(filter.shape);
+ var dyStrides = tf2.util.computeStrides(dy.shape);
+ var $dataFormat = tf2.backend_util.convertConv2DDataFormat(dataFormat);
+ var convInfo = tf2.backend_util.computeConv2DInfo(inputShape, filter.shape, strides, 1, pad, dimRoundingMode, false, $dataFormat);
+ var dx = new tf2.TensorBuffer(convInfo.inShape, "float32");
+ var dxValues = dx.values;
+ var dyValues = backend.data.get(dy.dataId).values;
+ var fltValues = backend.data.get(filter.dataId).values;
+ var fltS0 = filterStrides[0], fltS1 = filterStrides[1], fltS2 = filterStrides[2];
+ var batchSize = convInfo.batchSize, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth;
+ $dataFormat = convInfo.dataFormat;
+ var topPad = filterHeight - 1 - convInfo.padInfo.top;
+ var leftPad = filterWidth - 1 - convInfo.padInfo.left;
+ var isChannelsLast = $dataFormat === "channelsLast";
+ var xBatchStride = dx.strides[0];
+ var xRowStride = isChannelsLast ? dx.strides[1] : dx.strides[2];
+ var xColStride = isChannelsLast ? dx.strides[2] : 1;
+ var xChannelStride = isChannelsLast ? 1 : dx.strides[1];
+ var yBatchStride = dyStrides[0];
+ var yRowStride = isChannelsLast ? dyStrides[1] : dyStrides[2];
+ var yColStride = isChannelsLast ? dyStrides[2] : 1;
+ var yChannelStride = isChannelsLast ? 1 : dyStrides[1];
+ for (var b = 0; b < batchSize; ++b) {
+ for (var d1 = 0; d1 < inChannels; ++d1) {
+ for (var xR = 0; xR < inHeight; ++xR) {
+ var xRCorner = xR - topPad;
+ var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));
+ var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);
+ for (var xC = 0; xC < inWidth; ++xC) {
+ var xCCorner = xC - leftPad;
+ var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));
+ var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);
+ var dotProd = 0;
+ for (var yR = xRMin; yR < yRMax; ++yR) {
+ var wR = yR * strideHeight - xRCorner;
+ for (var yC = xCMin; yC < yCMax; ++yC) {
+ var wC = yC * strideWidth - xCCorner;
+ var dyOffset = yBatchStride * b + yRowStride * yR + yColStride * yC;
+ var fltOffset = fltS0 * (filterHeight - 1 - wR) + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;
+ for (var d2 = 0; d2 < outChannels; ++d2) {
+ var pixel = dyValues[dyOffset + yChannelStride * d2];
+ var weight = fltValues[fltOffset + d2];
+ dotProd += pixel * weight;
+ }
+ }
+ }
+ var dxOffset = xBatchStride * b + xRowStride * xR + xColStride * xC + xChannelStride * d1;
+ dxValues[dxOffset] = dotProd;
+ }
+ }
+ }
+ }
+ return backend.makeTensorInfo(dx.shape, dx.dtype, dx.values);
+ }
+ var conv2DBackpropInputConfig = {
+ kernelName: tf2.Conv2DBackpropInput,
+ backendName: "cpu",
+ kernelFunc: conv2DBackpropInput
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function conv3D(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x, filter = inputs.filter;
+ var strides = attrs.strides, pad = attrs.pad, dilations = attrs.dilations;
+ assertNotComplex([x, filter], "conv3d");
+ var convInfo = tf2.backend_util.computeConv3DInfo(x.shape, filter.shape, strides, dilations, pad);
+ var filterDepth = convInfo.filterDepth, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, dilationDepth = convInfo.dilationDepth, dilationHeight = convInfo.dilationHeight, dilationWidth = convInfo.dilationWidth, padInfo = convInfo.padInfo;
+ var padFront = padInfo.front;
+ var padLeft = padInfo.left;
+ var padTop = padInfo.top;
+ var y = new tf2.TensorBuffer(convInfo.outShape, x.dtype);
+ var xVals = backend.data.get(x.dataId).values;
+ var wVals = backend.data.get(filter.dataId).values;
+ var yVals = y.values;
+ var xStrides = tf2.util.computeStrides(x.shape);
+ var filterStrides = tf2.util.computeStrides(filter.shape);
+ for (var b = 0; b < convInfo.batchSize; ++b) {
+ var xOffset1 = b * xStrides[0];
+ var yOffset1 = b * y.strides[0];
+ for (var yF = 0; yF < convInfo.outDepth; ++yF) {
+ var yOffset2 = yOffset1 + yF * y.strides[1];
+ var xFCorner = yF * convInfo.strideDepth - padFront;
+ for (var wF = 0; wF < filterDepth; ++wF) {
+ var xF = xFCorner + wF * dilationDepth;
+ if (xF < 0 || xF >= convInfo.inDepth) {
+ continue;
+ }
+ var wOffset1 = wF * filterStrides[0];
+ var xOffset2 = xOffset1 + xF * xStrides[1];
+ for (var yR = 0; yR < convInfo.outHeight; ++yR) {
+ var yOffset3 = yOffset2 + yR * y.strides[2];
+ var xRCorner = yR * convInfo.strideHeight - padTop;
+ for (var wR = 0; wR < filterHeight; ++wR) {
+ var xR = xRCorner + wR * dilationHeight;
+ if (xR < 0 || xR >= convInfo.inHeight) {
+ continue;
+ }
+ var wOffset2 = wOffset1 + wR * filterStrides[1];
+ var xOffset3 = xOffset2 + xR * xStrides[2];
+ for (var yC = 0; yC < convInfo.outWidth; ++yC) {
+ var yOffset4 = yOffset3 + yC * convInfo.outChannels;
+ var xCCorner = yC * convInfo.strideWidth - padLeft;
+ for (var wC = 0; wC < filterWidth; ++wC) {
+ var xC = xCCorner + wC * dilationWidth;
+ if (xC < 0 || xC >= convInfo.inWidth) {
+ continue;
+ }
+ var wOffset3 = wOffset2 + wC * filterStrides[2];
+ var xOffset4 = xOffset3 + xC * convInfo.inChannels;
+ var wOffset4 = wOffset3;
+ for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
+ var xVal = xVals[xOffset4 + d1];
+ for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
+ yVals[yOffset4 + d2] += xVal * wVals[wOffset4 + d2];
+ }
+ wOffset4 += convInfo.outChannels;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return backend.makeTensorInfo(y.shape, y.dtype, y.values);
+ }
+ var conv3DConfig = {
+ kernelName: tf2.Conv3D,
+ backendName: "cpu",
+ kernelFunc: conv3D
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function conv3DBackpropFilterV2(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x, dy = inputs.dy;
+ var strides = attrs.strides, pad = attrs.pad, filterShape = attrs.filterShape;
+ assertNotComplex([x, dy], "conv3dBackpropFilterV2");
+ var xStrides = tf2.util.computeStrides(x.shape);
+ var dyStrides = tf2.util.computeStrides(dy.shape);
+ var convInfo = tf2.backend_util.computeConv3DInfo(x.shape, filterShape, strides, 1, pad);
+ var strideDepth = convInfo.strideDepth;
+ var strideHeight = convInfo.strideHeight;
+ var strideWidth = convInfo.strideWidth;
+ var filterDepth = convInfo.filterDepth;
+ var filterHeight = convInfo.filterHeight;
+ var filterWidth = convInfo.filterWidth;
+ var dw = new tf2.TensorBuffer(convInfo.filterShape, "float32");
+ var dwValues = dw.values;
+ var _a = dw.strides, dwS0 = _a[0], dwS1 = _a[1], dwS2 = _a[2], dwS3 = _a[3];
+ var dyValues = backend.data.get(dy.dataId).values;
+ var dyS0 = dyStrides[0], dyS1 = dyStrides[1], dyS2 = dyStrides[2], dyS3 = dyStrides[3];
+ var xValues = backend.data.get(x.dataId).values;
+ var xS0 = xStrides[0], xS1 = xStrides[1], xS2 = xStrides[2], xS3 = xStrides[3];
+ var frontPad = convInfo.padInfo.front;
+ var leftPad = convInfo.padInfo.left;
+ var topPad = convInfo.padInfo.top;
+ for (var wF = 0; wF < filterDepth; ++wF) {
+ var yFMin = Math.max(0, Math.ceil((frontPad - wF) / strideDepth));
+ var yFMax = Math.min(convInfo.outDepth, (convInfo.inDepth + frontPad - wF) / strideDepth);
+ var wOffset1 = wF * dwS0;
+ for (var wR = 0; wR < filterHeight; ++wR) {
+ var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));
+ var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);
+ var wOffset2 = wR * dwS1 + wOffset1;
+ for (var wC = 0; wC < filterWidth; ++wC) {
+ var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));
+ var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);
+ var wOffset3 = wC * dwS2 + wOffset2;
+ for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
+ var wOffset4 = d1 * dwS3 + wOffset3;
+ for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
+ var dotProd = 0;
+ for (var b = 0; b < convInfo.batchSize; ++b) {
+ var xOffset1 = b * xS0;
+ var yOffset1 = b * dyS0;
+ for (var yF = yFMin; yF < yFMax; ++yF) {
+ var xF = wF + yF * strideDepth - frontPad;
+ var xOffset2 = xF * xS1 + xOffset1;
+ var yOffset2 = yF * dyS1 + yOffset1;
+ for (var yR = yRMin; yR < yRMax; ++yR) {
+ var xR = wR + yR * strideHeight - topPad;
+ var xOffset3 = xR * xS2 + xOffset2;
+ var yOffset3 = yR * dyS2 + yOffset2;
+ for (var yC = yCMin; yC < yCMax; ++yC) {
+ var xC = wC + yC * strideWidth - leftPad;
+ var xOffset4 = xC * xS3 + xOffset3;
+ var yOffset4 = yC * dyS3 + yOffset3;
+ dotProd += xValues[xOffset4 + d1] * dyValues[yOffset4 + d2];
+ }
+ }
+ }
+ }
+ dwValues[wOffset4 + d2] = dotProd;
+ }
+ }
+ }
+ }
+ }
+ return backend.makeTensorInfo(dw.shape, dw.dtype, dw.values);
+ }
+ var conv3DBackpropFilterV2Config = {
+ kernelName: tf2.Conv3DBackpropFilterV2,
+ backendName: "cpu",
+ kernelFunc: conv3DBackpropFilterV2
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function conv3DBackpropInputV2(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var dy = inputs.dy, filter = inputs.filter;
+ var pad = attrs.pad, strides = attrs.strides, inputShape = attrs.inputShape;
+ assertNotComplex([dy], "conv3dBackpropInputV2");
+ var dyStrides = tf2.util.computeStrides(dy.shape);
+ var filterStrides = tf2.util.computeStrides(filter.shape);
+ var convInfo = tf2.backend_util.computeConv3DInfo(inputShape, filter.shape, strides, 1, pad);
+ var dx = new tf2.TensorBuffer(convInfo.inShape, "float32");
+ var dxValues = dx.values;
+ var _a = dx.strides, dxS0 = _a[0], dxS1 = _a[1], dxS2 = _a[2], dxS3 = _a[3];
+ var dyValues = backend.data.get(dy.dataId).values;
+ var dyS0 = dyStrides[0], dyS1 = dyStrides[1], dyS2 = dyStrides[2], dyS3 = dyStrides[3];
+ var fltValues = backend.data.get(filter.dataId).values;
+ var fltS0 = filterStrides[0], fltS1 = filterStrides[1], fltS2 = filterStrides[2], fltS3 = filterStrides[3];
+ var batchSize = convInfo.batchSize, filterDepth = convInfo.filterDepth, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inDepth = convInfo.inDepth, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outDepth = convInfo.outDepth, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideDepth = convInfo.strideDepth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth;
+ var frontPad = filterDepth - 1 - convInfo.padInfo.front;
+ var topPad = filterHeight - 1 - convInfo.padInfo.top;
+ var leftPad = filterWidth - 1 - convInfo.padInfo.left;
+ for (var b = 0; b < batchSize; ++b) {
+ for (var d1 = 0; d1 < inChannels; ++d1) {
+ for (var xF = 0; xF < inDepth; ++xF) {
+ var xFCorner = xF - frontPad;
+ var xFMin = Math.max(0, Math.ceil(xFCorner / strideDepth));
+ var yFMax = Math.min(outDepth, (filterDepth + xFCorner) / strideDepth);
+ for (var xR = 0; xR < inHeight; ++xR) {
+ var xRCorner = xR - topPad;
+ var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));
+ var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);
+ for (var xC = 0; xC < inWidth; ++xC) {
+ var xCCorner = xC - leftPad;
+ var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));
+ var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);
+ var dotProd = 0;
+ for (var yF = xFMin; yF < yFMax; ++yF) {
+ var wF = yF * strideDepth - xFCorner;
+ for (var yR = xRMin; yR < yRMax; ++yR) {
+ var wR = yR * strideHeight - xRCorner;
+ for (var yC = xCMin; yC < yCMax; ++yC) {
+ var wC = yC * strideWidth - xCCorner;
+ var dyOffset = dyS0 * b + dyS1 * yF + dyS2 * yR + dyS3 * yC;
+ var fltOffset = fltS0 * (filterDepth - 1 - wF) + fltS1 * (filterHeight - 1 - wR) + fltS2 * (filterWidth - 1 - wC) + fltS3 * d1;
+ for (var d2 = 0; d2 < outChannels; ++d2) {
+ var pixel = dyValues[dyOffset + d2];
+ var weight = fltValues[fltOffset + d2];
+ dotProd += pixel * weight;
+ }
+ }
+ }
+ }
+ dxValues[dxS0 * b + dxS1 * xF + dxS2 * xR + dxS3 * xC + d1] = dotProd;
+ }
+ }
+ }
+ }
+ }
+ return backend.makeTensorInfo(dx.shape, dx.dtype, dx.values);
+ }
+ var conv3DBackpropInputV2Config = {
+ kernelName: tf2.Conv3DBackpropInputV2,
+ backendName: "cpu",
+ kernelFunc: conv3DBackpropInputV2
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var cos = unaryKernelFunc(tf2.Cos, function(xi) {
return Math.cos(xi);
});
var cosConfig = {
kernelName: tf2.Cos,
backendName: "cpu",
- kernelFunc: cosKernelFunc
+ kernelFunc: cos
};
/**
* @license
@@ -53805,13 +54535,230 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var coshKernelFunc = unaryKernelFunc(tf2.Cosh, function(xi) {
+ var cosh = unaryKernelFunc(tf2.Cosh, function(xi) {
return Math.cosh(xi);
});
var coshConfig = {
kernelName: tf2.Cosh,
backendName: "cpu",
- kernelFunc: coshKernelFunc
+ kernelFunc: cosh
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function depthwiseConv2dNative(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x, filter = inputs.filter;
+ var strides = attrs.strides, pad = attrs.pad, dilations = attrs.dilations, dimRoundingMode = attrs.dimRoundingMode;
+ assertNotComplex([x, filter], "depthwiseConv2DNative");
+ var xStrides = tf2.util.computeStrides(x.shape);
+ var filterStrides = tf2.util.computeStrides(filter.shape);
+ var $dilations = dilations;
+ if ($dilations == null) {
+ $dilations = [1, 1];
+ }
+ tf2.util.assert(tf2.backend_util.eitherStridesOrDilationsAreOne(strides, $dilations), function() {
+ return "Error in depthwiseConv2d: Either strides or dilations must be " + ("1. Got strides " + strides + " and dilations '" + $dilations + "'");
+ });
+ var convInfo = tf2.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad, dimRoundingMode, true);
+ var filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, dilationHeight = convInfo.dilationHeight, dilationWidth = convInfo.dilationWidth, padInfo = convInfo.padInfo;
+ var padLeft = padInfo.left;
+ var padTop = padInfo.top;
+ var chMul = convInfo.outChannels / convInfo.inChannels;
+ var y = new tf2.TensorBuffer(convInfo.outShape, x.dtype);
+ var xVals = backend.data.get(x.dataId).values;
+ var wVals = backend.data.get(filter.dataId).values;
+ var yVals = y.values;
+ for (var b = 0; b < convInfo.batchSize; ++b) {
+ var xOffset1 = b * xStrides[0];
+ var yOffset1 = b * y.strides[0];
+ for (var yR = 0; yR < convInfo.outHeight; ++yR) {
+ var yOffset2 = yOffset1 + yR * y.strides[1];
+ var xRCorner = yR * convInfo.strideHeight - padLeft;
+ for (var wR = 0; wR < filterHeight; ++wR) {
+ var xR = xRCorner + wR * dilationHeight;
+ if (xR < 0 || xR >= convInfo.inHeight) {
+ continue;
+ }
+ var wOffset1 = wR * filterStrides[0];
+ var xOffset2 = xOffset1 + xR * xStrides[1];
+ for (var yC = 0; yC < convInfo.outWidth; ++yC) {
+ var yOffset3 = yOffset2 + yC * y.strides[2];
+ var xCCorner = yC * convInfo.strideWidth - padTop;
+ for (var wC = 0; wC < filterWidth; ++wC) {
+ var xC = xCCorner + wC * dilationWidth;
+ if (xC < 0 || xC >= convInfo.inWidth) {
+ continue;
+ }
+ var wOffset2 = wOffset1 + wC * filterStrides[1];
+ var xOffset3 = xOffset2 + xC * convInfo.inChannels;
+ var yOffset4 = yOffset3;
+ var wOffset3 = wOffset2;
+ for (var d1 = 0; d1 < convInfo.inChannels; ++d1) {
+ var xVal = xVals[xOffset3 + d1];
+ for (var q = 0; q < chMul; ++q) {
+ yVals[yOffset4 + q] += xVal * wVals[wOffset3 + q];
+ }
+ yOffset4 += chMul;
+ wOffset3 += chMul;
+ }
+ }
+ }
+ }
+ }
+ }
+ return backend.makeTensorInfo(y.shape, y.dtype, y.values);
+ }
+ var depthwiseConv2dNativeConfig = {
+ kernelName: tf2.DepthwiseConv2dNative,
+ backendName: "cpu",
+ kernelFunc: depthwiseConv2dNative
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function depthwiseConv2dNativeBackpropFilter(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x, dy = inputs.dy;
+ var strides = attrs.strides, dilations = attrs.dilations, pad = attrs.pad, dimRoundingMode = attrs.dimRoundingMode, filterShape = attrs.filterShape;
+ assertNotComplex([x, dy], "depthwiseConv2dNativeBackpropFilter");
+ var convInfo = tf2.backend_util.computeConv2DInfo(x.shape, filterShape, strides, dilations, pad, dimRoundingMode, true);
+ var strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth;
+ var dW = new tf2.TensorBuffer(convInfo.filterShape, "float32");
+ var leftPad = convInfo.padInfo.left;
+ var topPad = convInfo.padInfo.top;
+ var chMul = convInfo.outChannels / convInfo.inChannels;
+ var xVals = backend.data.get(x.dataId).values;
+ var xBuf = new tf2.TensorBuffer(x.shape, x.dtype, xVals);
+ var dyVals = backend.data.get(dy.dataId).values;
+ var dyBuf = new tf2.TensorBuffer(dy.shape, dy.dtype, dyVals);
+ for (var wR = 0; wR < filterHeight; ++wR) {
+ var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));
+ var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);
+ for (var wC = 0; wC < filterWidth; ++wC) {
+ var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));
+ var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);
+ for (var d2 = 0; d2 < convInfo.outChannels; ++d2) {
+ var d1 = Math.trunc(d2 / chMul);
+ var dm = d2 % chMul;
+ var dotProd = 0;
+ for (var b = 0; b < convInfo.batchSize; ++b) {
+ for (var yR = yRMin; yR < yRMax; ++yR) {
+ var xR = wR + yR * strideHeight - topPad;
+ for (var yC = yCMin; yC < yCMax; ++yC) {
+ var xC = wC + yC * strideWidth - leftPad;
+ dotProd += xBuf.get(b, xR, xC, d1) * dyBuf.get(b, yR, yC, d2);
+ }
+ }
+ }
+ dW.set(dotProd, wR, wC, d1, dm);
+ }
+ }
+ }
+ return backend.makeTensorInfo(dW.shape, dW.dtype, dW.values);
+ }
+ var depthwiseConv2dNativeBackpropFilterConfig = {
+ kernelName: tf2.DepthwiseConv2dNativeBackpropFilter,
+ backendName: "cpu",
+ kernelFunc: depthwiseConv2dNativeBackpropFilter
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function depthwiseConv2dNativeBackpropInput(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var dy = inputs.dy, filter = inputs.filter;
+ var strides = attrs.strides, dilations = attrs.dilations, pad = attrs.pad, dimRoundingMode = attrs.dimRoundingMode, inputShape = attrs.inputShape;
+ assertNotComplex([dy, filter], "depthwiseConv2DNativeBackpropInput");
+ var dyStrides = tf2.util.computeStrides(dy.shape);
+ var filterStrides = tf2.util.computeStrides(filter.shape);
+ var convInfo = tf2.backend_util.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad, dimRoundingMode, true);
+ var dx = new tf2.TensorBuffer(convInfo.inShape, "float32");
+ var dxValues = dx.values;
+ var _a = dx.strides, dxS0 = _a[0], dxS1 = _a[1], dxS2 = _a[2];
+ var dyValues = backend.data.get(dy.dataId).values;
+ var dyS0 = dyStrides[0], dyS1 = dyStrides[1], dyS2 = dyStrides[2];
+ var fltValues = backend.data.get(filter.dataId).values;
+ var fltS0 = filterStrides[0], fltS1 = filterStrides[1], fltS2 = filterStrides[2];
+ var batchSize = convInfo.batchSize, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth;
+ var topPad = filterHeight - 1 - convInfo.padInfo.top;
+ var leftPad = filterWidth - 1 - convInfo.padInfo.left;
+ var chMul = outChannels / inChannels;
+ for (var b = 0; b < batchSize; ++b) {
+ for (var d1 = 0; d1 < inChannels; ++d1) {
+ for (var xR = 0; xR < inHeight; ++xR) {
+ var xRCorner = xR - topPad;
+ var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));
+ var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);
+ for (var xC = 0; xC < inWidth; ++xC) {
+ var xCCorner = xC - leftPad;
+ var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));
+ var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);
+ var dotProd = 0;
+ for (var yR = xRMin; yR < yRMax; ++yR) {
+ var wR = yR * strideHeight - xRCorner;
+ for (var yC = xCMin; yC < yCMax; ++yC) {
+ var wC = yC * strideWidth - xCCorner;
+ var dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC;
+ var fltOffset = fltS0 * (filterHeight - 1 - wR) + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;
+ for (var dm = 0; dm < chMul; ++dm) {
+ var d2 = d1 * chMul + dm;
+ var pixel = dyValues[dyOffset + d2];
+ var weight = fltValues[fltOffset + dm];
+ dotProd += pixel * weight;
+ }
+ }
+ }
+ dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd;
+ }
+ }
+ }
+ }
+ return backend.makeTensorInfo(dx.shape, dx.dtype, dx.values);
+ }
+ var depthwiseConv2dNativeBackpropInputConfig = {
+ kernelName: tf2.DepthwiseConv2dNativeBackpropInput,
+ backendName: "cpu",
+ kernelFunc: depthwiseConv2dNativeBackpropInput
};
/**
* @license
@@ -54035,30 +54982,6 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
backendName: "cpu",
kernelFunc: div
};
- /**
- * @license
- * Copyright 2020 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var eluKernelFunc = unaryKernelFunc(tf2.Elu, function(xi) {
- return xi >= 0 ? xi : Math.exp(xi) - 1;
- });
- var eluConfig = {
- kernelName: tf2.Elu,
- backendName: "cpu",
- kernelFunc: eluKernelFunc
- };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -54081,16 +55004,16 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var a3 = tf2.backend_util.ERF_A3;
var a4 = tf2.backend_util.ERF_A4;
var a5 = tf2.backend_util.ERF_A5;
- var erfKernelFunc = unaryKernelFunc(tf2.Erf, function(xi) {
- var sign = Math.sign(xi);
+ var erf = unaryKernelFunc(tf2.Erf, function(xi) {
+ var sign2 = Math.sign(xi);
var v = Math.abs(xi);
var t = 1 / (1 + p * v);
- return sign * (1 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-v * v));
+ return sign2 * (1 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-v * v));
});
var erfConfig = {
kernelName: tf2.Erf,
backendName: "cpu",
- kernelFunc: erfKernelFunc
+ kernelFunc: erf
};
/**
* @license
@@ -54334,6 +55257,42 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
backendName: "cpu",
kernelFunc: fft
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function fill(args) {
+ var backend = args.backend, attrs = args.attrs;
+ var shape = attrs.shape, value = attrs.value, dtype = attrs.dtype;
+ var $dtype = dtype || tf2.util.inferDtype(value);
+ var values = tf2.util.getArrayFromDType($dtype, tf2.util.sizeFromShape(shape));
+ fillValues(values, value, $dtype);
+ return backend.makeTensorInfo(shape, $dtype, values);
+ }
+ var fillConfig = {
+ kernelName: tf2.Fill,
+ backendName: "cpu",
+ kernelFunc: fill
+ };
+ function fillValues(values, value, dtype) {
+ if (dtype === "string") {
+ values.fill(value);
+ } else {
+ values.fill(value);
+ }
+ }
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -54386,6 +55345,90 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
return {dataId, shape: image.shape, dtype: image.dtype};
}
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function fusedConv2D(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x, filter = inputs.filter, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights;
+ var strides = attrs.strides, pad = attrs.pad, dataFormat = attrs.dataFormat, dilations = attrs.dilations, dimRoundingMode = attrs.dimRoundingMode, activation = attrs.activation;
+ var result = conv2D({
+ inputs: {x, filter},
+ backend,
+ attrs: {strides, pad, dataFormat, dilations, dimRoundingMode}
+ });
+ if (bias) {
+ var resultOld = result;
+ result = add({inputs: {a: result, b: bias}, backend});
+ backend.disposeIntermediateTensorInfo(resultOld);
+ }
+ if (activation) {
+ var resultOld = result;
+ result = applyActivation(backend, result, activation, preluActivationWeights);
+ backend.disposeIntermediateTensorInfo(resultOld);
+ }
+ return result;
+ }
+ var fusedConv2DConfig = {
+ kernelName: tf2.FusedConv2D,
+ backendName: "cpu",
+ kernelFunc: fusedConv2D
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function fusedDepthwiseConv2D(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x, filter = inputs.filter, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights;
+ var strides = attrs.strides, pad = attrs.pad, dataFormat = attrs.dataFormat, dilations = attrs.dilations, dimRoundingMode = attrs.dimRoundingMode, activation = attrs.activation;
+ var result = depthwiseConv2dNative({
+ inputs: {x, filter},
+ backend,
+ attrs: {strides, pad, dataFormat, dilations, dimRoundingMode}
+ });
+ if (bias) {
+ var oldResult = result;
+ result = add({inputs: {a: result, b: bias}, backend});
+ backend.disposeIntermediateTensorInfo(oldResult);
+ }
+ if (activation) {
+ var oldResult = result;
+ result = applyActivation(backend, result, activation, preluActivationWeights);
+ backend.disposeIntermediateTensorInfo(oldResult);
+ }
+ return result;
+ }
+ var fusedDepthwiseConv2DConfig = {
+ kernelName: tf2.FusedDepthwiseConv2D,
+ backendName: "cpu",
+ kernelFunc: fusedDepthwiseConv2D
+ };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -54440,13 +55483,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var isFiniteKernelFunc = unaryKernelFunc(tf2.IsFinite, function(xi) {
+ var isFinite2 = unaryKernelFunc(tf2.IsFinite, function(xi) {
return Number.isFinite(xi) ? 1 : 0;
}, "bool");
var isFiniteConfig = {
kernelName: tf2.IsFinite,
backendName: "cpu",
- kernelFunc: isFiniteKernelFunc
+ kernelFunc: isFinite2
};
/**
* @license
@@ -54464,13 +55507,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var isInfKernelFunc = unaryKernelFunc(tf2.IsInf, function(xi) {
+ var isInf = unaryKernelFunc(tf2.IsInf, function(xi) {
return Math.abs(xi) === Infinity ? 1 : 0;
}, "bool");
var isInfConfig = {
kernelName: tf2.IsInf,
backendName: "cpu",
- kernelFunc: isInfKernelFunc
+ kernelFunc: isInf
};
/**
* @license
@@ -54488,13 +55531,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var isNaNKernelFunc = unaryKernelFunc(tf2.IsNan, function(xi) {
+ var isNaN$1 = unaryKernelFunc(tf2.IsNan, function(xi) {
return Number.isNaN(xi) ? 1 : 0;
}, "bool");
var isNaNConfig = {
kernelName: tf2.IsNan,
backendName: "cpu",
- kernelFunc: isNaNKernelFunc
+ kernelFunc: isNaN$1
};
/**
* @license
@@ -54512,13 +55555,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var log1pKernelFunc = unaryKernelFunc(tf2.Log1p, function(xi) {
+ var log1p = unaryKernelFunc(tf2.Log1p, function(xi) {
return Math.log1p(xi);
});
var log1pConfig = {
kernelName: tf2.Log1p,
backendName: "cpu",
- kernelFunc: log1pKernelFunc
+ kernelFunc: log1p
};
/**
* @license
@@ -54536,13 +55579,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var logicalNotKernelFunc = unaryKernelFunc(tf2.LogicalNot, function(xi) {
+ var logicalNot = unaryKernelFunc(tf2.LogicalNot, function(xi) {
return xi ? 0 : 1;
}, "bool");
var logicalNotConfig = {
kernelName: tf2.LogicalNot,
backendName: "cpu",
- kernelFunc: logicalNotKernelFunc
+ kernelFunc: logicalNot
};
/**
* @license
@@ -54772,6 +55815,67 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
];
}
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function mirrorPad(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x;
+ var paddings = attrs.paddings, mode = attrs.mode;
+ assertNotComplex(x, "mirrorPad");
+ var outShape = paddings.map(function(p2, i2) {
+ return p2[0] + x.shape[i2] + p2[1];
+ });
+ var start = paddings.map(function(p2) {
+ return p2[0];
+ });
+ var end = paddings.map(function(p2, i2) {
+ return p2[0] + x.shape[i2];
+ });
+ var offset = mode === "reflect" ? 0 : 1;
+ var xVals = backend.data.get(x.dataId).values;
+ var xRank = x.shape.length;
+ var xStrides = tf2.util.computeStrides(x.shape);
+ var resultSize = tf2.util.sizeFromShape(outShape);
+ var resultRank = outShape.length;
+ var resultStrides = tf2.util.computeStrides(outShape);
+ var resVals = tf2.util.getTypedArrayFromDType(x.dtype, resultSize);
+ for (var i = 0; i < resultSize; i++) {
+ var coords = tf2.util.indexToLoc(i, resultRank, resultStrides);
+ for (var i_1 = 0; i_1 < resultRank; i_1++) {
+ if (coords[i_1] < start[i_1]) {
+ coords[i_1] = start[i_1] * 2 - coords[i_1] - offset;
+ } else if (coords[i_1] >= end[i_1]) {
+ coords[i_1] = (end[i_1] - 1) * 2 - coords[i_1] + offset;
+ }
+ }
+ coords = coords.map(function(c, i2) {
+ return c - start[i2];
+ });
+ var inIndex = tf2.util.locToIndex(coords, xRank, xStrides);
+ resVals[i] = xVals[inIndex];
+ }
+ var outId = backend.write(resVals, outShape, x.dtype);
+ return {dataId: outId, shape: outShape, dtype: x.dtype};
+ }
+ var mirrorPadConfig = {
+ kernelName: tf2.MirrorPad,
+ backendName: "cpu",
+ kernelFunc: mirrorPad
+ };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -54840,31 +55944,6 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
return [selectedIndices, selectedScores];
}
};
- /**
- * @license
- * Copyright 2020 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var notEqualImpl = createSimpleBinaryKernelImpl(function(a, b) {
- return a !== b ? 1 : 0;
- });
- var notEqual = binaryKernelFunc(tf2.NotEqual, notEqualImpl, null, "bool");
- var notEqualConfig = {
- kernelName: tf2.NotEqual,
- backendName: "cpu",
- kernelFunc: notEqual
- };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -54935,13 +56014,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var reciprocalKernelFunc = unaryKernelFunc(tf2.Reciprocal, function(xi) {
+ var reciprocal = unaryKernelFunc(tf2.Reciprocal, function(xi) {
return 1 / xi;
});
var reciprocalConfig = {
kernelName: tf2.Reciprocal,
backendName: "cpu",
- kernelFunc: reciprocalKernelFunc
+ kernelFunc: reciprocal
};
/**
* @license
@@ -55028,7 +56107,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var roundKernelFunc = unaryKernelFunc(tf2.Round, function(xi) {
+ var round = unaryKernelFunc(tf2.Round, function(xi) {
var base = Math.floor(xi);
if (xi - base < 0.5) {
return Math.floor(xi);
@@ -55045,7 +56124,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var roundConfig = {
kernelName: tf2.Round,
backendName: "cpu",
- kernelFunc: roundKernelFunc
+ kernelFunc: round
};
/**
* @license
@@ -55065,7 +56144,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
*/
var scaleAlpha = tf2.backend_util.SELU_SCALEALPHA;
var scale = tf2.backend_util.SELU_SCALE;
- var seluKernelFunc = unaryKernelFunc(tf2.Selu, function(xi) {
+ var selu = unaryKernelFunc(tf2.Selu, function(xi) {
if (xi >= 0) {
return scale * xi;
} else {
@@ -55075,7 +56154,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var seluConfig = {
kernelName: tf2.Selu,
backendName: "cpu",
- kernelFunc: seluKernelFunc
+ kernelFunc: selu
};
/**
* @license
@@ -55093,13 +56172,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var sigmoidKernelFunc = unaryKernelFunc(tf2.Sigmoid, function(xi) {
+ var sigmoid = unaryKernelFunc(tf2.Sigmoid, function(xi) {
return 1 / (1 + Math.exp(-xi));
});
var sigmoidConfig = {
kernelName: tf2.Sigmoid,
backendName: "cpu",
- kernelFunc: sigmoidKernelFunc
+ kernelFunc: sigmoid
};
/**
* @license
@@ -55117,7 +56196,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var signKernelFunc = unaryKernelFunc(tf2.Sign, function(xi) {
+ var sign = unaryKernelFunc(tf2.Sign, function(xi) {
if (xi < 0) {
return -1;
} else if (xi > 0) {
@@ -55129,7 +56208,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var signConfig = {
kernelName: tf2.Sign,
backendName: "cpu",
- kernelFunc: signKernelFunc
+ kernelFunc: sign
};
/**
* @license
@@ -55147,13 +56226,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var sinKernelFunc = unaryKernelFunc(tf2.Sin, function(xi) {
+ var sin = unaryKernelFunc(tf2.Sin, function(xi) {
return Math.sin(xi);
});
var sinConfig = {
kernelName: tf2.Sin,
backendName: "cpu",
- kernelFunc: sinKernelFunc
+ kernelFunc: sin
};
/**
* @license
@@ -55171,13 +56250,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var sinhKernelFunc = unaryKernelFunc(tf2.Sinh, function(xi) {
+ var sinh = unaryKernelFunc(tf2.Sinh, function(xi) {
return Math.sinh(xi);
});
var sinhConfig = {
kernelName: tf2.Sinh,
backendName: "cpu",
- kernelFunc: sinhKernelFunc
+ kernelFunc: sinh
};
/**
* @license
@@ -55197,7 +56276,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
*/
var epsilon = 11920928955078125e-23;
var threshold = Math.log(epsilon) + 2;
- var softplusKernelFunc = unaryKernelFunc(tf2.Softplus, function(xi) {
+ var softplus = unaryKernelFunc(tf2.Softplus, function(xi) {
var tooLarge = xi > -threshold;
var tooSmall = xi < threshold;
var expX = Math.exp(xi);
@@ -55214,7 +56293,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var softplusConfig = {
kernelName: tf2.Softplus,
backendName: "cpu",
- kernelFunc: softplusKernelFunc
+ kernelFunc: softplus
};
/**
* @license
@@ -55322,13 +56401,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var sqrtKernelFunc = unaryKernelFunc(tf2.Sqrt, function(xi) {
+ var sqrt = unaryKernelFunc(tf2.Sqrt, function(xi) {
return Math.sqrt(xi);
});
var sqrtConfig = {
kernelName: tf2.Sqrt,
backendName: "cpu",
- kernelFunc: sqrtKernelFunc
+ kernelFunc: sqrt
};
/**
* @license
@@ -55364,32 +56443,6 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
return {dataId, shape: x.shape, dtype: x.dtype};
}
};
- /**
- * @license
- * Copyright 2020 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var squaredDifferenceImpl = createSimpleBinaryKernelImpl(function(a, b) {
- var diff = a - b;
- return diff * diff;
- });
- var squaredDifference = binaryKernelFunc(tf2.SquaredDifference, squaredDifferenceImpl);
- var squaredDifferenceConfig = {
- kernelName: tf2.SquaredDifference,
- backendName: "cpu",
- kernelFunc: squaredDifference
- };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -55406,7 +56459,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var stepKernelFunc = unaryKernelFunc(tf2.Step, function(xi, attrs) {
+ var step = unaryKernelFunc(tf2.Step, function(xi, attrs) {
var stepAttrs = attrs;
if (isNaN(xi)) {
return NaN;
@@ -55417,7 +56470,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
var stepConfig = {
kernelName: tf2.Step,
backendName: "cpu",
- kernelFunc: stepKernelFunc
+ kernelFunc: step
};
/**
* @license
@@ -55435,13 +56488,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var tanKernelFunc = unaryKernelFunc(tf2.Tan, function(xi) {
+ var tan = unaryKernelFunc(tf2.Tan, function(xi) {
return Math.tan(xi);
});
var tanConfig = {
kernelName: tf2.Tan,
backendName: "cpu",
- kernelFunc: tanKernelFunc
+ kernelFunc: tan
};
/**
* @license
@@ -55459,13 +56512,13 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var tanhKernelFunc = unaryKernelFunc(tf2.Tanh, function(xi) {
+ var tanh = unaryKernelFunc(tf2.Tanh, function(xi) {
return Math.tanh(xi);
});
var tanhConfig = {
kernelName: tf2.Tanh,
backendName: "cpu",
- kernelFunc: tanhKernelFunc
+ kernelFunc: tanh
};
/**
* @license
@@ -55517,6 +56570,7 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
* =============================================================================
*/
var kernelConfigs = [
+ _fusedMatMulConfig,
absConfig,
acosConfig,
acoshConfig,
@@ -55527,14 +56581,24 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
atanhConfig,
avgPoolConfig,
avgPoolBackpropConfig,
+ batchMatMulConfig,
batchNormConfig,
castConfig,
ceilConfig,
clipConfig,
complexConfig,
concatConfig,
+ conv2DBackpropFilterConfig,
+ conv2DBackpropInputConfig,
+ conv2DConfig,
+ conv3DBackpropFilterV2Config,
+ conv3DBackpropInputV2Config,
+ conv3DConfig,
cosConfig,
coshConfig,
+ depthwiseConv2dNativeConfig,
+ depthwiseConv2dNativeBackpropFilterConfig,
+ depthwiseConv2dNativeBackpropInputConfig,
dilation2dConfig,
dilation2dBackpropInputConfig,
dilation2dBackpropFilterConfig,
@@ -55544,8 +56608,11 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
expConfig,
expm1Config,
fftConfig,
+ fillConfig,
flipLeftRightConfig,
floorConfig,
+ fusedConv2DConfig,
+ fusedDepthwiseConv2DConfig,
identityConfig,
ifftConfig,
imagConfig,
@@ -55559,13 +56626,17 @@ var require_tf_backend_cpu_node = __commonJS((exports) => {
maxPoolBackpropConfig,
maxPoolWithArgmaxConfig,
maxConfig,
+ mirrorPadConfig,
multiplyConfig,
nonMaxSuppressionV4Config,
nonMaxSuppressionV5Config,
notEqualConfig,
padV2Config,
+ preluConfig,
realConfig,
reciprocalConfig,
+ reluConfig,
+ relu6Config,
reshapeConfig,
rotateWithOffsetConfig,
roundConfig,
@@ -58083,34 +59154,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
}
return AvgPool3DBackpropProgram2;
}();
- /**
- * @license
- * Copyright 2018 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var COMPLEX_MULTIPLY = {
- REAL: "return areal * breal - aimag * bimag;",
- IMAG: "return areal * bimag + aimag * breal;"
- };
- var BinaryOpComplexProgram = function() {
- function BinaryOpComplexProgram2(op, aShape, bShape) {
- this.variableNames = ["AReal", "AImag", "BReal", "BImag"];
- this.outputShape = tf2.backend_util.assertAndGetBroadcastShape(aShape, bShape);
- this.userCode = "\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n " + op + "\n }\n\n void main() {\n float areal = getARealAtOutCoords();\n float aimag = getAImagAtOutCoords();\n float breal = getBRealAtOutCoords();\n float bimag = getBImagAtOutCoords();\n setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n }\n ";
- }
- return BinaryOpComplexProgram2;
- }();
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
@@ -58128,13 +59171,9 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* =============================================================================
*/
var CHECK_NAN_SNIPPET = "\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";
- var ADD = "return a + b;";
- var SUB = "return a - b;";
- var MUL = "return a * b;";
var INT_DIV = "\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n";
var POW = "\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nif (b == 0.0) {\n return 1.0;\n}\nreturn (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n";
var EQUAL = "return float(a == b);";
- var NOT_EQUAL = "return float(a != b);";
var LESS = "return float(a < b);";
var LESS_EQUAL = "return float(a <= b);";
var GREATER = "return float(a > b);";
@@ -58176,7 +59215,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var PRELU$1 = "\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";
var ELU_DER$1 = "\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n";
var EQUAL$1 = "\n return vec4(equal(a, b));\n";
- var NOT_EQUAL$1 = "\n return vec4(notEqual(a, b));\n";
var LESS$1 = "\n return vec4(lessThan(a, b));\n";
var LESS_EQUAL$1 = "\n return vec4(lessThanEqual(a, b));\n";
var GREATER$1 = "\n return vec4(greaterThan(a, b));\n";
@@ -58312,109 +59350,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
}
return ComplexAbsProgram2;
}();
- /**
- * @license
- * Copyright 2017 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var ConcatProgram = function() {
- function ConcatProgram2(shapes) {
- this.outputShape = [];
- this.outputShape = tf2.backend_util.computeOutShape(shapes, 1);
- this.variableNames = shapes.map(function(_, i2) {
- return "T" + i2;
- });
- var offsets = new Array(shapes.length - 1);
- offsets[0] = shapes[0][1];
- for (var i = 1; i < offsets.length; i++) {
- offsets[i] = offsets[i - 1] + shapes[i][1];
- }
- var snippets = ["if (yC < " + offsets[0] + ") setOutput(getT0(yR, yC));"];
- for (var i = 1; i < offsets.length; i++) {
- var shift = offsets[i - 1];
- snippets.push("else if (yC < " + offsets[i] + ") " + ("setOutput(getT" + i + "(yR, yC-" + shift + "));"));
- }
- var lastIndex = offsets.length;
- var lastShift = offsets[offsets.length - 1];
- snippets.push("else setOutput(getT" + lastIndex + "(yR, yC-" + lastShift + "));");
- this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n " + snippets.join("\n ") + "\n }\n ";
- }
- return ConcatProgram2;
- }();
- /**
- * @license
- * Copyright 2019 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var ConcatPackedProgram = function() {
- function ConcatPackedProgram2(shapes, axis) {
- this.packedInputs = true;
- this.packedOutput = true;
- this.outputShape = [];
- this.outputShape = tf2.backend_util.computeOutShape(shapes, axis);
- var shape = this.outputShape;
- var rank = shape.length;
- var dtype = getCoordsDataType(rank);
- var coords2 = getChannels("coords", rank);
- var channels = ["x", "y", "z", "w", "u", "v"].slice(0, rank);
- this.variableNames = shapes.map(function(_, i2) {
- return "T" + i2;
- });
- var offsets = new Array(shapes.length - 1);
- offsets[0] = shapes[0][axis];
- for (var i = 1; i < offsets.length; i++) {
- offsets[i] = offsets[i - 1] + shapes[i][axis];
- }
- var channel = channels[axis];
- var lastChannels = channels.slice(-2);
- var allChannels = channels.join();
- var getValueSnippet = "if (" + channel + " < " + offsets[0] + ") {\n return getChannel(\n getT0(" + allChannels + "), vec2(" + lastChannels.join() + "));\n }";
- for (var i = 1; i < offsets.length; i++) {
- var shift_1 = offsets[i - 1];
- getValueSnippet += "\n if (" + channel + " < " + offsets[i] + " && " + channel + " >= " + offsets[i - 1] + ") {\n return getChannel(\n getT" + i + "(" + shiftedChannels(channels, channel, shift_1) + "),\n vec2(" + shiftedChannels(lastChannels, channel, shift_1) + "));\n }";
- }
- var lastIndex = offsets.length;
- var shift = offsets[offsets.length - 1];
- getValueSnippet += "\n return getChannel(\n getT" + lastIndex + "(" + shiftedChannels(channels, channel, shift) + "),\n vec2(" + shiftedChannels(lastChannels, channel, shift) + "));";
- this.userCode = "\n float getValue(" + channels.map(function(x) {
- return "int " + x;
- }) + ") {\n " + getValueSnippet + "\n }\n\n void main() {\n " + dtype + " coords = getOutputCoords();\n vec4 result = vec4(getValue(" + coords2 + "), 0., 0., 0.);\n\n " + coords2[rank - 1] + " = " + coords2[rank - 1] + " + 1;\n if (" + coords2[rank - 1] + " < " + shape[rank - 1] + ") {\n result.g = getValue(" + coords2 + ");\n }\n\n " + coords2[rank - 2] + " = " + coords2[rank - 2] + " + 1;\n if (" + coords2[rank - 2] + " < " + shape[rank - 2] + ") {\n result.a = getValue(" + coords2 + ");\n }\n\n " + coords2[rank - 1] + " = " + coords2[rank - 1] + " - 1;\n if (" + coords2[rank - 2] + " < " + shape[rank - 2] + " &&\n " + coords2[rank - 1] + " < " + shape[rank - 1] + ") {\n result.b = getValue(" + coords2 + ");\n }\n setOutput(result);\n }\n ";
- }
- return ConcatPackedProgram2;
- }();
- function shiftedChannels(channels, channel, shift) {
- var channelIdx = channels.indexOf(channel);
- var res = channels.map(function(c, idx) {
- if (idx === channelIdx) {
- return c + " - " + shift;
- } else {
- return c;
- }
- });
- return res.join();
- }
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
@@ -59180,37 +60115,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
}
return EncodeMatrixPackedProgram2;
}();
- /**
- * @license
- * Copyright 2018 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var COMPLEX_FFT = {
- REAL: "return real * expR - imag * expI;",
- IMAG: "return real * expI + imag * expR;"
- };
- var FFTProgram = function() {
- function FFTProgram2(op, inputShape, inverse) {
- this.variableNames = ["real", "imag"];
- var innerDim = inputShape[1];
- this.outputShape = inputShape;
- var exponentMultiplierSnippet = inverse ? "2.0 * " + Math.PI : "-2.0 * " + Math.PI;
- var resultDenominator = inverse ? innerDim + ".0" : "1.0";
- this.userCode = "\n const float exponentMultiplier = " + exponentMultiplierSnippet + ";\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n " + op + "\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(" + innerDim + ");\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < " + innerDim + "; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / " + resultDenominator + ";\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n ";
- }
- return FFTProgram2;
- }();
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
@@ -60369,7 +61273,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* =============================================================================
*/
var MatMulPackedProgram = function() {
- function MatMulPackedProgram2(aShape, outputShape, transposeA, transposeB, addBias, activation, hasPreluActivation) {
+ function MatMulPackedProgram2(aShape, bShape, outputShape, transposeA, transposeB, addBias, activation, hasPreluActivation) {
if (transposeA === void 0) {
transposeA = false;
}
@@ -60411,7 +61315,14 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
if (hasPreluActivation) {
this.variableNames.push("preluActivationWeights");
}
- this.userCode = "\n " + activationSnippet + "\n\n const float sharedDimension = " + sharedDimensionPacked + ".0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n for (int i = 0; i < " + sharedDimensionPacked + "; i++) {\n vec4 a = getMatrixA(rc.x, " + aSample + ");\n vec4 b = getMatrixB(rc.x, " + bSample + ");\n\n // These swizzled products need to be separately added.\n // See: https://github.com/tensorflow/tfjs/issues/1735\n result += (" + aSwizzle[0] + " * " + bSwizzle[0] + ");\n result += (" + aSwizzle[1] + " * " + bSwizzle[1] + ");\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n " + addBiasSnippet + "\n\n " + applyActivationSnippet + "\n\n setOutput(result);\n }\n ";
+ var batchASnippet = "rc.x";
+ var batchBSnippet = "rc.x";
+ if (aShape[0] < bShape[0]) {
+ batchASnippet = "int(min(float(rc.x), " + (aShape[0] - 1) + ".))";
+ } else if (bShape[0] < aShape[0]) {
+ batchBSnippet = "int(min(float(rc.x), " + (bShape[0] - 1) + ".))";
+ }
+ this.userCode = "\n " + activationSnippet + "\n\n const float sharedDimension = " + sharedDimensionPacked + ".0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n for (int i = 0; i < " + sharedDimensionPacked + "; i++) {\n int batchA = " + batchASnippet + ";\n int batchB = " + batchBSnippet + ";\n vec4 a = getMatrixA(batchA, " + aSample + ");\n vec4 b = getMatrixB(batchB, " + bSample + ");\n\n // These swizzled products need to be separately added.\n // See: https://github.com/tensorflow/tfjs/issues/1735\n result += (" + aSwizzle[0] + " * " + bSwizzle[0] + ");\n result += (" + aSwizzle[1] + " * " + bSwizzle[1] + ");\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n " + addBiasSnippet + "\n\n " + applyActivationSnippet + "\n\n setOutput(result);\n }\n ";
}
return MatMulPackedProgram2;
}();
@@ -61758,7 +62669,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var ERF = '\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ' + tf2.backend_util.ERF_P + ";\n float a1 = " + tf2.backend_util.ERF_A1 + ";\n float a2 = " + tf2.backend_util.ERF_A2 + ";\n float a3 = " + tf2.backend_util.ERF_A3 + ";\n float a4 = " + tf2.backend_util.ERF_A4 + ";\n float a5 = " + tf2.backend_util.ERF_A5 + ";\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n";
var RECIPROCAL = "return 1.0 / x;";
var LOGICAL_NOT = "return float(!(x >= 1.0));";
- var TO_INT = "return float(int(x));";
var CLONE = "return x;";
/**
* @license
@@ -61940,7 +62850,14 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");
}
var dataId = {};
- this.texData.set(dataId, {shape, dtype, values, usage: TextureUsage.UPLOAD, refCount: 1});
+ this.texData.set(dataId, {
+ shape,
+ dtype,
+ values,
+ usage: TextureUsage.UPLOAD,
+ refCount: 1,
+ complexParentRefCount: 0
+ });
return dataId;
};
MathBackendWebGL2.prototype.incRef = function(dataId) {
@@ -61960,7 +62877,14 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
if (dtype === "complex64") {
throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");
}
- this.texData.set(dataId, {shape, dtype, values, usage: TextureUsage.UPLOAD, refCount: 1});
+ this.texData.set(dataId, {
+ shape,
+ dtype,
+ values,
+ usage: TextureUsage.UPLOAD,
+ refCount: 1,
+ complexParentRefCount: 0
+ });
};
MathBackendWebGL2.prototype.disposeIntermediateTensorInfo = function(tensorInfo) {
var dataId = tensorInfo.dataId;
@@ -61974,7 +62898,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
};
MathBackendWebGL2.prototype.readSync = function(dataId) {
var texData = this.texData.get(dataId);
- var values = texData.values, dtype = texData.dtype, complexTensors = texData.complexTensors, slice = texData.slice, shape = texData.shape, isPacked = texData.isPacked;
+ var values = texData.values, dtype = texData.dtype, complexTensorInfos = texData.complexTensorInfos, slice = texData.slice, shape = texData.shape, isPacked = texData.isPacked;
if (slice != null) {
var program = void 0;
if (isPacked) {
@@ -62000,8 +62924,8 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
}
var result;
if (dtype === "complex64") {
- var realValues = complexTensors.real.dataSync();
- var imagValues = complexTensors.imag.dataSync();
+ var realValues = this.readSync(complexTensorInfos.real.dataId);
+ var imagValues = this.readSync(complexTensorInfos.imag.dataId);
result = tf2.backend_util.mergeRealAndImagArrays(realValues, imagValues);
} else {
result = this.getValuesFromTexture(dataId);
@@ -62013,7 +62937,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
};
MathBackendWebGL2.prototype.read = function(dataId) {
return __awaiter(this, void 0, void 0, function() {
- var subscribers_1, texData, values, shape, slice, dtype, complexTensors, isPacked, program, res, data, buffer, tmpDownloadTarget, tmpData, vals, ps, realValues, imagValues, size, dTypeVals, subscribers;
+ var subscribers_1, texData, values, shape, slice, dtype, complexTensorInfos, isPacked, program, res, data, buffer, tmpDownloadTarget, tmpData, vals, ps, realValues, imagValues, size, dTypeVals, subscribers;
var _a;
return __generator(this, function(_b) {
switch (_b.label) {
@@ -62025,7 +62949,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
})];
}
texData = this.texData.get(dataId);
- values = texData.values, shape = texData.shape, slice = texData.slice, dtype = texData.dtype, complexTensors = texData.complexTensors, isPacked = texData.isPacked;
+ values = texData.values, shape = texData.shape, slice = texData.slice, dtype = texData.dtype, complexTensorInfos = texData.complexTensorInfos, isPacked = texData.isPacked;
if (slice != null) {
program = void 0;
if (isPacked) {
@@ -62060,7 +62984,10 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
case 2:
if (!(dtype === "complex64"))
return [3, 4];
- return [4, Promise.all([complexTensors.real.data(), complexTensors.imag.data()])];
+ return [4, Promise.all([
+ this.read(complexTensorInfos.real.dataId),
+ this.read(complexTensorInfos.imag.dataId)
+ ])];
case 3:
ps = _b.sent();
realValues = ps[0];
@@ -62239,11 +63166,17 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
if (!this.texData.has(dataId)) {
return;
}
+ if (this.texData.get(dataId).complexParentRefCount > 0) {
+ this.texData.get(dataId).refCount--;
+ return;
+ }
this.releaseGPUData(dataId);
- var complexTensors = this.texData.get(dataId).complexTensors;
- if (complexTensors != null) {
- complexTensors.real.dispose();
- complexTensors.imag.dispose();
+ var complexTensorInfos = this.texData.get(dataId).complexTensorInfos;
+ if (complexTensorInfos != null) {
+ this.texData.get(complexTensorInfos.real.dataId).complexParentRefCount--;
+ this.disposeIntermediateTensorInfo(complexTensorInfos.real);
+ this.texData.get(complexTensorInfos.imag.dataId).complexParentRefCount--;
+ this.disposeIntermediateTensorInfo(complexTensorInfos.imag);
}
this.texData.delete(dataId);
};
@@ -62299,23 +63232,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
MathBackendWebGL2.prototype.getGPGPUContext = function() {
return this.gpgpu;
};
- MathBackendWebGL2.prototype.complex = function(real, imag) {
- var result = this.makeOutput(real.shape, "complex64");
- var resultData = this.texData.get(result.dataId);
- resultData.complexTensors = {
- real: tf2.engine().keep(real.clone()),
- imag: tf2.engine().keep(imag.clone())
- };
- return result;
- };
- MathBackendWebGL2.prototype.real = function(input) {
- var resultData = this.texData.get(input.dataId);
- return resultData.complexTensors.real.clone();
- };
- MathBackendWebGL2.prototype.imag = function(input) {
- var resultData = this.texData.get(input.dataId);
- return resultData.complexTensors.imag.clone();
- };
MathBackendWebGL2.prototype.slice = function(x, begin, size) {
if (this.shouldExecuteOnCPU([x])) {
var outValues = sliceImplCPU(this.texData.get(x.dataId).values, begin, size, x.shape, x.dtype);
@@ -62374,43 +63290,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var program = tf2.env().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new ReversePackedProgram(x.shape, axis) : new ReverseProgram(x.shape, axis);
return this.compileAndRun(program, [x]);
};
- MathBackendWebGL2.prototype.concat = function(tensors, axis) {
- if (tensors[0].dtype === "complex64") {
- var reals = tensors.map(function(t) {
- return tf2.real(t);
- });
- var imags = tensors.map(function(t) {
- return tf2.imag(t);
- });
- return tf2.complex(this.concat(reals, axis), this.concat(imags, axis));
- }
- if (tensors.length === 1) {
- return tensors[0];
- }
- if (tensors.length > tf2.env().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")) {
- var midIndex = Math.floor(tensors.length / 2);
- var leftSide = this.concat(tensors.slice(0, midIndex), axis);
- var rightSide = this.concat(tensors.slice(midIndex), axis);
- return this.concat([leftSide, rightSide], axis);
- }
- if (tf2.env().getBool("WEBGL_PACK_ARRAY_OPERATIONS") && tensors[0].rank > 1) {
- var program_1 = new ConcatPackedProgram(tensors.map(function(t) {
- return t.shape;
- }), axis);
- return this.compileAndRun(program_1, tensors);
- }
- var outShape = tf2.backend_util.computeOutShape(tensors.map(function(t) {
- return t.shape;
- }), axis);
- var tensors2D = tensors.map(function(t) {
- return t.as2D(-1, tf2.util.sizeFromShape(t.shape.slice(axis)));
- });
- var program = new ConcatProgram(tensors2D.map(function(t) {
- return t.shape;
- }));
- var res = this.compileAndRun(program, tensors2D);
- return res.reshape(outShape);
- };
MathBackendWebGL2.prototype.neg = function(x) {
var _this = this;
var cpuRes = this.tryRunOnCpuOrThrow([x], function() {
@@ -62429,7 +63308,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var outerShapeA = transposeA ? a.shape[2] : a.shape[1];
var outerShapeB = transposeB ? b.shape[1] : b.shape[2];
var sharedDim = transposeA ? a.shape[1] : a.shape[2];
- var _a = a.shape, batch = _a[0];
+ var batch = Math.max(a.shape[0], b.shape[0]);
if ((outerShapeA === 1 || outerShapeB === 1) && sharedDim > MATMUL_SHARED_DIM_THRESHOLD) {
if (transposeA) {
a = tf2.transpose(a, [0, 2, 1]);
@@ -62440,22 +63319,23 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var a3D = outerShapeB === 1 ? a : a.as3D(batch, sharedDim, 1);
var axis = outerShapeB === 1 ? 2 : 1;
var b3D = outerShapeB === 1 ? b.as3D(batch, 1, sharedDim) : b;
- return this.multiply(a3D, b3D).sum(axis, true);
+ var product = tf2.mul(a3D, b3D);
+ return product.sum(axis, true);
}
var dtype = tf2.upcastType(a.dtype, b.dtype);
- var program = new MatMulPackedProgram(a.shape, [batch, outerShapeA, outerShapeB], transposeA, transposeB);
+ var program = new MatMulPackedProgram(a.shape, b.shape, [batch, outerShapeA, outerShapeB], transposeA, transposeB);
return this.compileAndRun(program, [a, b], dtype);
};
MathBackendWebGL2.prototype.fusedBatchMatMul = function(_a) {
var a = _a.a, b = _a.b, transposeA = _a.transposeA, transposeB = _a.transposeB, bias = _a.bias, activation = _a.activation, preluActivationWeights = _a.preluActivationWeights;
var outerShapeA = transposeA ? a.shape[2] : a.shape[1];
var outerShapeB = transposeB ? b.shape[1] : b.shape[2];
- var _b = a.shape, batch = _b[0];
+ var batch = Math.max(a.shape[0], b.shape[0]);
var dtype = tf2.upcastType(a.dtype, b.dtype);
var hasBias = bias != null;
var hasPreluActivationWeights = preluActivationWeights != null;
var fusedActivation = activation ? mapActivationToShaderProgram(activation, true) : null;
- var program = new MatMulPackedProgram(a.shape, [batch, outerShapeA, outerShapeB], transposeA, transposeB, hasBias, fusedActivation, hasPreluActivationWeights);
+ var program = new MatMulPackedProgram(a.shape, b.shape, [batch, outerShapeA, outerShapeB], transposeA, transposeB, hasBias, fusedActivation, hasPreluActivationWeights);
var inputs = [a, b];
if (bias) {
inputs.push(bias);
@@ -62465,38 +63345,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
}
return this.compileAndRun(program, inputs, dtype);
};
- MathBackendWebGL2.prototype.multiply = function(a, b) {
- if (a.dtype === "complex64") {
- var aData = this.texData.get(a.dataId);
- var bData = this.texData.get(b.dataId);
- var realProgram = new BinaryOpComplexProgram(COMPLEX_MULTIPLY.REAL, a.shape, b.shape);
- var imagProgram = new BinaryOpComplexProgram(COMPLEX_MULTIPLY.IMAG, a.shape, b.shape);
- var inputs = [
- this.makeComplexComponentTensorInfo(a, aData.complexTensors.real),
- this.makeComplexComponentTensorInfo(a, aData.complexTensors.imag),
- this.makeComplexComponentTensorInfo(b, bData.complexTensors.real),
- this.makeComplexComponentTensorInfo(b, bData.complexTensors.imag)
- ];
- var real_1 = this.compileAndRun(realProgram, inputs);
- var imag_1 = this.compileAndRun(imagProgram, inputs);
- var complex_1 = this.complex(real_1, imag_1);
- real_1.dispose();
- imag_1.dispose();
- return complex_1;
- }
- var dtype = tf2.upcastType(a.dtype, b.dtype);
- if (this.shouldExecuteOnCPU([a, b])) {
- var aData = this.texData.get(a.dataId);
- var bData = this.texData.get(b.dataId);
- var _a = multiplyImplCPU(a.shape, b.shape, aData.values, bData.values, dtype), outValues = _a[0], outShape = _a[1];
- return this.makeOutput(outShape, dtype, outValues);
- }
- if (tf2.env().getBool("WEBGL_PACK_BINARY_OPERATIONS")) {
- return this.packedBinaryOp(a, b, MUL, a.dtype);
- }
- var program = new BinaryOpProgram(MUL, a.shape, b.shape);
- return this.compileAndRun(program, [a, b], a.dtype);
- };
MathBackendWebGL2.prototype.localResponseNormalization4D = function(x, radius, bias, alpha, beta) {
var program = tf2.env().getBool("WEBGL_PACK_NORMALIZATION") ? new LRNPackedProgram(x.shape, radius, bias, alpha, beta) : new LRNProgram(x.shape, radius, bias, alpha, beta);
return this.compileAndRun(program, [x]);
@@ -62719,13 +63567,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var program = new BinaryOpProgram(EQUAL, a.shape, b.shape);
return this.compileAndRun(program, [a, b], "bool");
};
- MathBackendWebGL2.prototype.notEqual = function(a, b) {
- if (tf2.env().getBool("WEBGL_PACK_BINARY_OPERATIONS")) {
- return this.packedBinaryOp(a, b, NOT_EQUAL$1, "bool");
- }
- var program = new BinaryOpProgram(NOT_EQUAL, a.shape, b.shape);
- return this.compileAndRun(program, [a, b], "bool");
- };
MathBackendWebGL2.prototype.less = function(a, b) {
var _this = this;
var cpuRes = this.tryRunOnCpuOrThrow([a, b], function() {
@@ -62855,23 +63696,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var program = new BinaryOpProgram(op, a.shape, b.shape);
return this.compileAndRun(program, [a, b], outputDtype);
};
- MathBackendWebGL2.prototype.add = function(a, b) {
- if (a.dtype === "complex64" && b.dtype === "complex64") {
- return this.complexSeparableBinaryOp(a, b, ADD);
- }
- var dtype = tf2.upcastType(a.dtype, b.dtype);
- if (this.shouldExecuteOnCPU([a, b])) {
- var aData = this.texData.get(a.dataId);
- var bData = this.texData.get(b.dataId);
- var _a = addImplCPU(a.shape, b.shape, aData.values, bData.values, dtype), outValues = _a[0], outShape = _a[1];
- return this.makeOutput(outShape, dtype, outValues);
- }
- if (tf2.env().getBool("WEBGL_PACK_BINARY_OPERATIONS")) {
- return this.packedBinaryOp(a, b, ADD, dtype);
- }
- var program = new BinaryOpProgram(ADD, a.shape, b.shape);
- return this.compileAndRun(program, [a, b], dtype);
- };
MathBackendWebGL2.prototype.packedUnaryOp = function(x, op, dtype) {
var program = new UnaryOpPackedProgram(x.shape, op);
return this.compileAndRun(program, [x], dtype);
@@ -62883,25 +63707,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var program = new BinaryOpPackedProgram(op, a.shape, b.shape, checkOutOfBounds);
return this.compileAndRun(program, [a, b], dtype);
};
- MathBackendWebGL2.prototype.complexSeparableBinaryOp = function(a, b, op) {
- var _this = this;
- var aData = this.texData.get(a.dataId);
- var bData = this.texData.get(b.dataId);
- var _a = [
- [aData.complexTensors.real, bData.complexTensors.real],
- [aData.complexTensors.imag, bData.complexTensors.imag]
- ].map(function(complexParts) {
- var aPart = complexParts[0], bPart = complexParts[1];
- var aHandle = _this.makeComplexComponentTensorInfo(a, aPart);
- var bHandle = _this.makeComplexComponentTensorInfo(b, bPart);
- var program = new BinaryOpProgram(op, a.shape, b.shape);
- return _this.compileAndRun(program, [aHandle, bHandle], tf2.upcastType(aPart.dtype, bPart.dtype));
- }), real = _a[0], imag = _a[1];
- var complex = this.complex(real, imag);
- real.dispose();
- imag.dispose();
- return complex;
- };
MathBackendWebGL2.prototype.makeComplexComponentTensorInfo = function(complexTensor, complexPart) {
return {
dataId: complexPart.dataId,
@@ -62931,23 +63736,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var program = usePackedOp ? new AddNPackedProgram(tensors[0].shape, shapes) : new AddNProgram(tensors[0].shape, shapes);
return this.compileAndRun(program, tensors, dtype);
};
- MathBackendWebGL2.prototype.subtract = function(a, b) {
- if (a.dtype === "complex64" && b.dtype === "complex64") {
- return this.complexSeparableBinaryOp(a, b, SUB);
- }
- var dtype = tf2.upcastType(a.dtype, b.dtype);
- if (this.shouldExecuteOnCPU([a, b])) {
- var aData = this.texData.get(a.dataId);
- var bData = this.texData.get(b.dataId);
- var _a = subImplCPU(a.shape, b.shape, aData.values, bData.values, dtype), outValues = _a[0], outShape = _a[1];
- return this.makeOutput(outShape, dtype, outValues);
- }
- if (tf2.env().getBool("WEBGL_PACK_BINARY_OPERATIONS")) {
- return this.packedBinaryOp(a, b, SUB, a.dtype);
- }
- var program = new BinaryOpProgram(SUB, a.shape, b.shape);
- return this.compileAndRun(program, [a, b], dtype);
- };
MathBackendWebGL2.prototype.pow = function(a, b) {
var usePackedOp = tf2.env().getBool("WEBGL_PACK_BINARY_OPERATIONS");
var program = usePackedOp ? new BinaryOpPackedProgram(POW$1, a.shape, b.shape) : new BinaryOpProgram(POW, a.shape, b.shape);
@@ -63022,7 +63810,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var axes = tf2.util.parseAxisParam([dim], logits.shape);
var maxLogit = tf2.max(logits, axes);
var expandedShape = tf2.backend_util.expandShapeToKeepDim(maxLogit.shape, axes);
- var a = this.subtract(logits, maxLogit.reshape(expandedShape));
+ var a = tf2.sub(logits, maxLogit.reshape(expandedShape));
var b = this.exp(a);
var sumExp = this.sum(b, axes).reshape(expandedShape);
return tf2.div(b, sumExp);
@@ -63095,10 +63883,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var program = new UnaryOpProgram(x.shape, SELU);
return this.compileAndRun(program, [x]);
};
- MathBackendWebGL2.prototype.int = function(x) {
- var program = new UnaryOpProgram(x.shape, TO_INT);
- return this.compileAndRun(program, [x], "int32");
- };
MathBackendWebGL2.prototype.clip = function(x, min, max) {
var program;
if (tf2.env().getBool("WEBGL_PACK_CLIP")) {
@@ -63124,8 +63908,8 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var xData = this.texData.get(x.dataId);
var program = new ComplexAbsProgram(x.shape);
var inputs = [
- this.makeComplexComponentTensorInfo(x, xData.complexTensors.real),
- this.makeComplexComponentTensorInfo(x, xData.complexTensors.imag)
+ this.makeComplexComponentTensorInfo(x, xData.complexTensorInfos.real),
+ this.makeComplexComponentTensorInfo(x, xData.complexTensorInfos.imag)
];
return this.compileAndRun(program, inputs);
};
@@ -63256,7 +64040,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var hasBias = bias != null;
var hasPreluActivationWeights = preluActivationWeights != null;
var fusedActivation = activation ? mapActivationToShaderProgram(activation, true) : null;
- var matmulProgram = new MatMulPackedProgram(im2Col.shape, [1, numCols, convInfo.outChannels], transposeA, transposeB, hasBias, fusedActivation, hasPreluActivationWeights);
+ var matmulProgram = new MatMulPackedProgram(im2Col.shape, w2Row.shape, [1, numCols, convInfo.outChannels], transposeA, transposeB, hasBias, fusedActivation, hasPreluActivationWeights);
var inputs = [im2Col, w2Row];
if (bias) {
inputs.push(bias);
@@ -63360,9 +64144,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var program = new Conv3DDerFilterProgram(convInfo);
return this.compileAndRun(program, [x, dy]);
};
- MathBackendWebGL2.prototype.cast = function(x, dtype) {
- return tf2.backend_util.castTensor(x, dtype, this);
- };
MathBackendWebGL2.prototype.unstack = function(x, axis) {
var num = x.shape[axis];
var outShape = new Array(x.rank - 1);
@@ -63477,29 +64258,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var res = this.compileAndRun(program, [sparseValues, sparseIndices, defaultValue]);
return res.reshape(outputShape);
};
- MathBackendWebGL2.prototype.fft = function(x) {
- var inverse = false;
- return this.fftImpl(x, inverse);
- };
- MathBackendWebGL2.prototype.ifft = function(x) {
- var inverse = true;
- return this.fftImpl(x, inverse);
- };
- MathBackendWebGL2.prototype.fftImpl = function(x, inverse) {
- var xData = this.texData.get(x.dataId);
- var realProgram = new FFTProgram(COMPLEX_FFT.REAL, x.shape, inverse);
- var imagProgram = new FFTProgram(COMPLEX_FFT.IMAG, x.shape, inverse);
- var inputs = [
- this.makeComplexComponentTensorInfo(x, xData.complexTensors.real),
- this.makeComplexComponentTensorInfo(x, xData.complexTensors.imag)
- ];
- var real = this.compileAndRun(realProgram, inputs);
- var imag = this.compileAndRun(imagProgram, inputs);
- var complex = this.complex(real, imag).as2D(x.shape[0], x.shape[1]);
- real.dispose();
- imag.dispose();
- return complex;
- };
MathBackendWebGL2.prototype.gatherND = function(x, indices) {
var indicesShape = indices.shape;
var sliceRank = indicesShape[indicesShape.length - 1];
@@ -63832,7 +64590,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
}
}
/** @license See the LICENSE file. */
- var version = "2.6.0";
+ var version = "2.7.0";
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
@@ -63874,53 +64632,6 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
}, 2);
}
var webgl = {forceHalfFloat};
- var CHECK_NAN_SNIPPET_UNARY = "if (isnan(x)) return x;";
- var CHECK_NAN_SNIPPET_BINARY = "\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";
- var CHECK_NAN_SNIPPET_BINARY_PACKED = "\n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n";
- function unaryKernelFunc(opSnippet) {
- return function(_a) {
- var inputs = _a.inputs, backend = _a.backend;
- var x = inputs.x;
- var webglBackend = backend;
- var program = new UnaryOpProgram(x.shape, opSnippet);
- return webglBackend.runWebGLProgram(program, [x], x.dtype);
- };
- }
- function binaryKernelFunc(opSnippet, packedOpSnippet, checkOutOfBoundsForPackedProgram, dtype) {
- return function(_a) {
- var inputs = _a.inputs, backend = _a.backend;
- var _b = inputs, a = _b.a, b = _b.b;
- var webglBackend = backend;
- var program = tf2.env().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new BinaryOpPackedProgram(packedOpSnippet, a.shape, b.shape, !!checkOutOfBoundsForPackedProgram) : new BinaryOpProgram(opSnippet, a.shape, b.shape);
- var $dtype = dtype || a.dtype;
- var output = webglBackend.runWebGLProgram(program, [a, b], $dtype);
- return output;
- };
- }
- /**
- * @license
- * Copyright 2020 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- var ATAN2 = CHECK_NAN_SNIPPET_BINARY + "\n return atan(a, b);\n";
- var ATAN2_PACKED = "\n vec4 result = atan(a, b);\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n " + CHECK_NAN_SNIPPET_BINARY_PACKED + "\n return result;\n";
- var atan2KernelFunc = binaryKernelFunc(ATAN2, ATAN2_PACKED);
- var atan2Config = {
- kernelName: tf2.Atan2,
- backendName: "webgl",
- kernelFunc: atan2KernelFunc
- };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -63948,6 +64659,173 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
backendName: "webgl",
kernelFunc: identity
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function complex(args) {
+ var inputs = args.inputs, backend = args.backend;
+ var real2 = inputs.real, imag2 = inputs.imag;
+ var complexInfo = backend.makeTensorInfo(real2.shape, "complex64");
+ var complex2 = backend.texData.get(complexInfo.dataId);
+ var realTensorInfo = identity({inputs: {x: real2}, backend});
+ var realData = backend.texData.get(realTensorInfo.dataId);
+ realData.complexParentRefCount++;
+ var imagTensorInfo = identity({inputs: {x: imag2}, backend});
+ var imagData = backend.texData.get(imagTensorInfo.dataId);
+ imagData.complexParentRefCount++;
+ complex2.complexTensorInfos = {real: realTensorInfo, imag: imagTensorInfo};
+ return complexInfo;
+ }
+ var complexConfig = {
+ kernelName: tf2.Complex,
+ backendName: "webgl",
+ kernelFunc: complex
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var CHECK_NAN_SNIPPET_UNARY = "if (isnan(x)) return x;";
+ var CHECK_NAN_SNIPPET_BINARY = "\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";
+ var CHECK_NAN_SNIPPET_BINARY_PACKED = "\n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n";
+ function unaryKernelFunc(opSnippet) {
+ return function(_a) {
+ var inputs = _a.inputs, backend = _a.backend;
+ var x = inputs.x;
+ var webglBackend = backend;
+ var program = new UnaryOpProgram(x.shape, opSnippet);
+ return webglBackend.runWebGLProgram(program, [x], x.dtype);
+ };
+ }
+ function binaryKernelFunc(_a) {
+ var opSnippet = _a.opSnippet, packedOpSnippet = _a.packedOpSnippet, _b = _a.checkOutOfBounds, checkOutOfBounds = _b === void 0 ? false : _b, _c = _a.supportsComplex, supportsComplex = _c === void 0 ? false : _c, cpuKernelImpl = _a.cpuKernelImpl, dtype = _a.dtype;
+ return function(_a2) {
+ var inputs = _a2.inputs, backend = _a2.backend;
+ var _b2 = inputs, a = _b2.a, b = _b2.b;
+ var webglBackend = backend;
+ if (supportsComplex && a.dtype === "complex64") {
+ var aData = webglBackend.texData.get(a.dataId);
+ var bData = webglBackend.texData.get(b.dataId);
+ var _c2 = [
+ [aData.complexTensorInfos.real, bData.complexTensorInfos.real],
+ [aData.complexTensorInfos.imag, bData.complexTensorInfos.imag]
+ ].map(function(complexParts) {
+ var aPart = complexParts[0], bPart = complexParts[1];
+ var aHandle = {
+ dataId: aPart.dataId,
+ dtype: aPart.dtype,
+ shape: a.shape
+ };
+ var bHandle = {
+ dataId: bPart.dataId,
+ dtype: bPart.dtype,
+ shape: b.shape
+ };
+ var program2 = new BinaryOpProgram(opSnippet, a.shape, b.shape);
+ return webglBackend.runWebGLProgram(program2, [aHandle, bHandle], tf2.upcastType(aPart.dtype, bPart.dtype));
+ }), real2 = _c2[0], imag2 = _c2[1];
+ var complexOutput = complex({inputs: {real: real2, imag: imag2}, backend: webglBackend});
+ webglBackend.disposeIntermediateTensorInfo(real2);
+ webglBackend.disposeIntermediateTensorInfo(imag2);
+ return complexOutput;
+ }
+ var $dtype = dtype || tf2.upcastType(a.dtype, b.dtype);
+ if (webglBackend.shouldExecuteOnCPU([a, b]) && cpuKernelImpl != null) {
+ var aData = webglBackend.texData.get(a.dataId);
+ var bData = webglBackend.texData.get(b.dataId);
+ var _d = cpuKernelImpl(a.shape, b.shape, aData.values, bData.values, $dtype), outValues = _d[0], outShape = _d[1];
+ var out = webglBackend.makeTensorInfo(outShape, $dtype);
+ var outData = webglBackend.texData.get(out.dataId);
+ outData.values = outValues;
+ return out;
+ }
+ var shouldUsePackedProgram = tf2.env().getBool("WEBGL_PACK_BINARY_OPERATIONS") && packedOpSnippet != null;
+ var program;
+ if (shouldUsePackedProgram) {
+ program = new BinaryOpPackedProgram(packedOpSnippet, a.shape, b.shape, checkOutOfBounds);
+ } else {
+ program = new BinaryOpProgram(opSnippet, a.shape, b.shape);
+ }
+ return webglBackend.runWebGLProgram(program, [a, b], $dtype);
+ };
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var ADD = "return a + b;";
+ var addKernelFunc = binaryKernelFunc({
+ opSnippet: ADD,
+ packedOpSnippet: ADD,
+ supportsComplex: true,
+ cpuKernelImpl: addImplCPU
+ });
+ var addConfig = {
+ kernelName: tf2.Add,
+ backendName: "webgl",
+ kernelFunc: addKernelFunc
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var ATAN2 = CHECK_NAN_SNIPPET_BINARY + "\n return atan(a, b);\n";
+ var ATAN2_PACKED = "\n vec4 result = atan(a, b);\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n " + CHECK_NAN_SNIPPET_BINARY_PACKED + "\n return result;\n";
+ var atan2 = binaryKernelFunc({opSnippet: ATAN2, packedOpSnippet: ATAN2_PACKED});
+ var atan2Config = {
+ kernelName: tf2.Atan2,
+ backendName: "webgl",
+ kernelFunc: atan2
+ };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -64111,7 +64989,7 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* limitations under the License.
* =============================================================================
*/
- var batchNormKernelFunc = function(_a) {
+ var batchNorm = function(_a) {
var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs;
var x = inputs.x, mean = inputs.mean, variance = inputs.variance, offset = inputs.offset, scale = inputs.scale;
tf2.util.assert(mean.shape.length === variance.shape.length, function() {
@@ -64145,7 +65023,452 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var batchNormConfig = {
kernelName: tf2.FusedBatchNorm,
backendName: "webgl",
- kernelFunc: batchNormKernelFunc
+ kernelFunc: batchNorm
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var NOT_EQUAL = "return float(a != b);";
+ var notEqual = binaryKernelFunc({opSnippet: NOT_EQUAL, dtype: "bool"});
+ var notEqualConfig = {
+ kernelName: tf2.NotEqual,
+ backendName: "webgl",
+ kernelFunc: notEqual
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function real(args) {
+ var inputs = args.inputs, backend = args.backend;
+ var input = inputs.input;
+ var inputData = backend.texData.get(input.dataId);
+ return identity({inputs: {x: inputData.complexTensorInfos.real}, backend});
+ }
+ var realConfig = {
+ kernelName: tf2.Real,
+ backendName: "webgl",
+ kernelFunc: real
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var TO_INT = "return float(int(x));";
+ function int(input, backend) {
+ var program = new UnaryOpProgram(input.shape, TO_INT);
+ var output = backend.runWebGLProgram(program, [input], "int32");
+ return {dataId: output.dataId, shape: output.shape, dtype: output.dtype};
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function cast(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x;
+ var dtype = attrs.dtype;
+ if (dtype === "complex64") {
+ if (x.dtype === "complex64") {
+ return identity({inputs: {x}, backend});
+ }
+ var zerosTensor = tf2.zeros(x.shape);
+ var floatX = cast({inputs: {x}, backend, attrs: {dtype: "float32"}});
+ var result = complex({inputs: {real: floatX, imag: zerosTensor}, backend});
+ zerosTensor.dispose();
+ backend.disposeIntermediateTensorInfo(floatX);
+ return result;
+ }
+ if (x.dtype === "complex64") {
+ var realPart = real({inputs: {input: x}, backend});
+ var result = cast({inputs: {x: realPart}, backend, attrs: {dtype}});
+ backend.disposeIntermediateTensorInfo(realPart);
+ return result;
+ }
+ if (!tf2.util.hasEncodingLoss(x.dtype, dtype)) {
+ var result = identity({inputs: {x}, backend});
+ return {dataId: result.dataId, shape: result.shape, dtype};
+ }
+ if (dtype === "int32") {
+ return int(x, backend);
+ }
+ if (dtype === "bool") {
+ var zerosTensorInfo = backend.makeTensorInfo([], "bool", tf2.util.getTypedArrayFromDType("bool", 1));
+ var binaryInputs = {a: x, b: zerosTensorInfo};
+ var result = notEqual({inputs: binaryInputs, backend});
+ backend.disposeIntermediateTensorInfo(zerosTensorInfo);
+ return result;
+ }
+ throw new Error("Error in Cast: failed to cast " + x.dtype + " to " + dtype);
+ }
+ var castConfig = {
+ kernelName: tf2.Cast,
+ backendName: "webgl",
+ kernelFunc: cast
+ };
+ /**
+ * @license
+ * Copyright 2017 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var ConcatProgram = function() {
+ function ConcatProgram2(shapes) {
+ this.outputShape = [];
+ this.outputShape = tf2.backend_util.computeOutShape(shapes, 1);
+ this.variableNames = shapes.map(function(_, i2) {
+ return "T" + i2;
+ });
+ var offsets = new Array(shapes.length - 1);
+ offsets[0] = shapes[0][1];
+ for (var i = 1; i < offsets.length; i++) {
+ offsets[i] = offsets[i - 1] + shapes[i][1];
+ }
+ var snippets = ["if (yC < " + offsets[0] + ") setOutput(getT0(yR, yC));"];
+ for (var i = 1; i < offsets.length; i++) {
+ var shift = offsets[i - 1];
+ snippets.push("else if (yC < " + offsets[i] + ") " + ("setOutput(getT" + i + "(yR, yC-" + shift + "));"));
+ }
+ var lastIndex = offsets.length;
+ var lastShift = offsets[offsets.length - 1];
+ snippets.push("else setOutput(getT" + lastIndex + "(yR, yC-" + lastShift + "));");
+ this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n " + snippets.join("\n ") + "\n }\n ";
+ }
+ return ConcatProgram2;
+ }();
+ /**
+ * @license
+ * Copyright 2019 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var ConcatPackedProgram = function() {
+ function ConcatPackedProgram2(shapes, axis) {
+ this.packedInputs = true;
+ this.packedOutput = true;
+ this.outputShape = [];
+ this.outputShape = tf2.backend_util.computeOutShape(shapes, axis);
+ var shape = this.outputShape;
+ var rank = shape.length;
+ var dtype = getCoordsDataType(rank);
+ var coords2 = getChannels("coords", rank);
+ var channels = ["x", "y", "z", "w", "u", "v"].slice(0, rank);
+ this.variableNames = shapes.map(function(_, i2) {
+ return "T" + i2;
+ });
+ var offsets = new Array(shapes.length - 1);
+ offsets[0] = shapes[0][axis];
+ for (var i = 1; i < offsets.length; i++) {
+ offsets[i] = offsets[i - 1] + shapes[i][axis];
+ }
+ var channel = channels[axis];
+ var lastChannels = channels.slice(-2);
+ var allChannels = channels.join();
+ var getValueSnippet = "if (" + channel + " < " + offsets[0] + ") {\n return getChannel(\n getT0(" + allChannels + "), vec2(" + lastChannels.join() + "));\n }";
+ for (var i = 1; i < offsets.length; i++) {
+ var shift_1 = offsets[i - 1];
+ getValueSnippet += "\n if (" + channel + " < " + offsets[i] + " && " + channel + " >= " + offsets[i - 1] + ") {\n return getChannel(\n getT" + i + "(" + shiftedChannels(channels, channel, shift_1) + "),\n vec2(" + shiftedChannels(lastChannels, channel, shift_1) + "));\n }";
+ }
+ var lastIndex = offsets.length;
+ var shift = offsets[offsets.length - 1];
+ getValueSnippet += "\n return getChannel(\n getT" + lastIndex + "(" + shiftedChannels(channels, channel, shift) + "),\n vec2(" + shiftedChannels(lastChannels, channel, shift) + "));";
+ this.userCode = "\n float getValue(" + channels.map(function(x) {
+ return "int " + x;
+ }) + ") {\n " + getValueSnippet + "\n }\n\n void main() {\n " + dtype + " coords = getOutputCoords();\n vec4 result = vec4(getValue(" + coords2 + "), 0., 0., 0.);\n\n " + coords2[rank - 1] + " = " + coords2[rank - 1] + " + 1;\n if (" + coords2[rank - 1] + " < " + shape[rank - 1] + ") {\n result.g = getValue(" + coords2 + ");\n }\n\n " + coords2[rank - 2] + " = " + coords2[rank - 2] + " + 1;\n if (" + coords2[rank - 2] + " < " + shape[rank - 2] + ") {\n result.a = getValue(" + coords2 + ");\n }\n\n " + coords2[rank - 1] + " = " + coords2[rank - 1] + " - 1;\n if (" + coords2[rank - 2] + " < " + shape[rank - 2] + " &&\n " + coords2[rank - 1] + " < " + shape[rank - 1] + ") {\n result.b = getValue(" + coords2 + ");\n }\n setOutput(result);\n }\n ";
+ }
+ return ConcatPackedProgram2;
+ }();
+ function shiftedChannels(channels, channel, shift) {
+ var channelIdx = channels.indexOf(channel);
+ var res = channels.map(function(c, idx) {
+ if (idx === channelIdx) {
+ return c + " - " + shift;
+ } else {
+ return c;
+ }
+ });
+ return res.join();
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function imag(args) {
+ var inputs = args.inputs, backend = args.backend;
+ var input = inputs.input;
+ var inputData = backend.texData.get(input.dataId);
+ return identity({inputs: {x: inputData.complexTensorInfos.imag}, backend});
+ }
+ var imagConfig = {
+ kernelName: tf2.Imag,
+ backendName: "webgl",
+ kernelFunc: imag
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function packedReshape(input, afterShape, backend) {
+ var input3DShape = [getBatchDim(input.shape)].concat(getRowsCols(input.shape));
+ var input3D = {
+ dtype: input.dtype,
+ shape: input3DShape,
+ dataId: input.dataId
+ };
+ var afterShapeAs3D = [getBatchDim(afterShape)].concat(getRowsCols(afterShape));
+ var program = new ReshapePackedProgram(afterShapeAs3D, input3DShape);
+ var preventEagerUnpackingOfOutput = true;
+ var output = backend.runWebGLProgram(program, [input3D], input.dtype, null, preventEagerUnpackingOfOutput);
+ return {dataId: output.dataId, shape: afterShape, dtype: output.dtype};
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function reshape(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var x = inputs.x;
+ var shape = attrs.shape;
+ var webglBackend = backend;
+ var xSize = tf2.util.sizeFromShape(x.shape);
+ var $shape = tf2.util.inferFromImplicitShape(shape, xSize);
+ var $xSize = tf2.util.sizeFromShape($shape);
+ tf2.util.assert(xSize === $xSize, function() {
+ return "The new shape (" + $shape + ") has " + $xSize + " elements and the old " + ("shape (" + x.shape + ") has " + xSize + " elements. The new shape and old ") + "shape must have the same number of elements.";
+ });
+ var xTexData = webglBackend.texData.get(x.dataId);
+ if (xTexData.isPacked && !isReshapeFree(x.shape, $shape) && !(xTexData.texture !== null && isReshapeFree(xTexData.shape, $shape))) {
+ return packedReshape(x, $shape, webglBackend);
+ }
+ webglBackend.incRef(x.dataId);
+ return {dataId: x.dataId, shape: $shape, dtype: x.dtype};
+ }
+ var reshapeConfig = {
+ kernelName: tf2.Reshape,
+ backendName: "webgl",
+ kernelFunc: reshape
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function concatImpl(inputs, axis, backend) {
+ var dtype = inputs[0].dtype;
+ if (dtype === "complex64") {
+ var reals = inputs.map(function(t) {
+ return real({inputs: {input: t}, backend});
+ });
+ var imags = inputs.map(function(t) {
+ return imag({inputs: {input: t}, backend});
+ });
+ var realConcated = concatImpl(reals, axis, backend);
+ var imagConcated = concatImpl(imags, axis, backend);
+ var result_1 = complex({inputs: {real: realConcated, imag: imagConcated}, backend});
+ reals.forEach(function(r) {
+ return backend.disposeIntermediateTensorInfo(r);
+ });
+ imags.forEach(function(i) {
+ return backend.disposeIntermediateTensorInfo(i);
+ });
+ backend.disposeIntermediateTensorInfo(realConcated);
+ backend.disposeIntermediateTensorInfo(imagConcated);
+ return result_1;
+ }
+ if (inputs.length > tf2.env().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")) {
+ var midIndex = Math.floor(inputs.length / 2);
+ var leftSide = concatImpl(inputs.slice(0, midIndex), axis, backend);
+ var rightSide = concatImpl(inputs.slice(midIndex), axis, backend);
+ var result_2 = concatImpl([leftSide, rightSide], axis, backend);
+ backend.disposeIntermediateTensorInfo(leftSide);
+ backend.disposeIntermediateTensorInfo(rightSide);
+ return result_2;
+ }
+ if (tf2.env().getBool("WEBGL_PACK_ARRAY_OPERATIONS") && inputs[0].shape.length > 1) {
+ var program_1 = new ConcatPackedProgram(inputs.map(function(t) {
+ return t.shape;
+ }), axis);
+ return backend.runWebGLProgram(program_1, inputs, dtype);
+ }
+ var outShape = tf2.backend_util.computeOutShape(inputs.map(function(t) {
+ return t.shape;
+ }), axis);
+ var tensors2D = inputs.map(function(x) {
+ return reshape({
+ inputs: {x},
+ attrs: {shape: [-1, tf2.util.sizeFromShape(x.shape.slice(axis))]},
+ backend
+ });
+ });
+ var program = new ConcatProgram(tensors2D.map(function(t) {
+ return t.shape;
+ }));
+ var result = backend.runWebGLProgram(program, tensors2D, dtype);
+ tensors2D.forEach(function(r) {
+ return backend.disposeIntermediateTensorInfo(r);
+ });
+ var reshapedResult = reshape({inputs: {x: result}, attrs: {shape: outShape}, backend});
+ backend.disposeIntermediateTensorInfo(result);
+ return reshapedResult;
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function concat(args) {
+ var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
+ var axis = attrs.axis;
+ var $axis = tf2.util.parseAxisParam(axis, inputs[0].shape)[0];
+ var outShape = tf2.backend_util.computeOutShape(inputs.map(function(t) {
+ return t.shape;
+ }), $axis);
+ if (tf2.util.sizeFromShape(outShape) === 0) {
+ return backend.makeTensorInfo(outShape, inputs[0].dtype, []);
+ }
+ var $inputs = inputs.filter(function(t) {
+ return tf2.util.sizeFromShape(t.shape) > 0;
+ });
+ if ($inputs.length === 1) {
+ return $inputs[0];
+ }
+ var shapes = $inputs.map(function(t) {
+ return t.shape;
+ });
+ tf2.backend_util.assertParamsConsistent(shapes, $axis);
+ return concatImpl($inputs, $axis, backend);
+ }
+ var concatConfig = {
+ kernelName: tf2.Concat,
+ backendName: "webgl",
+ kernelFunc: concat
};
/**
* @license
@@ -64164,11 +65487,11 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* =============================================================================
*/
var COS = CHECK_NAN_SNIPPET_UNARY + "\n return cos(x);\n";
- var cosKernelFunc = unaryKernelFunc(COS);
+ var cos = unaryKernelFunc(COS);
var cosConfig = {
kernelName: tf2.Cos,
backendName: "webgl",
- kernelFunc: cosKernelFunc
+ kernelFunc: cos
};
/**
* @license
@@ -64188,11 +65511,118 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
*/
var DIV = "\nif (a == b) {\n return 1.0;\n};\nreturn a / b;";
var DIV_PACKED = "\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n";
- var divKernelFunc = binaryKernelFunc(DIV, DIV_PACKED, true);
+ var div = binaryKernelFunc({opSnippet: DIV, packedOpSnippet: DIV_PACKED, checkOutOfBounds: true});
var divConfig = {
kernelName: tf2.Div,
backendName: "webgl",
- kernelFunc: divKernelFunc
+ kernelFunc: div
+ };
+ /**
+ * @license
+ * Copyright 2018 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var FFTProgram = function() {
+ function FFTProgram2(component, inputShape, inverse) {
+ this.variableNames = ["real", "imag"];
+ var innerDim = inputShape[1];
+ this.outputShape = inputShape;
+ var exponentMultiplierSnippet = inverse ? "2.0 * " + Math.PI : "-2.0 * " + Math.PI;
+ var resultDenominator = inverse ? innerDim + ".0" : "1.0";
+ var opString;
+ if (component === "real") {
+ opString = "return real * expR - imag * expI;";
+ } else if (component === "imag") {
+ opString = "return real * expI + imag * expR;";
+ } else {
+ throw new Error('FFT component must be either "real" or "imag", got ' + component + ".");
+ }
+ this.userCode = "\n const float exponentMultiplier = " + exponentMultiplierSnippet + ";\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n " + opString + "\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(" + innerDim + ");\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < " + innerDim + "; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / " + resultDenominator + ";\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n ";
+ }
+ return FFTProgram2;
+ }();
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function fftImpl(x, inverse, backend) {
+ var xData = backend.texData.get(x.dataId);
+ var inputSize = tf2.util.sizeFromShape(x.shape);
+ var innerDimensionSize = x.shape[x.shape.length - 1];
+ var batch = inputSize / innerDimensionSize;
+ var input2D = reshape({inputs: {x}, backend, attrs: {shape: [batch, innerDimensionSize]}});
+ var xShape = input2D.shape;
+ var realProgram = new FFTProgram("real", xShape, inverse);
+ var imagProgram = new FFTProgram("imag", xShape, inverse);
+ var inputs = [
+ {
+ dataId: xData.complexTensorInfos.real.dataId,
+ dtype: xData.complexTensorInfos.real.dtype,
+ shape: xShape
+ },
+ {
+ dataId: xData.complexTensorInfos.imag.dataId,
+ dtype: xData.complexTensorInfos.imag.dtype,
+ shape: xShape
+ }
+ ];
+ var realPart = backend.runWebGLProgram(realProgram, inputs, "float32");
+ var imagPart = backend.runWebGLProgram(imagProgram, inputs, "float32");
+ var complexOutput = complex({inputs: {real: realPart, imag: imagPart}, backend});
+ backend.disposeIntermediateTensorInfo(realPart);
+ backend.disposeIntermediateTensorInfo(imagPart);
+ var complexOutputReshaped = reshape({inputs: {x: complexOutput}, backend, attrs: {shape: x.shape}});
+ backend.disposeIntermediateTensorInfo(complexOutputReshaped);
+ return complexOutputReshaped;
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function fft(args) {
+ var inputs = args.inputs, backend = args.backend;
+ var input = inputs.input;
+ return fftImpl(input, false, backend);
+ }
+ var fftConfig = {
+ kernelName: tf2.FFT,
+ backendName: "webgl",
+ kernelFunc: fft
};
/**
* @license
@@ -64353,6 +65783,68 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
backend.disposeData(tempPixelHandle.dataId);
return res;
}
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function ifft(args) {
+ var inputs = args.inputs, backend = args.backend;
+ var input = inputs.input;
+ return fftImpl(input, true, backend);
+ }
+ var ifftConfig = {
+ kernelName: tf2.IFFT,
+ backendName: "webgl",
+ kernelFunc: ifft
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var MeanProgram = function() {
+ function MeanProgram2(reduceInfo, divisor) {
+ this.variableNames = ["x"];
+ var windowSize = reduceInfo.windowSize, batchSize = reduceInfo.batchSize, inSize = reduceInfo.inSize, outSize = reduceInfo.outSize;
+ this.outputShape = [batchSize, outSize];
+ var windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4;
+ var windowSizeVec4Remainder = windowSize % 4;
+ var updateSnippet = "sumValue += dot(values, ones);";
+ if (divisor != null) {
+ var denominator = 1 / divisor;
+ updateSnippet = "sumValue += dot(values * " + (tf2.util.isInt(denominator) ? denominator.toPrecision(2) : denominator) + ", ones);";
+ }
+ var checkOutOfBounds = "";
+ if (inSize % windowSize > 0) {
+ checkOutOfBounds = "\n if (inIdx < 0 || inIdx >= " + inSize + ") {\n return 0.0;\n }\n ";
+ }
+ this.userCode = "\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n " + checkOutOfBounds + "\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * " + windowSize + ";\n\n float sumValue = 0.0;\n\n for (int i = 0; i < " + windowSizeNearestVec4 + "; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n " + updateSnippet + "\n }\n\n int inIdx = inOffset + " + windowSizeNearestVec4 + ";\n if (" + (windowSizeVec4Remainder === 1) + ") {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 2) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 3) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n " + updateSnippet + "\n }\n setOutput(sumValue);\n }\n ";
+ }
+ return MeanProgram2;
+ }();
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -64387,83 +65879,21 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
var result = x;
for (var i = 0; i < reductionStages.length; i++) {
var _a = reductionStages[i], inSize = _a.inSize, windowSize = _a.windowSize, outSize = _a.outSize;
- var program = new ReduceProgram({windowSize, inSize, batchSize: x.shape[0], outSize}, reductionType);
- var previousResult = result;
+ var program = void 0;
+ var previousResult = void 0;
+ if (reductionType === "mean") {
+ program = i === 0 ? new MeanProgram({windowSize, inSize, batchSize: x.shape[0], outSize}, inSize) : new MeanProgram({windowSize, inSize, batchSize: x.shape[0], outSize});
+ } else {
+ program = new ReduceProgram({windowSize, inSize, batchSize: x.shape[0], outSize}, reductionType);
+ }
+ previousResult = result;
result = backend.runWebGLProgram(program, [result], dtype);
if (previousResult.dataId !== x.dataId) {
- backend.disposeData(previousResult.dataId);
+ backend.disposeIntermediateTensorInfo(previousResult);
}
}
return result;
}
- /**
- * @license
- * Copyright 2020 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- function packedReshape(input, afterShape, backend) {
- var input3DShape = [getBatchDim(input.shape)].concat(getRowsCols(input.shape));
- var input3D = {
- dtype: input.dtype,
- shape: input3DShape,
- dataId: input.dataId
- };
- var afterShapeAs3D = [getBatchDim(afterShape)].concat(getRowsCols(afterShape));
- var program = new ReshapePackedProgram(afterShapeAs3D, input3DShape);
- var preventEagerUnpackingOfOutput = true;
- var output = backend.runWebGLProgram(program, [input3D], input.dtype, null, preventEagerUnpackingOfOutput);
- return {dataId: output.dataId, shape: afterShape, dtype: output.dtype};
- }
- /**
- * @license
- * Copyright 2020 Google LLC. All Rights Reserved.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =============================================================================
- */
- function reshape(args) {
- var inputs = args.inputs, backend = args.backend, attrs = args.attrs;
- var x = inputs.x;
- var shape = attrs.shape;
- var webglBackend = backend;
- var xSize = tf2.util.sizeFromShape(x.shape);
- var $shape = tf2.util.inferFromImplicitShape(shape, xSize);
- var $xSize = tf2.util.sizeFromShape($shape);
- tf2.util.assert(xSize === $xSize, function() {
- return "The new shape (" + $shape + ") has " + $xSize + " elements and the old " + ("shape (" + x.shape + ") has " + xSize + " elements. The new shape and old ") + "shape must have the same number of elements.";
- });
- var xTexData = webglBackend.texData.get(x.dataId);
- if (xTexData.isPacked && !isReshapeFree(x.shape, $shape) && !(xTexData.texture !== null && isReshapeFree(xTexData.shape, $shape))) {
- return packedReshape(x, $shape, webglBackend);
- }
- webglBackend.incRef(x.dataId);
- return {dataId: x.dataId, shape: $shape, dtype: x.dtype};
- }
- var reshapeConfig = {
- kernelName: tf2.Reshape,
- backendName: "webgl",
- kernelFunc: reshape
- };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -64800,6 +66230,320 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
return [result, indexes];
}
};
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ function meanImpl(x, reduceShape, outShape, backend) {
+ var inSize = tf2.util.sizeFromShape(reduceShape);
+ var xSize = tf2.util.sizeFromShape(x.shape);
+ var batchSize = xSize / inSize;
+ var reshapedInput = reshape({inputs: {x}, attrs: {shape: [batchSize, inSize]}, backend});
+ var reduced = reduce(reshapedInput, "float32", "mean", backend);
+ var reshapedOutput = reshape({inputs: {x: reduced}, attrs: {shape: outShape}, backend});
+ backend.disposeIntermediateTensorInfo(reshapedInput);
+ backend.disposeIntermediateTensorInfo(reduced);
+ return reshapedOutput;
+ }
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var meanConfig = {
+ kernelName: tf2.Mean,
+ backendName: "webgl",
+ kernelFunc: function(_a) {
+ var inputs = _a.inputs, attrs = _a.attrs, backend = _a.backend;
+ var x = inputs.x;
+ var _b = attrs, keepDims = _b.keepDims, axis = _b.axis;
+ var webglBackend = backend;
+ var xRank = x.shape.length;
+ var origAxes = tf2.util.parseAxisParam(axis, x.shape);
+ var axes = origAxes;
+ var permutedAxes = tf2.backend_util.getAxesPermutation(axes, xRank);
+ var meanInputIsTransposed = permutedAxes != null;
+ var shouldExecuteOnCPU = webglBackend.shouldExecuteOnCPU([x]);
+ var intermediates = [];
+ var meanInput = x;
+ if (meanInputIsTransposed) {
+ if (shouldExecuteOnCPU) {
+ var xTexData = webglBackend.texData.get(meanInput.dataId);
+ var values = xTexData.values;
+ var newShape = new Array(xRank);
+ for (var i = 0; i < newShape.length; i++) {
+ newShape[i] = x.shape[permutedAxes[i]];
+ }
+ var meanInputValues = transposeImplCPU(values, x.shape, x.dtype, permutedAxes, newShape);
+ meanInput = webglBackend.makeTensorInfo(newShape, x.dtype);
+ var meanInputData = webglBackend.texData.get(meanInput.dataId);
+ meanInputData.values = meanInputValues;
+ } else {
+ meanInput = transposeImpl$1(x, permutedAxes, webglBackend);
+ }
+ intermediates.push(meanInput);
+ axes = tf2.backend_util.getInnerMostAxes(axes.length, xRank);
+ }
+ tf2.backend_util.assertAxesAreInnerMostDims("sum", axes, xRank);
+ var _c = tf2.backend_util.computeOutAndReduceShapes(meanInput.shape, axes), meanOutShape = _c[0], reduceShape = _c[1];
+ var outShape = meanOutShape;
+ if (keepDims) {
+ outShape = tf2.backend_util.expandShapeToKeepDim(meanOutShape, origAxes);
+ }
+ var out = meanImpl(meanInput, reduceShape, outShape, webglBackend);
+ for (var _i2 = 0, intermediates_1 = intermediates; _i2 < intermediates_1.length; _i2++) {
+ var i = intermediates_1[_i2];
+ webglBackend.disposeIntermediateTensorInfo(i);
+ }
+ return out;
+ }
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var MirrorPadProgram = function() {
+ function MirrorPadProgram2(xShape, paddings, mode) {
+ this.variableNames = ["x"];
+ this.outputShape = paddings.map(function(p, i) {
+ return p[0] + xShape[i] + p[1];
+ });
+ var rank = xShape.length;
+ var dtype = getCoordsDataType(rank);
+ var start = paddings.map(function(p) {
+ return p[0];
+ }).join(",");
+ var end = paddings.map(function(p, i) {
+ return p[0] + xShape[i];
+ }).join(",");
+ var unpackedCoords = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, rank);
+ var offset = mode === "reflect" ? 0 : 1;
+ if (rank === 1) {
+ this.userCode = "\n int start = " + start + ";\n int end = " + end + ";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - " + offset + ";\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + " + offset + ";\n }\n setOutput(getX(outC - start));\n }\n ";
+ return;
+ }
+ this.userCode = "\n " + dtype + " start = " + dtype + "(" + start + ");\n " + dtype + " end = " + dtype + "(" + end + ");\n\n void main() {\n " + dtype + " outC = getOutputCoords();\n for (int i = 0; i < " + rank + "; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - " + offset + ";\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + " + offset + ";\n }\n }\n " + dtype + " coords = outC - start;\n setOutput(getX(" + unpackedCoords + "));\n }\n ";
+ }
+ return MirrorPadProgram2;
+ }();
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var MirrorPadPackedProgram = function() {
+ function MirrorPadPackedProgram2(xShape, paddings, mode) {
+ this.variableNames = ["x"];
+ this.packedInputs = true;
+ this.packedOutput = true;
+ this.outputShape = paddings.map(function(p, i) {
+ return p[0] + xShape[i] + p[1];
+ });
+ var rank = xShape.length;
+ var dtype = getCoordsDataType(rank);
+ var start = paddings.map(function(p) {
+ return p[0];
+ }).join(",");
+ var end = paddings.map(function(p, i) {
+ return p[0] + xShape[i];
+ }).join(",");
+ var coords2 = getChannels("rc", rank);
+ var source = getChannels("source", rank);
+ var cLimit = coords2[rank - 1] + " < " + this.outputShape[rank - 1];
+ var innerDims = rank === 1 ? "source" : "vec2(" + source.slice(-2).join() + ")";
+ var offset = mode === "reflect" ? 0 : 1;
+ var mainLoop = "";
+ if (rank === 1) {
+ var padSetup = "\n " + dtype + " source = rc;\n if (source < start) {\n source = start * 2 - source - " + offset + ";\n } else if (source >= end) {\n source = (end - 1) * 2 - source + " + offset + ";\n }\n source -= start;\n ";
+ mainLoop = "\n " + dtype + " rc = outputLoc;\n " + padSetup + "\n result[0] = getChannel(getX(" + source.join() + "), " + innerDims + ");\n " + coords2[rank - 1] + " += 1;\n if(" + cLimit + ") {\n " + padSetup + "\n result[1] = getChannel(getX(" + source.join() + "), " + innerDims + ");\n }\n ";
+ } else {
+ var padSetup = "\n " + dtype + " source = rc;\n " + dtype + " lt = " + dtype + "(lessThan(source, start));\n " + dtype + " gte = " + dtype + "(greaterThanEqual(source, end));\n " + dtype + " orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - " + offset + ") +\n gte * ((end - 1) * 2 - source + " + offset + ");\n source -= start;\n ";
+ mainLoop = "\n " + dtype + " rc = outputLoc;\n " + padSetup + "\n result[0] = getChannel(getX(" + source.join() + "), " + innerDims + ");\n " + coords2[rank - 1] + " += 1;\n if(" + cLimit + ") {\n " + padSetup + "\n result[1] = getChannel(getX(" + source.join() + "), " + innerDims + ");\n }\n rc = outputLoc;\n " + coords2[rank - 2] + " += 1;\n if(" + coords2[rank - 2] + " < " + this.outputShape[rank - 2] + ") {\n " + padSetup + "\n result[2] = getChannel(getX(" + source.join() + "), " + innerDims + ");\n " + coords2[rank - 1] + " += 1;\n if(" + cLimit + ") {\n " + padSetup + "\n result[3] = getChannel(getX(" + source.join() + "), " + innerDims + ");\n }\n }\n ";
+ }
+ this.userCode = "\n const " + dtype + " start = " + dtype + "(" + start + ");\n const " + dtype + " end = " + dtype + "(" + end + ");\n\n void main() {\n " + dtype + " outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n " + mainLoop + "\n setOutput(result);\n }\n ";
+ }
+ return MirrorPadPackedProgram2;
+ }();
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var mirrorPadKernelFunc = function(_a) {
+ var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs;
+ var x = inputs.x;
+ var paddings = attrs.paddings, mode = attrs.mode;
+ var program = tf2.env().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new MirrorPadPackedProgram(x.shape, paddings, mode) : new MirrorPadProgram(x.shape, paddings, mode);
+ var output = backend.runWebGLProgram(program, [x], x.dtype);
+ return output;
+ };
+ var mirrorPadConfig = {
+ kernelName: tf2.MirrorPad,
+ backendName: "webgl",
+ kernelFunc: mirrorPadKernelFunc
+ };
+ /**
+ * @license
+ * Copyright 2018 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var COMPLEX_MULTIPLY = {
+ REAL: "return areal * breal - aimag * bimag;",
+ IMAG: "return areal * bimag + aimag * breal;"
+ };
+ var BinaryOpComplexProgram = function() {
+ function BinaryOpComplexProgram2(op, aShape, bShape) {
+ this.variableNames = ["AReal", "AImag", "BReal", "BImag"];
+ this.outputShape = tf2.backend_util.assertAndGetBroadcastShape(aShape, bShape);
+ this.userCode = "\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n " + op + "\n }\n\n void main() {\n float areal = getARealAtOutCoords();\n float aimag = getAImagAtOutCoords();\n float breal = getBRealAtOutCoords();\n float bimag = getBImagAtOutCoords();\n setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n }\n ";
+ }
+ return BinaryOpComplexProgram2;
+ }();
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var MUL = "return a * b;";
+ function multiply(args) {
+ var inputs = args.inputs, backend = args.backend;
+ var a = inputs.a, b = inputs.b;
+ var dtype = tf2.backend_util.upcastType(a.dtype, b.dtype);
+ if (a.dtype === "complex64") {
+ var aData = backend.texData.get(a.dataId);
+ var bData = backend.texData.get(b.dataId);
+ var realProgram = new BinaryOpComplexProgram(COMPLEX_MULTIPLY.REAL, a.shape, b.shape);
+ var imagProgram = new BinaryOpComplexProgram(COMPLEX_MULTIPLY.IMAG, a.shape, b.shape);
+ var inputs_1 = [
+ {
+ dataId: aData.complexTensorInfos.real.dataId,
+ dtype: aData.complexTensorInfos.real.dtype,
+ shape: a.shape
+ },
+ {
+ dataId: aData.complexTensorInfos.imag.dataId,
+ dtype: aData.complexTensorInfos.imag.dtype,
+ shape: a.shape
+ },
+ {
+ dataId: bData.complexTensorInfos.real.dataId,
+ dtype: bData.complexTensorInfos.real.dtype,
+ shape: b.shape
+ },
+ {
+ dataId: bData.complexTensorInfos.imag.dataId,
+ dtype: bData.complexTensorInfos.imag.dtype,
+ shape: b.shape
+ }
+ ];
+ var realPart = backend.runWebGLProgram(realProgram, inputs_1, "float32");
+ var imagPart = backend.runWebGLProgram(imagProgram, inputs_1, "float32");
+ var complexOutput = complex({inputs: {real: realPart, imag: imagPart}, backend});
+ backend.disposeIntermediateTensorInfo(realPart);
+ backend.disposeIntermediateTensorInfo(imagPart);
+ return complexOutput;
+ }
+ if (backend.shouldExecuteOnCPU([a, b])) {
+ var aData = backend.texData.get(a.dataId);
+ var bData = backend.texData.get(b.dataId);
+ var _a = multiplyImplCPU(a.shape, b.shape, aData.values, bData.values, dtype), outValues = _a[0], outShape = _a[1];
+ var out = backend.makeTensorInfo(outShape, dtype);
+ var outData = backend.texData.get(out.dataId);
+ outData.values = outValues;
+ return out;
+ }
+ var program;
+ if (tf2.env().getBool("WEBGL_PACK_BINARY_OPERATIONS")) {
+ program = new BinaryOpPackedProgram(MUL, a.shape, b.shape);
+ } else {
+ program = new BinaryOpProgram(MUL, a.shape, b.shape);
+ }
+ return backend.runWebGLProgram(program, [a, b], dtype);
+ }
+ var multiplyConfig = {
+ kernelName: tf2.Multiply,
+ backendName: "webgl",
+ kernelFunc: multiply
+ };
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
@@ -64985,11 +66729,11 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* =============================================================================
*/
var SIN = CHECK_NAN_SNIPPET_UNARY + "\n return sin(x);\n";
- var sinKernelFunc = unaryKernelFunc(SIN);
+ var sin = unaryKernelFunc(SIN);
var sinConfig = {
kernelName: tf2.Sin,
backendName: "webgl",
- kernelFunc: sinKernelFunc
+ kernelFunc: sin
};
/**
* @license
@@ -65008,11 +66752,11 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* =============================================================================
*/
var SQUARE = "return x * x;";
- var squareKernelFunc = unaryKernelFunc(SQUARE);
+ var square = unaryKernelFunc(SQUARE);
var squareConfig = {
kernelName: tf2.Square,
backendName: "webgl",
- kernelFunc: squareKernelFunc
+ kernelFunc: square
};
/**
* @license
@@ -65031,11 +66775,39 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* =============================================================================
*/
var SQUARED_DIFFERENCE = "return (a - b) * (a - b);";
- var squaredDifferenceKernelFunc = binaryKernelFunc(SQUARED_DIFFERENCE, SQUARED_DIFFERENCE);
+ var squaredDifference = binaryKernelFunc({opSnippet: SQUARED_DIFFERENCE, packedOpSnippet: SQUARED_DIFFERENCE});
var squaredDifferenceConfig = {
kernelName: tf2.SquaredDifference,
backendName: "webgl",
- kernelFunc: squaredDifferenceKernelFunc
+ kernelFunc: squaredDifference
+ };
+ /**
+ * @license
+ * Copyright 2020 Google LLC. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =============================================================================
+ */
+ var SUB = "return a - b;";
+ var subKernelFunc = binaryKernelFunc({
+ opSnippet: SUB,
+ packedOpSnippet: SUB,
+ supportsComplex: true,
+ cpuKernelImpl: subImplCPU
+ });
+ var subConfig = {
+ kernelName: tf2.Sub,
+ backendName: "webgl",
+ kernelFunc: subKernelFunc
};
/**
* @license
@@ -65054,11 +66826,11 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* =============================================================================
*/
var TAN = "return tan(x);";
- var tanKernelFunc = unaryKernelFunc(TAN);
+ var tan = unaryKernelFunc(TAN);
var tanConfig = {
kernelName: tf2.Tan,
backendName: "webgl",
- kernelFunc: tanKernelFunc
+ kernelFunc: tan
};
/**
* @license
@@ -65154,26 +66926,39 @@ var require_tf_backend_webgl_node = __commonJS((exports) => {
* =============================================================================
*/
var kernelConfigs = [
+ addConfig,
atan2Config,
avgPoolConfig,
avgPoolBackpropConfig,
batchNormConfig,
+ castConfig,
+ complexConfig,
+ concatConfig,
cosConfig,
divConfig,
+ fftConfig,
flipLeftRightConfig,
fromPixelsConfig,
identityConfig,
+ ifftConfig,
+ imagConfig,
maxConfig,
maxPoolConfig,
maxPoolBackpropConfig,
maxPoolWithArgmaxConfig,
+ meanConfig,
+ mirrorPadConfig,
+ multiplyConfig,
nonMaxSuppressionV3Config,
nonMaxSuppressionV4Config,
nonMaxSuppressionV5Config,
+ notEqualConfig,
+ realConfig,
reshapeConfig,
rotateWithOffsetConfig,
sinConfig,
squareConfig,
+ subConfig,
squaredDifferenceConfig,
tanConfig,
transposeConfig,
@@ -65220,7 +67005,7 @@ var require_tf_node = __commonJS((exports) => {
var tfjsBackendCpu = require_tf_backend_cpu_node();
var tfjsBackendWebgl = require_tf_backend_webgl_node();
/** @license See the LICENSE file. */
- var version = "2.6.0";
+ var version = "2.7.0";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
@@ -70950,6 +72735,8 @@ var require_config = __commonJS((exports) => {
videoOptimized: true,
filter: {
enabled: true,
+ width: 0,
+ height: 0,
return: true,
brightness: 0,
contrast: 0,
@@ -71039,7 +72826,7 @@ var require_config = __commonJS((exports) => {
var require_package = __commonJS((exports, module) => {
module.exports = {
name: "@vladmandic/human",
- version: "0.4.2",
+ version: "0.4.3",
description: "human: 3D Face Detection, Iris Tracking and Age & Gender Prediction",
sideEffects: false,
main: "dist/human.cjs",
@@ -71061,19 +72848,19 @@ var require_package = __commonJS((exports, module) => {
dependencies: {},
peerDependencies: {},
devDependencies: {
+ "@tensorflow/tfjs": "^2.7.0",
+ "@tensorflow/tfjs-node": "^2.7.0",
"@vladmandic/pilogger": "^0.2.6",
- dayjs: "^1.9.3",
- "simple-git": "^2.21.0",
- "@tensorflow/tfjs": "^2.6.0",
- "@tensorflow/tfjs-node": "^2.6.0",
- esbuild: "^0.7.15",
- eslint: "^7.10.0",
+ dayjs: "^1.9.4",
+ esbuild: "^0.7.21",
+ eslint: "^7.12.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
- rimraf: "^3.0.2"
+ rimraf: "^3.0.2",
+ "simple-git": "^2.21.0"
},
scripts: {
start: "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
@@ -71221,14 +73008,24 @@ class Human {
tfImage(input) {
let filtered;
if (this.fx && this.config.filter.enabled && !(input instanceof tf.Tensor)) {
- const width = input.naturalWidth || input.videoWidth || input.width || input.shape && input.shape[1] > 0;
- const height = input.naturalHeight || input.videoHeight || input.height || input.shape && input.shape[2] > 0;
- const offscreenCanvas = new OffscreenCanvas(width, height);
+ const originalWidth = input.naturalWidth || input.videoWidth || input.width || input.shape && input.shape[1] > 0;
+ const originalHeight = input.naturalHeight || input.videoHeight || input.height || input.shape && input.shape[2] > 0;
+ let targetWidth = originalWidth;
+ if (this.config.filter.width > 0)
+ targetWidth = this.config.filter.width;
+ else if (this.config.filter.height > 0)
+ targetWidth = originalWidth * (this.config.filter.height / originalHeight);
+ let targetHeight = originalHeight;
+ if (this.config.filter.height > 0)
+ targetHeight = this.config.filter.height;
+ else if (this.config.filter.width > 0)
+ targetHeight = originalHeight * (this.config.filter.width / originalWidth);
+ const offscreenCanvas = new OffscreenCanvas(targetWidth, targetHeight);
const ctx = offscreenCanvas.getContext("2d");
if (input instanceof ImageData)
ctx.putImageData(input, 0, 0);
else
- ctx.drawImage(input, 0, 0, width, height, 0, 0, offscreenCanvas.width, offscreenCanvas.height);
+ ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, offscreenCanvas.width, offscreenCanvas.height);
this.fx.reset();
this.fx.addFilter("brightness", this.config.filter.brightness);
if (this.config.filter.contrast !== 0)
diff --git a/dist/human.esm.js.map b/dist/human.esm.js.map
index 65ec3307..741eb902 100644
--- a/dist/human.esm.js.map
+++ b/dist/human.esm.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
- "sources": ["empty:/home/vlado/dev/human/node_modules/node-fetch/browser.js", "empty:util", "empty:crypto", "../node_modules/@tensorflow/tfjs-core/src/backends/backend.ts", "../node_modules/@tensorflow/tfjs-core/src/environment.ts", "../node_modules/@tensorflow/tfjs-core/src/global_util.ts", "../node_modules/@tensorflow/tfjs-core/src/kernel_names.ts", "../node_modules/@tensorflow/tfjs-core/src/kernel_registry.ts", "../node_modules/@tensorflow/tfjs-core/src/util.ts", "../node_modules/@tensorflow/tfjs-core/src/profiler.ts", "../node_modules/@tensorflow/tfjs-core/src/tape.ts", "../node_modules/@tensorflow/tfjs-core/src/tensor_format.ts", "../node_modules/@tensorflow/tfjs-core/src/tensor.ts", "../node_modules/@tensorflow/tfjs-core/src/types.ts", "../node_modules/@tensorflow/tfjs-core/src/tensor_util.ts", "../node_modules/@tensorflow/tfjs-core/src/engine.ts", "../node_modules/@tensorflow/tfjs-core/src/device_util.ts", "../node_modules/@tensorflow/tfjs-core/src/flags.ts", "../node_modules/@tensorflow/tfjs-core/src/tensor_util_env.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/operation.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/complex.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tensor_ops_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tensor.ts", "../node_modules/@tensorflow/tfjs-core/src/io/types.ts", "../node_modules/@tensorflow/tfjs-core/src/io/io_utils.ts", "../node_modules/@tensorflow/tfjs-core/src/io/router_registry.ts", "../node_modules/@tensorflow/tfjs-core/src/io/indexed_db.ts", "../node_modules/@tensorflow/tfjs-core/src/io/local_storage.ts", "../node_modules/@tensorflow/tfjs-core/src/io/model_management.ts", "../node_modules/@tensorflow/tfjs-core/src/platforms/platform_browser.ts", "../node_modules/@tensorflow/tfjs-core/src/platforms/platform_node.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/buffer.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/cast.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/clone.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/print.ts", "../node_modules/@tensorflow/tfjs-core/src/base_side_effects.ts", "../node_modules/@tensorflow/tfjs-core/src/io/browser_files.ts", "../node_modules/@tensorflow/tfjs-core/src/io/progress.ts", "../node_modules/@tensorflow/tfjs-core/src/io/weights_loader.ts", "../node_modules/@tensorflow/tfjs-core/src/io/http.ts", "../node_modules/@tensorflow/tfjs-core/src/io/passthrough.ts", "../node_modules/@tensorflow/tfjs-core/src/io/io.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/reshape.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/mat_mul.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/one_hot.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/transpose.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/confusion_matrix.ts", "../node_modules/@tensorflow/tfjs-core/src/math.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tensor3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/browser.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/gather_nd_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/scatter_nd_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/slice_util.ts", "../node_modules/@tensorflow/tfjs-core/src/serialization.ts", "../node_modules/@tensorflow/tfjs-core/src/test_util.ts", "../node_modules/@tensorflow/tfjs-core/src/version.ts", "../node_modules/@tensorflow/tfjs-core/src/globals.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/add.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/floorDiv.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/div.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/mul.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/abs.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/acos.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/acosh.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/add_n.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/axis_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/all.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/any.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/arg_max.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/arg_min.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/asin.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/asinh.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/atan.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/atan2.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/atanh.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/avg_pool.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/concat_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/concat.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sigmoid.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/slice.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tanh.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/basic_lstm_cell.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/batch_to_space_nd.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/batchnorm_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/batchnorm.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/batchnorm2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/batchnorm3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/batchnorm4d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/broadcast_to.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/ceil.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/clip_by_value.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/concat_1d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/concat_2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/concat_3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/concat_4d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv1d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv2d_backprop_input.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv2d_transpose.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv3d_backprop_input.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv3d_transpose.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/cos.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/cosh.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/cumsum.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/depth_to_space.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/diag.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/dilation2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/broadcast_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/equal.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/where.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/zeros_like.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/div_no_nan.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/dot.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/elu.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/erf.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/exp.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/expand_dims.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/expm1.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tile.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/eye.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/fill.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/floor.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/reduce_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/segment_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/gather.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/greater.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/greater_equal.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/imag.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/is_finite.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/is_inf.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/is_nan.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/maximum.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/scalar.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/leaky_relu.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/less.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/less_equal.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/linspace.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/local_response_normalization.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/log.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/log1p.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/neg.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/softplus.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/log_sigmoid.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/max.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sub.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sum.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/log_softmax.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/log_sum_exp.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/logical_and.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/logical_not.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/logical_or.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/logical_xor.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/max_pool.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/max_pool_3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/max_pool_with_argmax.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/zeros.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/ones.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/mean.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/min.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/minimum.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/mod.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/square.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/moments.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/multi_rnn_cell.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/multinomial.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/not_equal.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/real.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/ones_like.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/outer_product.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/pad.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/pad1d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/pad2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/pad3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/pad4d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/space_to_batch_nd.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/pool.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/pow.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/prelu.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/prod.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/rand.ts", "../node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/lib/alea.js", "../node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/lib/xor128.js", "../node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/lib/xorwow.js", "../node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/lib/xor4096.js", "../node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/lib/tychei.js", "../node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/seedrandom.js", "../node_modules/@tensorflow/tfjs-core/node_modules/seedrandom/index.js", "../node_modules/@tensorflow/tfjs-core/src/ops/rand_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/random_gamma.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/random_normal.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/random_uniform.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tensor1d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/range.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/reciprocal.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/relu.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/relu6.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/reverse.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/reverse_1d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/reverse_2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/reverse_3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/reverse_4d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/round.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/rsqrt.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/selu.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/separable_conv2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/setdiff1d_async.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sign.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sin.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sinh.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/slice1d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/slice2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/slice3d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/slice4d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/softmax.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/spectral/fft.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/spectral/ifft.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/spectral/irfft.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/split_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/split.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/spectral/rfft.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sqrt.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/squared_difference.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/squeeze.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/stack.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/step.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/strided_slice.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tan.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tensor2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tensor4d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tensor5d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/tensor6d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/topk.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/truncated_normal.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/unique.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/unsorted_segment_sum.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/unstack.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/variable.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/where_impl.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/where_async.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/boolean_mask.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/compare.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/binary_ops.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/norm.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/moving_average.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/scatter_nd.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sparse_to_dense_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/sparse_to_dense.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/gather_nd.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/dropout_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/dropout.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/signal_ops_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/in_top_k.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv2d_backprop_filter.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/fused_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/fused/conv2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/fused/depthwise_conv2d.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/fused/mat_mul.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/fused_ops.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/signal/hamming_window.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/signal/hann_window.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/signal/frame.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/signal/stft.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/crop_and_resize.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/flip_left_right.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/rotate_with_offset.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/nonmax_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/array_util.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/non_max_suppression_impl.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_async.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_with_score.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_with_score_async.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_padded.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_padded_async.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/resize_bilinear.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/image/resize_nearest_neighbor.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/linalg/band_part.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/linalg/gram_schmidt.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/linalg/qr.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/loss_ops_utils.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/compute_weighted_loss.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/absolute_difference.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/cosine_distance.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/hinge_loss.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/huber_loss.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/log_loss.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/mean_squared_error.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/sigmoid_cross_entropy.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/losses/softmax_cross_entropy.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/ops.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/adadelta_optimizer.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/adagrad_optimizer.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/adam_optimizer.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/adamax_optimizer.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/sgd_optimizer.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/momentum_optimizer.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/rmsprop_optimizer.ts", "../node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer_constructors.ts", "../node_modules/@tensorflow/tfjs-core/src/train.ts", "../node_modules/@tensorflow/tfjs-core/src/browser_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/rotate_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/array_ops_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/selu_util.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/erf_util.ts", "../node_modules/@tensorflow/tfjs-core/src/log.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/complex_util.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/backend_util.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/split_shared.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/tile_impl.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/topk_impl.ts", "../node_modules/@tensorflow/tfjs-core/src/backends/kernel_impls.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Abs_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Acos_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Acosh_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Add_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/AddN_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/ArgMax_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/ArgMin_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Asin_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Asinh_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Atan2_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Atan_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Atanh_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_3d_backprop.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/AvgPool3D_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_backprop.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/AvgPool_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/BatchMatMul_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/BatchToSpaceND_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/BroadcastTo_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Cast_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Ceil_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/ClipByValue_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Concat_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Conv2D_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Conv2DBackpropInput_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/conv3d_backprop_filter.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Conv3D_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Cos_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Cosh_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Cumsum_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/DepthwiseConv2dNative_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Dilation2D_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Div_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Elu_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Erf_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Exp_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Expm1_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Floor_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/FloorDiv_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/FusedBatchNorm_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/GatherV2_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/GreaterEqual_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Identity_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/IsFinite_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/IsInf_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/IsNan_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Log1p_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Log_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/LogSoftmax_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/local_response_normalization_backprop.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/LRN_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/min_max_grad_util.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Max_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Maximum_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/max_pool_3d_backprop.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/MaxPool3D_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/ops/max_pool_backprop.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/MaxPool_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Min_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Minimum_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Mod_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Multiply_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Negate_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/OneHot_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/OnesLike_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/PadV2_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Pow_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Prelu_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Reciprocal_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Relu6_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Relu_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Reshape_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/ResizeBilinear_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/ResizeNearestNeighbor_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Reverse_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Round_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Rsqrt_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/SelectV2_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Selu_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Sigmoid_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Sign_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Sin_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Sinh_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Slice_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Softmax_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Softplus_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/SpaceToBatchND_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/SplitV_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Sqrt_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Square_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/SquaredDifference_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Step_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Sub_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Sum_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Tan_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Tanh_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Tile_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Transpose_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/Unpack_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/UnsortedSegmentSum_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/gradients/ZerosLike_grad.ts", "../node_modules/@tensorflow/tfjs-core/src/register_all_gradients.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/abs.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acos.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acosh.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/all.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/any.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_max.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_min.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_scalar.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_type.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as1d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as2d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as3d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as4d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as5d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asin.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asinh.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan2.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atanh.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/avg_pool.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batchnorm.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/broadcast_to.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cast.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ceil.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/clip_by_value.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/concat.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv1d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d_transpose.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cos.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cosh.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cumsum.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depth_to_space.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2D_deprecated.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dilation2d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_no_nan.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dot.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/elu.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/erf.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/exp.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expand_dims.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expm1.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/fft.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/flatten.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floor.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floorDiv.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/gather.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ifft.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/irfft.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_finite.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_inf.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_nan.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/leaky_relu.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/local_response_normalization.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sigmoid.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_softmax.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sum_exp.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log1p.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_and.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_not.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_or.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_xor.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mat_mul.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max_pool.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mean.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/min.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/neg.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/norm.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/one_hot.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ones_like.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pad.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pool.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prelu.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prod.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reciprocal.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu6.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape_as.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_bilinear.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reverse.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rfft.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/round.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rsqrt.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/selu.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/separable_conv2d.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sigmoid.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sign.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sin.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sinh.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/slice.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softmax.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softplus.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/split.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sqrt.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/square.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squeeze.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/stack.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/step.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/strided_slice.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub_strict.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sum.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tan.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tanh.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tile.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_bool.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_float.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_int.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/topk.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/transpose.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unique.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unstack.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/where.ts", "../node_modules/@tensorflow/tfjs-core/src/public/chained_ops/zeros_like.ts", "../node_modules/@tensorflow/tfjs-layers/src/backend/common.ts", "../node_modules/@tensorflow/tfjs-layers/src/errors.ts", "../node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts", "../node_modules/@tensorflow/tfjs-layers/src/constraints.ts", "../node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts", "../node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts", "../node_modules/@tensorflow/tfjs-layers/src/common.ts", "../node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts", "../node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts", "../node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts", "../node_modules/@tensorflow/tfjs-layers/src/initializers.ts", "../node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts", "../node_modules/@tensorflow/tfjs-layers/src/backend/state.ts", "../node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts", "../node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts", "../node_modules/@tensorflow/tfjs-layers/src/variables.ts", "../node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts", "../node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts", "../node_modules/@tensorflow/tfjs-layers/src/logs.ts", "../node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts", "../node_modules/@tensorflow/tfjs-layers/src/losses.ts", "../node_modules/@tensorflow/tfjs-layers/src/metrics.ts", "../node_modules/@tensorflow/tfjs-layers/src/optimizers.ts", "../node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts", "../node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts", "../node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts", "../node_modules/@tensorflow/tfjs-layers/src/version.ts", "../node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts", "../node_modules/@tensorflow/tfjs-layers/src/engine/container.ts", "../node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts", "../node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts", "../node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts", "../node_modules/@tensorflow/tfjs-layers/src/engine/training.ts", "../node_modules/@tensorflow/tfjs-layers/src/models.ts", "../node_modules/@tensorflow/tfjs-layers/src/exports.ts", "../node_modules/@tensorflow/tfjs-layers/src/activations.ts", "../node_modules/@tensorflow/tfjs-layers/src/regularizers.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts", "../node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/core.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts", "../node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts", "../node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts", "../node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts", "../node_modules/@tensorflow/tfjs-layers/src/exports_models.ts", "../node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts", "../node_modules/@tensorflow/tfjs-layers/src/callbacks.ts", "../node_modules/@tensorflow/tfjs-converter/src/data/compiled_api.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/register.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/utils.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/arithmetic.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/basic_math.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/control.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/convolution.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/creation.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/dynamic.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/evaluation.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/graph.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/image.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/logical.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/matrices.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/normalization.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/reduction.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/slice_join.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/spectral.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/op_list/transformation.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/operation_mapper.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/node_value_impl.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/arithmetic_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/basic_math_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/executor/tensor_utils.ts", "../node_modules/@tensorflow/tfjs-converter/src/executor/tensor_array.ts", "../node_modules/@tensorflow/tfjs-converter/src/executor/tensor_list.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/control_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/convolution_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/creation_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/dynamic_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/evaluation_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/graph_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/image_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/logical_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/matrices_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/normalization_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/reduction_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/slice_join_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/spectral_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/executors/transformation_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/operations/operation_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/executor/execution_context.ts", "../node_modules/@tensorflow/tfjs-converter/src/executor/model_analysis.ts", "../node_modules/@tensorflow/tfjs-converter/src/executor/graph_executor.ts", "../node_modules/@tensorflow/tfjs-converter/src/executor/graph_model.ts", "../node_modules/@tensorflow/tfjs-converter/src/version.ts", "empty:/home/vlado/dev/human/node_modules/string_decoder/lib/string_decoder.js", "../node_modules/@tensorflow/tfjs-data/node_modules/seedrandom/lib/alea.js", "../node_modules/@tensorflow/tfjs-data/node_modules/seedrandom/lib/xor128.js", "../node_modules/@tensorflow/tfjs-data/node_modules/seedrandom/lib/xorwow.js", "../node_modules/@tensorflow/tfjs-data/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/@tensorflow/tfjs-data/node_modules/seedrandom/lib/xor4096.js", "../node_modules/@tensorflow/tfjs-data/node_modules/seedrandom/lib/tychei.js", "../node_modules/@tensorflow/tfjs-data/node_modules/seedrandom/seedrandom.js", "../node_modules/@tensorflow/tfjs-data/node_modules/seedrandom/index.js", "../node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts", "../node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts", "../node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts", "../node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.ts", "../node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts", "../node_modules/@tensorflow/tfjs-data/src/dataset.ts", "../node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts", "../node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts", "../node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts", "../node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts", "../node_modules/@tensorflow/tfjs-data/src/datasource.ts", "../node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts", "../node_modules/@tensorflow/tfjs-data/src/iterators/byte_chunk_iterator.ts", "../node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts", "../node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts", "../node_modules/@tensorflow/tfjs-data/src/util/source_util.ts", "../node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts", "../node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts", "../node_modules/@tensorflow/tfjs-data/src/readers.ts", "../node_modules/@tensorflow/tfjs-data/src/version.ts", "../node_modules/seedrandom/lib/alea.js", "../node_modules/seedrandom/lib/xor128.js", "../node_modules/seedrandom/lib/xorwow.js", "../node_modules/seedrandom/lib/xorshift7.js", "../node_modules/seedrandom/lib/xor4096.js", "../node_modules/seedrandom/lib/tychei.js", "../node_modules/seedrandom/seedrandom.js", "../node_modules/seedrandom/index.js", "../node_modules/@tensorflow/tfjs-backend-cpu/src/cpu_util.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/backend_cpu.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Abs.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/utils/binary_impl.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Complex.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Identity.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Real.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cast.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/utils/kernel_utils.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Add.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/utils/unary_impl.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/utils/unary_utils.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Ceil.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Exp.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Expm1.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Floor.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Log.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Max_impl.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Multiply.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Rsqrt.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Slice.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sub.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transpose_impl.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unique_impl.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/shared.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/version.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/base.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Acos.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Acosh.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Asin.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Asinh.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atan.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atanh.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/utils/pool_utils.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPoolBackprop.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchNorm.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Clip.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Imag.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reshape.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Concat.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cos.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cosh.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2D.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2DBackpropFilter.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2DBackpropInput.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Div.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Elu.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Erf.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/utils/fft_utils.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FFT.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FlipLeftRight.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IFFT.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsFinite.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsInf.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsNaN.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Log1p.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalNot.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Max.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolBackprop.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NotEqual.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/PadV2.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reciprocal.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/RotateWithOffset.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Round.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Selu.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sigmoid.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sign.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sin.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sinh.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Softplus.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transpose.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SpaceToBatchND.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sqrt.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Square.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SquaredDifference.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Step.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tan.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tanh.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unique.ts", "../node_modules/@tensorflow/tfjs-backend-cpu/src/register_all_kernels.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/canvas_util.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/tex_util.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/webgl_util.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/flags_webgl.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Abs.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_impl.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Add.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_impl.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Ceil.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Exp.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Expm1.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Floor.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Log.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Max_impl.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Multiply.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Rsqrt.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Slice.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Sub.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Transpose_impl.js", "../node_modules/@tensorflow/tfjs-backend-webgl/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Unique_impl.js", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/shared.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/addn_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/addn_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/packing_util.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/glsl_version.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler_util.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/avg_pool_backprop_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_complex_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/clip_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/clip_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/complex_abs_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/concat_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/concat_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu_depthwise.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu_depthwise.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/conv_packed_gpu_depthwise.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/crop_and_resize_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/cumsum_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/depth_to_space_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/diag_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/fft_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/fill_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/gather_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/gather_nd_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_util.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_context.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_math.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/im2col_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_grad_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/max_pool_backprop_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/mulmat_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/multinomial_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/onehot_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/pack_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/pad_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/pad_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/pool_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/reduce_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/reshape_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_backprop_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_backprop_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/scatter_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/segment_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/select_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/slice_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/slice_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/strided_slice_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/texture_manager.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/tile_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/unpack_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/backend_webgl.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/version.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/webgl.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/base.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/kernel_funcs_utils.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan2.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Identity.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPoolBackprop.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchNorm.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cos.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Div.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/flip_left_right_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FlipLeftRight.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reduce.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reshape.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reshape.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max_impl.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_packed_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose_impl.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolBackprop.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/rotate_gpu.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RotateWithOffset.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sin.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Square.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SquaredDifference.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tan.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unique.ts", "../node_modules/@tensorflow/tfjs-backend-webgl/src/register_all_kernels.ts", "../node_modules/@tensorflow/tfjs/src/version.ts", "../node_modules/@tensorflow/tfjs/src/index.ts", "../src/facemesh/blazeface.js", "../src/facemesh/keypoints.js", "../src/facemesh/box.js", "../src/facemesh/util.js", "../src/facemesh/pipeline.js", "../src/facemesh/uvcoords.js", "../src/facemesh/triangulation.js", "../src/facemesh/facemesh.js", "../src/ssrnet/ssrnet.js", "../src/emotion/emotion.js", "../src/posenet/modelBase.js", "../src/posenet/modelMobileNet.js", "../src/posenet/heapSort.js", "../src/posenet/buildParts.js", "../src/posenet/keypoints.js", "../src/posenet/vectors.js", "../src/posenet/decodePose.js", "../src/posenet/decodeMultiple.js", "../src/posenet/util.js", "../src/posenet/modelPoseNet.js", "../src/posenet/posenet.js", "../src/handpose/box.js", "../src/handpose/handdetector.js", "../src/handpose/keypoints.js", "../src/handpose/util.js", "../src/handpose/pipeline.js", "../src/handpose/handpose.js", "../src/imagefx.js", "../config.js", "../src/human.js"],
- "sourcesContent": ["", "", "", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo, Conv3DInfo} from '../ops/conv_util';\nimport {FusedBatchMatMulConfig, FusedConv2DConfig} from '../ops/fused_types';\nimport {Backend, DataId, Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D} from '../tensor';\nimport {BackendValues, DataType, Rank, ShapeMap} from '../types';\n\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n\n// Required information for all backends.\nexport interface BackendTimingInfo {\n kernelMs: number|{error: string};\n getExtraProfileInfo?(): string; // a field for additional timing information\n // e.g. packing / unpacking for WebGL backend\n}\n\nexport interface TensorStorage {\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n disposeData(dataId: DataId): void;\n write(values: BackendValues, shape: number[], dtype: DataType): DataId;\n move(dataId: DataId, values: BackendValues, shape: number[], dtype: DataType):\n void;\n memory(): {unreliable: boolean;}; // Backend-specific information.\n /** Returns number of data ids currently in the storage. */\n numDataIds(): number;\n}\n\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n private data = new WeakMap();\n private dataIdsCount = 0;\n\n constructor(private backend: KernelBackend, private dataMover: DataMover) {}\n\n get(dataId: DataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n\n set(dataId: DataId, value: T): void {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n\n has(dataId: DataId): boolean {\n return this.data.has(dataId);\n }\n\n delete(dataId: DataId): boolean {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n\n numDataIds(): number {\n return this.dataIdsCount;\n }\n}\n\nexport interface DataMover {\n /**\n * To be called by backends whenever they see a dataId that they don't own.\n * Upon calling this method, the mover will fetch the tensor from another\n * backend and register it with the current active backend.\n */\n moveData(backend: KernelBackend, dataId: DataId): void;\n}\n\nexport interface BackendTimer {\n time(f: () => void): Promise;\n}\n\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend implements TensorStorage, Backend, BackendTimer {\n time(f: () => void): Promise {\n return notYetImplemented('time');\n }\n read(dataId: object): Promise {\n return notYetImplemented('read');\n }\n readSync(dataId: object): BackendValues {\n return notYetImplemented('readSync');\n }\n numDataIds(): number {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId: object): void {\n return notYetImplemented('disposeData');\n }\n write(values: BackendValues, shape: number[], dtype: DataType): DataId {\n return notYetImplemented('write');\n }\n move(dataId: DataId, values: BackendValues, shape: number[], dtype: DataType):\n void {\n return notYetImplemented('move');\n }\n memory(): {unreliable: boolean; reasons?: string[]} {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision(): 16|32 {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon(): number {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n\n batchMatMul(\n a: Tensor3D, b: Tensor3D, transposeA: boolean,\n transposeB: boolean): Tensor3D {\n return notYetImplemented('batchMatMul');\n }\n\n fusedBatchMatMul(\n {a, b, transposeA, transposeB, bias, activation, preluActivationWeights}:\n FusedBatchMatMulConfig): Tensor3D {\n return notYetImplemented('fusedBatchMatMul');\n }\n\n slice(x: T, begin: number[], size: number[]): T {\n return notYetImplemented('slice');\n }\n stridedSlice(\n x: T, begin: number[], end: number[], strides: number[]): T {\n return notYetImplemented('stridedSlice');\n }\n unstack(x: Tensor, axis: number): Tensor[] {\n return notYetImplemented('unstack');\n }\n reverse(a: T, axis: number[]): T {\n return notYetImplemented('reverse');\n }\n\n concat(tensors: Tensor[], axis: number): Tensor {\n return notYetImplemented('concat');\n }\n\n neg(a: T): T {\n return notYetImplemented('neg');\n }\n\n add(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('add');\n }\n addN(tensors: T[]): T {\n return notYetImplemented('addN');\n }\n subtract(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('subtract');\n }\n multiply(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('multiply');\n }\n realDivide(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('realDivide');\n }\n floorDiv(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('floorDiv');\n }\n\n sum(x: Tensor, axes: number[]): Tensor {\n return notYetImplemented('sum');\n }\n prod(x: Tensor, axes: number[]): Tensor {\n return notYetImplemented('prod');\n }\n\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): Tensor {\n return notYetImplemented('unsortedSegmentSum');\n }\n\n argMin(x: Tensor, axis: number): Tensor {\n return notYetImplemented('argMin');\n }\n argMax(x: Tensor, axis: number): Tensor {\n return notYetImplemented('argMax');\n }\n\n equal(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('equal');\n }\n notEqual(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('notEqual');\n }\n\n less(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('less');\n }\n lessEqual(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('lessEqual');\n }\n\n greater(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('greater');\n }\n greaterEqual(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('greaterEqual');\n }\n\n logicalNot(a: T): T {\n return notYetImplemented('logicalNot');\n }\n logicalAnd(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('logicalAnd');\n }\n logicalOr(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('logicalOr');\n }\n\n where(condition: Tensor): Tensor2D {\n return notYetImplemented('where');\n }\n select(condition: Tensor, a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('select');\n }\n\n topk(x: T, k: number, sorted: boolean): [T, T] {\n return notYetImplemented('topk');\n }\n\n min(x: Tensor, axes: number[]): Tensor {\n return notYetImplemented('min');\n }\n minimum(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('minimum');\n }\n\n mod(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('mod');\n }\n\n max(x: Tensor, axes: number[]): Tensor {\n return notYetImplemented('max');\n }\n maximum(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('maximum');\n }\n\n all(x: Tensor, axes: number[]): Tensor {\n return notYetImplemented('all');\n }\n any(x: Tensor, axes: number[]): Tensor {\n return notYetImplemented('any');\n }\n\n squaredDifference(a: Tensor, b: Tensor): Tensor {\n return notYetImplemented('squaredDifference');\n }\n\n ceil(x: T): T {\n return notYetImplemented('ceil');\n }\n floor(x: T): T {\n return notYetImplemented('floor');\n }\n round(x: T): T {\n return notYetImplemented('round');\n }\n\n sign(x: T): T {\n return notYetImplemented('sign');\n }\n\n isNaN(x: T): T {\n return notYetImplemented('isNaN');\n }\n isInf(x: T): T {\n return notYetImplemented('isInf');\n }\n isFinite(x: T): T {\n return notYetImplemented('isFinite');\n }\n\n pow(a: T, b: Tensor): T {\n return notYetImplemented('pow');\n }\n exp(x: T): T {\n return notYetImplemented('exp');\n }\n expm1(x: T): T {\n return notYetImplemented('expm1');\n }\n softmax(x: T, dim: number): T {\n return notYetImplemented('softmax');\n }\n log(x: T): T {\n return notYetImplemented('log');\n }\n log1p(x: T): T {\n return notYetImplemented('log1p');\n }\n sqrt(x: T): T {\n return notYetImplemented('sqrt');\n }\n rsqrt(x: T): T {\n return notYetImplemented('rsqrt');\n }\n square(x: T): T {\n return notYetImplemented('square');\n }\n reciprocal(x: T): T {\n return notYetImplemented('reciprocal');\n }\n relu(x: T): T {\n return notYetImplemented('relu');\n }\n relu6(x: T): T {\n return notYetImplemented('relu6');\n }\n prelu(x: T, a: T): T {\n return notYetImplemented('prelu');\n }\n elu(x: T): T {\n return notYetImplemented('elu');\n }\n eluDer(dy: T, y: T): T {\n return notYetImplemented('eluDer');\n }\n selu(x: T): T {\n return notYetImplemented('selu');\n }\n int(x: T): T {\n return notYetImplemented('int');\n }\n\n clip(x: T, min: number, max: number): T {\n return notYetImplemented('clip');\n }\n\n abs(x: T): T {\n return notYetImplemented('abs');\n }\n complexAbs(x: T): T {\n return notYetImplemented('complexAbs');\n }\n\n sigmoid(x: T): T {\n return notYetImplemented('sigmoid');\n }\n\n softplus(x: T): T {\n return notYetImplemented('softplus');\n }\n\n sin(x: T): T {\n return notYetImplemented('sin');\n }\n cos(x: T): T {\n return notYetImplemented('cos');\n }\n tan(x: T): T {\n return notYetImplemented('tan');\n }\n\n asin(x: T): T {\n return notYetImplemented('asin');\n }\n acos(x: T): T {\n return notYetImplemented('acos');\n }\n atan(x: T): T {\n return notYetImplemented('atan');\n }\n atan2(a: T, b: T): T {\n return notYetImplemented('atan2');\n }\n\n sinh(x: T): T {\n return notYetImplemented('sinh');\n }\n cosh(x: T): T {\n return notYetImplemented('cosh');\n }\n tanh(x: T): T {\n return notYetImplemented('tanh');\n }\n\n asinh(x: T): T {\n return notYetImplemented('asinh');\n }\n acosh(x: T): T {\n return notYetImplemented('acosh');\n }\n atanh(x: T): T {\n return notYetImplemented('atanh');\n }\n\n erf(x: T): T {\n return notYetImplemented('erf');\n }\n\n step(x: T, alpha: number): T {\n return notYetImplemented('step');\n }\n\n fusedConv2d(\n {input, filter, convInfo, bias, activation, preluActivationWeights}:\n FusedConv2DConfig): Tensor4D {\n return notYetImplemented('fusedConv2d');\n }\n\n conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return notYetImplemented('conv2d');\n }\n conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n return notYetImplemented('conv2dDerInput');\n }\n conv2dDerFilter(x: Tensor4D, dY: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return notYetImplemented('conv2dDerFilter');\n }\n\n fusedDepthwiseConv2D(\n {input, filter, convInfo, bias, activation, preluActivationWeights}:\n FusedConv2DConfig): Tensor4D {\n return notYetImplemented('fusedDepthwiseConv2D');\n }\n\n depthwiseConv2D(input: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n return notYetImplemented('depthwiseConv2D');\n }\n depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n return notYetImplemented('depthwiseConv2DDerInput');\n }\n depthwiseConv2DDerFilter(x: Tensor4D, dY: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n return notYetImplemented('depthwiseConv2DDerFilter');\n }\n conv3d(x: Tensor5D, filter: Tensor5D, convInfo: Conv3DInfo): Tensor5D {\n return notYetImplemented('conv3d');\n }\n conv3dDerInput(dy: Tensor5D, filter: Tensor5D, convInfo: Conv3DInfo):\n Tensor5D {\n return notYetImplemented('conv3dDerInput');\n }\n conv3dDerFilter(x: Tensor5D, dY: Tensor5D, convInfo: Conv3DInfo): Tensor5D {\n return notYetImplemented('conv3dDerFilter');\n }\n maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return notYetImplemented('maxPool');\n }\n maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n return notYetImplemented('maxPoolBackprop');\n }\n avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return notYetImplemented('avgPool');\n }\n avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return notYetImplemented('avgPoolBackprop');\n }\n avgPool3d(x: Tensor5D, convInfo: Conv3DInfo): Tensor5D {\n return notYetImplemented('avgPool3d');\n }\n avgPool3dBackprop(dy: Tensor5D, x: Tensor5D, convInfo: Conv3DInfo): Tensor5D {\n return notYetImplemented('avgPool3dBackprop');\n }\n maxPool3d(x: Tensor5D, convInfo: Conv3DInfo): Tensor5D {\n return notYetImplemented('maxPool3d');\n }\n maxPool3dBackprop(\n dy: Tensor5D, x: Tensor5D, y: Tensor5D, convInfo: Conv3DInfo): Tensor5D {\n return notYetImplemented('maxPool3dBackprop');\n }\n\n reshape(x: T, shape: ShapeMap[R]):\n Tensor {\n return notYetImplemented('reshape');\n }\n cast(x: T, dtype: DataType): T {\n return notYetImplemented('cast');\n }\n\n tile(x: T, reps: number[]): T {\n return notYetImplemented('tile');\n }\n\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T {\n return notYetImplemented('pad');\n }\n\n transpose(x: T, perm: number[]): T {\n return notYetImplemented('transpose');\n }\n\n gather(x: T, indices: Tensor1D, axis: number): T {\n return notYetImplemented('gather');\n }\n\n gatherND(x: Tensor, indices: Tensor): Tensor {\n return notYetImplemented('gatherND');\n }\n\n scatterND(\n indices: Tensor, updates: Tensor, shape: ShapeMap[R]): Tensor {\n return notYetImplemented('scatterND');\n }\n\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T {\n return notYetImplemented('batchToSpaceND');\n }\n\n spaceToBatchND(\n x: T, blockShape: number[], paddings: number[][]): T {\n return notYetImplemented('spaceToBatchND');\n }\n\n resizeBilinear(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n return notYetImplemented('resizeBilinear');\n }\n\n resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean):\n Tensor4D {\n return notYetImplemented('resizeBilinearBackprop');\n }\n\n resizeNearestNeighbor(\n x: Tensor4D, newHEight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n return notYetImplemented('resizeNearestNeighbor');\n }\n\n resizeNearestNeighborBackprop(\n dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor4D {\n return notYetImplemented('resizeNearestNeighborBackprop');\n }\n\n batchNorm(\n x: Tensor4D, mean: Tensor4D|Tensor1D, variance: Tensor4D|Tensor1D,\n offset?: Tensor4D|Tensor1D, scale?: Tensor4D|Tensor1D,\n varianceEpsilon?: number): Tensor4D {\n return notYetImplemented('batchNorm');\n }\n\n localResponseNormalization4D(\n x: Tensor4D, radius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n return notYetImplemented('localResponseNormalization4D');\n }\n\n LRNGrad(\n dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D, radius: number,\n bias: number, alpha: number, beta: number): Tensor4D {\n return notYetImplemented('LRNGrad');\n }\n\n multinomial(\n logits: Tensor2D, normalized: boolean, numSamples: number,\n seed: number): Tensor2D {\n return notYetImplemented('multinomial');\n }\n\n oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number):\n Tensor2D {\n return notYetImplemented('oneHot');\n }\n\n cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean):\n Tensor {\n return notYetImplemented('cumsum');\n }\n\n nonMaxSuppression(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold?: number): Tensor1D {\n return notYetImplemented('nonMaxSuppression');\n }\n\n fft(x: Tensor2D): Tensor2D {\n return notYetImplemented('fft');\n }\n ifft(x: Tensor2D): Tensor2D {\n return notYetImplemented('ifft');\n }\n complex(real: T, imag: T): T {\n return notYetImplemented('complex');\n }\n real(input: T): T {\n return notYetImplemented('real');\n }\n imag(input: T): T {\n return notYetImplemented('imag');\n }\n\n cropAndResize(\n image: Tensor4D, boxes: Tensor2D, boxIndex: Tensor1D,\n cropSize: [number, number], method: 'bilinear'|'nearest',\n extrapolationValue: number): Tensor4D {\n return notYetImplemented('cropAndResize');\n }\n\n depthToSpace(x: Tensor4D, blockSize: number, dataFormat: string): Tensor4D {\n return notYetImplemented('depthToSpace');\n }\n\n // Aligns with the \"SplitV\" kernel in TensorFlow.\n split(value: T, sizeSplits: number[], axis: number): T[] {\n return notYetImplemented('split');\n }\n\n sparseToDense(\n sparseIndices: Tensor, sparseValues: Tensor, outputShape: ShapeMap[R],\n defaultValue: Scalar): Tensor {\n return notYetImplemented('sparseToDense');\n }\n\n diag(x: Tensor): Tensor {\n return notYetImplemented('diag');\n }\n\n fill(\n shape: ShapeMap[R], value: number|string, dtype?: DataType): Tensor {\n return notYetImplemented('fill');\n }\n\n onesLike(x: Tensor): Tensor {\n return notYetImplemented('onesLike');\n }\n\n zerosLike(x: Tensor): Tensor {\n return notYetImplemented('zerosLike');\n }\n\n linspace(start: number, stop: number, num: number): Tensor1D {\n return notYetImplemented('linspace');\n }\n\n dispose(): void {\n return notYetImplemented('dispose');\n }\n}\n\nfunction notYetImplemented(kernelName: string): never {\n throw new Error(\n `'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Platform} from './platforms/platform';\n\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n\ntype FlagValue = number|boolean;\ntype FlagEvaluationFn = (() => FlagValue)|(() => Promise);\nexport type Flags = {\n [featureName: string]: FlagValue\n};\nexport type FlagRegistryEntry = {\n evaluationFn: FlagEvaluationFn;\n setHook?: (value: FlagValue) => void;\n};\n\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n private flags: Flags = {};\n private flagRegistry: {[flagName: string]: FlagRegistryEntry} = {};\n\n private urlFlags: Flags = {};\n\n platformName: string;\n platform: Platform;\n\n // tslint:disable-next-line: no-any\n constructor(public global: any) {\n this.populateURLFlags();\n }\n\n setPlatform(platformName: string, platform: Platform) {\n if (this.platform != null) {\n console.warn(\n `Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n\n registerFlag(\n flagName: string, evaluationFn: FlagEvaluationFn,\n setHook?: (value: FlagValue) => void) {\n this.flagRegistry[flagName] = {evaluationFn, setHook};\n\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(\n `Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n\n async getAsync(flagName: string): Promise {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n\n get(flagName: string): FlagValue {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n const flagValue = this.evaluateFlag(flagName);\n if (flagValue instanceof Promise) {\n throw new Error(\n `Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n\n this.flags[flagName] = flagValue;\n\n return this.flags[flagName];\n }\n\n getNumber(flagName: string): number {\n return this.get(flagName) as number;\n }\n\n getBool(flagName: string): boolean {\n return this.get(flagName) as boolean;\n }\n\n getFlags(): Flags {\n return this.flags;\n }\n // For backwards compatibility.\n get features(): Flags {\n return this.flags;\n }\n\n set(flagName: string, value: FlagValue): void {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n\n private evaluateFlag(flagName: string): FlagValue|Promise {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n\n setFlags(flags: Flags) {\n this.flags = Object.assign({}, flags);\n }\n\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n\n private populateURLFlags(): void {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n\n const urlParams = getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':') as [string, string];\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\n\nexport function getQueryParams(queryString: string): {[key: string]: string} {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\n\nfunction decodeParam(\n params: {[key: string]: string}, name: string, value?: string) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\n\nfunction parseValue(flagName: string, value: string): FlagValue {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n } else if (`${+ value}` === value) {\n return +value;\n }\n throw new Error(\n `Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\n\nexport let ENV: Environment = null;\nexport function setEnvironmentGlobal(environment: Environment) {\n ENV = environment;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace: {_tfGlobals: Map};\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace(): {_tfGlobals: Map} {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns: any;\n if (typeof (window) !== 'undefined') {\n ns = window;\n } else if (typeof (global) !== 'undefined') {\n ns = global;\n } else if (typeof (process) !== 'undefined') {\n ns = process;\n } else if (typeof (self) !== 'undefined') {\n ns = self;\n } else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n\n// tslint:disable-next-line:no-any\nfunction getGlobalMap(): Map {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key: string, init: () => T): T {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n } else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n// Allow UpperCamelCase variable names\n// tslint:disable: variable-name\n// Unfortunately just enabling PascalCase per file (tslint:enable:\n// allow-pascal-case) doesn't work.\nimport {NamedTensorInfoMap, TensorInfo} from './kernel_registry';\nimport {ExplicitPadding} from './ops/conv_util';\nimport {Activation} from './ops/fused_types';\nimport {DataType, PixelData} from './types';\n\nexport const Abs = 'Abs';\nexport type AbsInputs = UnaryInputs;\n\nexport const Acos = 'Acos';\nexport type AcosInputs = UnaryInputs;\n\nexport const Acosh = 'Acosh';\nexport type AcoshInputs = UnaryInputs;\n\nexport const Add = 'Add';\nexport type AddInputs = BinaryInputs;\n\nexport const AddN = 'AddN';\nexport type AddNInputs = TensorInfo[];\n\nexport const All = 'All';\nexport type AllInputs = Pick;\nexport interface AllAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Any = 'Any';\nexport type AnyInputs = Pick;\nexport interface AnyAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const ArgMax = 'ArgMax';\nexport type ArgMaxInputs = Pick;\nexport interface ArgMaxAttrs {\n axis: number;\n}\n\nexport const ArgMin = 'ArgMin';\nexport type ArgMinInputs = Pick;\nexport interface ArgMinAttrs {\n axis: number;\n}\n\nexport const Asin = 'Asin';\nexport type AsinInputs = UnaryInputs;\n\nexport const Asinh = 'Asinh';\nexport type AsinhInputs = UnaryInputs;\n\nexport const Atan = 'Atan';\nexport type AtanInputs = UnaryInputs;\n\nexport const Atanh = 'Atanh';\nexport type AtanhInputs = UnaryInputs;\n\nexport const Atan2 = 'Atan2';\nexport type Atan2Inputs = BinaryInputs;\n\nexport const AvgPool = 'AvgPool';\nexport type AvgPoolInputs = Pick;\nexport interface AvgPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const AvgPoolBackprop = 'AvgPoolBackprop';\nexport type AvgPoolBackpropInputs = Pick;\nexport interface AvgPoolBackpropAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n}\n\nexport const AvgPool3D = 'AvgPool3D';\nexport type AvgPool3DInputs = Pick;\nexport interface AvgPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n dataFormat: 'NDHWC'|'NCDHW';\n dilations?: [number, number, number]|number;\n}\n\nexport const AvgPool3DBackprop = 'AvgPool3DBackprop';\nexport type AvgPool3DBackpropInputs = Pick;\nexport interface AvgPool3DBackpropAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dilations: [number, number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const BatchMatMul = 'BatchMatMul';\nexport type BatchMatMulInputs = Pick;\nexport interface BatchMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n}\n\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport type BatchToSpaceNDInputs = Pick;\nexport interface BatchToSpaceNDAttrs {\n blockShape: number[];\n crops: number[][];\n}\n\nexport type BinaryInputs = Pick;\n\nexport const BroadcastTo = 'BroadcastTo';\nexport type BroadcastToInputs = Pick;\nexport interface BroadCastToAttrs {\n shape: number[];\n inputShape: number[]; // for gradient\n}\n\nexport const Cast = 'Cast';\nexport type CastInputs = UnaryInputs;\nexport interface CastAttrs {\n dtype: DataType;\n}\n\nexport const Ceil = 'Ceil';\nexport type CeilInputs = UnaryInputs;\n\nexport const ClipByValue = 'ClipByValue';\nexport type ClipByValueInputs = UnaryInputs;\nexport interface ClipByValueAttrs {\n clipValueMin: number;\n clipValueMax: number;\n}\n\nexport const Complex = 'Complex';\nexport type ComplexInputs = Pick;\n\nexport const Concat = 'Concat';\nexport type ConcatInputs = TensorInfo[];\nexport interface ConcatAttrs {\n axis: number;\n}\n\nexport const Conv2D = 'Conv2D';\nexport type Conv2DInputs = Pick;\nexport interface Conv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport type Conv2DBackpropFilterInputs = Pick;\nexport interface Conv2DBackpropFilterAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport type Conv2DBackpropInputInputs = Pick;\nexport interface Conv2DBackpropInputAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Conv3D = 'Conv3D';\nexport type Conv3DInputs = Pick;\nexport interface Conv3DAttrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n dataFormat: 'NDHWC'|'NCDHW';\n dilations: [number, number, number]|number;\n}\n\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport type Conv3DBackpropFilterInputs = Pick;\n\nexport interface Conv3DBackpropFilterAttrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n}\n\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport type Conv3DBackpropInputInputs = Pick;\nexport interface Conv3DBackpropInputAttrs {\n pad: 'valid'|'same';\n}\n\nexport const Cos = 'Cos';\nexport type CosInputs = UnaryInputs;\n\nexport const Cosh = 'Cosh';\nexport type CoshInputs = UnaryInputs;\n\nexport const Cumsum = 'Cumsum';\nexport type CumsumInputs = Pick;\nexport interface CumsumAttrs {\n axis: number;\n exclusive: boolean;\n reverse: boolean;\n}\n\nexport const CropAndResize = 'CropAndResize';\nexport type CropAndResizeInputs =\n Pick;\nexport interface CropAndResizeAttrs {\n cropSize: [number, number];\n method: 'bilinear'|'nearest';\n extrapolationValue: number;\n}\n\nexport const DepthToSpace = 'DepthToSpace';\nexport type DepthToSpaceInputs = Pick;\nexport interface DepthToSpaceAttrs {\n blockSize: number;\n dataFormat: 'NHWC'|'NCHW';\n}\n\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport type DepthwiseConv2dNativeInputs =\n Pick;\nexport interface DepthwiseConv2dNativeAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const DepthwiseConv2dNativeBackpropFilter =\n 'DepthwiseConv2dNativeBackpropFilter';\nexport type DepthwiseConv2dNativeBackpropFilterInputs =\n Pick;\n\nexport const DepthwiseConv2dNativeBackpropInput =\n 'DepthwiseConv2dNativeBackpropInput';\nexport type DepthwiseConv2dNativeBackpropInputInputs =\n Pick;\n\nexport const Diag = 'Diag';\nexport type DiagInputs = Pick;\n\nexport const Dilation2D = 'Dilation2D';\nexport type Dilation2DInputs = Pick;\nexport interface Dilation2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dilations: [number, number]|number;\n}\n\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport type Dilation2DBackpropInputInputs =\n Pick;\n\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport type Dilation2DBackpropFilterInputs =\n Pick;\n\nexport const Div = 'Div';\nexport type DivInputs = BinaryInputs;\n\nexport const Elu = 'Elu';\nexport type EluInputs = Pick;\n\nexport const EluGrad = 'EluGrad';\nexport type EluGradInputs = Pick;\n\nexport const Erf = 'Erf';\nexport type ErfInputs = UnaryInputs;\n\nexport const Equal = 'Equal';\nexport type EqualInputs = BinaryInputs;\n\nexport const Exp = 'Exp';\nexport type ExpInputs = UnaryInputs;\n\nexport const Expm1 = 'Expm1';\nexport type Expm1Inputs = UnaryInputs;\n\nexport const FFT = 'FFT';\nexport type FFTInputs = Pick;\n\nexport const Fill = 'Fill';\nexport interface FillAttrs {\n shape: number[];\n value: number|string;\n dtype: DataType;\n}\n\nexport const FlipLeftRight = 'FlipLeftRight';\nexport type FlipLeftRightInputs = Pick;\n\nexport const Floor = 'Floor';\nexport type FloorInputs = UnaryInputs;\n\nexport const FloorDiv = 'FloorDiv';\nexport type FloorDivInputs = BinaryInputs;\n\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport type FusedBatchNormInputs =\n Pick;\nexport interface FusedBatchNormAttrs {\n varianceEpsilon: number;\n}\n\nexport const GatherV2 = 'GatherV2';\nexport type GatherV2Inputs = Pick;\nexport interface GatherV2Attrs {\n axis: number;\n}\n\nexport const GatherNd = 'GatherNd';\nexport type GatherNdInputs = Pick;\n\nexport const Greater = 'Greater';\nexport type GreaterInputs = BinaryInputs;\n\nexport const GreaterEqual = 'GreaterEqual';\nexport type GreaterEqualInputs = BinaryInputs;\n\nexport const Identity = 'Identity';\nexport type IdentityInputs = Pick;\n\nexport const IFFT = 'IFFT';\nexport type IFFTInputs = Pick;\n\nexport const Imag = 'Imag';\nexport type ImagInputs = Pick;\n\nexport const IsFinite = 'IsFinite';\nexport type IsFiniteInputs = UnaryInputs;\n\nexport const IsInf = 'IsInf';\nexport type IsInfInputs = UnaryInputs;\n\nexport const IsNan = 'IsNan';\nexport type IsNanInputs = UnaryInputs;\n\nexport const Less = 'Less';\nexport type LessInputs = BinaryInputs;\n\nexport const LessEqual = 'LessEqual';\nexport type LessEqualInputs = BinaryInputs;\n\nexport const LinSpace = 'LinSpace';\nexport interface LinSpaceAttrs {\n start: number;\n stop: number;\n num: number;\n}\nexport const Log = 'Log';\nexport type LogInputs = UnaryInputs;\n\nexport const Log1p = 'Log1p';\nexport type Log1pInputs = UnaryInputs;\n\nexport const LogicalAnd = 'LogicalAnd';\nexport type LogicalAndInputs = BinaryInputs;\n\nexport const LogicalNot = 'LogicalNot';\nexport type LogicalNotInputs = Pick;\n\nexport const LogicalOr = 'LogicalOr';\nexport type LogicalOrInputs = BinaryInputs;\n\nexport const LogSoftmax = 'LogSoftmax';\nexport type LogSoftmaxInputs = Pick;\nexport interface LogSoftmaxAttrs {\n axis: number;\n}\n\nexport const LRN = 'LRN';\nexport type LRNInputs = Pick;\nexport interface LRNAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const LRNBackprop = 'LRNBackprop';\nexport type LRNBackpropInputs = Pick;\nexport interface LRNBackpropAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const Max = 'Max';\nexport type MaxInputs = Pick;\nexport interface MaxAttrs {\n reductionIndices: number|number[];\n keepDims: boolean;\n}\n\nexport const Maximum = 'Maximum';\nexport type MaximumInputs = BinaryInputs;\n\nexport const MaxPool = 'MaxPool';\nexport type MaxPoolInputs = Pick;\nexport interface MaxPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolBackprop = 'MaxPoolBackprop';\nexport type MaxPoolBackpropInputs =\n Pick;\nexport interface MaxPoolBackpropAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3D = 'MaxPool3D';\nexport type MaxPool3DInputs = Pick;\nexport interface MaxPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dataFormat: 'NDHWC'|'NCDHW';\n dilations?: [number, number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3DBackprop = 'MaxPool3DBackprop';\nexport type MaxPool3DBackpropInputs =\n Pick;\nexport interface MaxPool3DBackpropAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dilations?: [number, number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport type MaxPoolWithArgmaxInputs = Pick;\nexport interface MaxPoolWithArgmaxAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n includeBatchInIndex: boolean;\n}\n\nexport const Mean = 'Mean';\nexport type MeanInputs = Pick;\nexport interface MeanAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Min = 'Min';\nexport type MinInputs = Pick;\nexport interface MinAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Minimum = 'Minimum';\nexport type MinimumInputs = BinaryInputs;\n\nexport const Mod = 'Mod';\nexport type ModInputs = BinaryInputs;\n\nexport const Multiply = 'Multiply';\nexport type MultiplyInputs = BinaryInputs;\n\nexport const Negate = 'Negate';\nexport type NegateInputs = UnaryInputs;\n\nexport const NotEqual = 'NotEqual';\nexport type NotEqualInputs = BinaryInputs;\n\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport type NonMaxSuppressionV3Inputs =\n Pick;\nexport interface NonMaxSuppressionV3Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n}\n\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport type NonMaxSuppressionV4Inputs =\n Pick;\nexport interface NonMaxSuppressionV4Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n padToMaxOutputSize: boolean;\n}\n\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport type NonMaxSuppressionV5Inputs =\n Pick;\nexport interface NonMaxSuppressionV5Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n softNmsSigma: number;\n}\n\nexport const OnesLike = 'OnesLike';\nexport type OnesLikeInputs = UnaryInputs;\n\nexport const OneHot = 'OneHot';\nexport type OneHotInputs = Pick;\nexport interface OneHotAttrs {\n depth: number;\n onValue: number;\n offValue: number;\n}\n\nexport const PadV2 = 'PadV2';\nexport type PadV2Inputs = Pick;\nexport interface PadV2Attrs {\n paddings: Array<[number, number]>;\n constantValue: number;\n}\n\nexport const Pool = 'Pool';\nexport type PoolInputs = Pick;\n\nexport const Pow = 'Pow';\nexport type PowInputs = BinaryInputs;\n\nexport const Prelu = 'Prelu';\nexport type PreluInputs = Pick;\n\nexport const Prod = 'Prod';\nexport type ProdInputs = Pick;\nexport interface ProdAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Range = 'Range';\nexport interface RangeAttrs {\n start: number;\n stop: number;\n step: number;\n dtype: 'float32'|'int32';\n}\n\nexport const Real = 'Real';\nexport type RealInputs = Pick;\n\nexport const Reciprocal = 'Reciprocal';\nexport type ReciprocalInputs = UnaryInputs;\n\nexport const Relu = 'Relu';\nexport type ReluInputs = Pick;\n\nexport const Reshape = 'Reshape';\nexport type ReshapeInputs = Pick;\nexport interface ReshapeAttrs {\n shape: number[];\n}\n\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport type ResizeNearestNeighborInputs = Pick;\nexport interface ResizeNearestNeighborAttrs {\n alignCorners: boolean;\n size: [number, number];\n}\n\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport type ResizeNearestNeighborGradInputs =\n Pick;\n\nexport const ResizeBilinear = 'ResizeBilinear';\nexport type ResizeBilinearInputs = Pick;\nexport interface ResizeBilinearAttrs {\n alignCorners: boolean;\n size: [number, number];\n}\n\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport type ResizeBilinearGradInputs = Pick;\n\nexport const Relu6 = 'Relu6';\nexport type Relu6Inputs = Pick;\n\nexport const Reverse = 'Reverse';\nexport type ReverseInputs = Pick;\nexport interface ReverseAttrs {\n dims: number|number[];\n}\n\nexport const Round = 'Round';\nexport type RoundInputs = UnaryInputs;\n\nexport const Rsqrt = 'Rsqrt';\nexport type RsqrtInputs = UnaryInputs;\n\nexport const ScatterNd = 'ScatterNd';\nexport type ScatterNdInputs = Pick;\nexport interface ScatterNdAttrs {\n shape: number[];\n}\n\nexport const SelectV2 = 'SelectV2';\nexport type SelectV2Inputs = Pick;\n\nexport const Selu = 'Selu';\nexport type SeluInputs = Pick;\n\nexport const Slice = 'Slice';\nexport type SliceInputs = Pick;\nexport interface SliceAttrs {\n begin: number|number[];\n size: number|number[];\n}\nexport const Sin = 'Sin';\nexport type SinInputs = UnaryInputs;\n\nexport const Sinh = 'Sinh';\nexport type SinhInputs = UnaryInputs;\n\nexport const Sign = 'Sign';\nexport type SignInputs = UnaryInputs;\n\nexport const Sigmoid = 'Sigmoid';\nexport type SigmoidInputs = UnaryInputs;\n\nexport const Softplus = 'Softplus';\nexport type SoftplusInputs = UnaryInputs;\n\nexport const Sqrt = 'Sqrt';\nexport type SqrtInputs = UnaryInputs;\n\nexport const Sum = 'Sum';\nexport type SumInputs = Pick;\nexport interface SumAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport type SpaceToBatchNDInputs = Pick;\nexport interface SpaceToBatchNDAttrs {\n blockShape: number[];\n paddings: number[][];\n}\n\nexport const SplitV = 'SplitV';\nexport type SplitVInputs = Pick;\nexport interface SplitVAttrs {\n numOrSizeSplits: number[]|number;\n axis: number;\n}\n\nexport const Softmax = 'Softmax';\nexport type SoftmaxInputs = Pick;\nexport interface SoftmaxAttrs {\n dim: number;\n}\n\nexport const SquaredDifference = 'SquaredDifference';\nexport type SquaredDifferenceInputs = BinaryInputs;\n\nexport const Square = 'Square';\nexport type SquareInputs = Pick;\n\nexport const Sub = 'Sub';\nexport type SubInputs = BinaryInputs;\n\nexport const SparseToDense = 'SparseToDense';\nexport type SparseToDenseInputs =\n Pick;\nexport interface SparseToDenseAttrs {\n outputShape: number[];\n}\n\nexport const StridedSlice = 'StridedSlice';\nexport type StridedSliceInputs = Pick;\nexport interface StridedSliceAttrs {\n begin: number[];\n end: number[];\n strides: number[];\n beginMask: number;\n endMask: number;\n ellipsisMask: number;\n newAxisMask: number;\n shrinkAxisMask: number;\n}\n\nexport const Tan = 'Tan';\nexport type TanInputs = UnaryInputs;\n\nexport const Tanh = 'Tanh';\nexport type TanhInputs = UnaryInputs;\n\nexport const Tile = 'Tile';\nexport type TileInputs = Pick;\nexport interface TileAttrs {\n reps: number[];\n}\n\nexport const TopK = 'TopK';\nexport type TopKInputs = Pick;\nexport interface TopKAttrs {\n k: number;\n sorted: boolean;\n}\n\nexport const Transpose = 'Transpose';\nexport type TransposeInputs = Pick;\nexport interface TransposeAttrs {\n perm: number[];\n}\n\nexport const Unique = 'Unique';\nexport type UniqueInputs = Pick;\nexport interface UniqueAttrs {\n axis: number;\n}\n\nexport type UnaryInputs = Pick;\n\nexport const Unpack = 'Unpack';\nexport type UnpackInputs = Pick;\nexport interface UnpackAttrs {\n axis: number;\n}\n\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport type UnsortedSegmentSumInputs =\n Pick;\nexport interface UnsortedSegmentSumAttrs {\n numSegments: number;\n}\n\nexport const ZerosLike = 'ZerosLike';\nexport type ZerosLikeInputs = UnaryInputs;\n\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport type StepInputs = UnaryInputs;\nexport interface StepAttrs {\n alpha: number;\n}\n\nexport const FromPixels = 'FromPixels';\nexport interface FromPixelsInputs {\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement;\n}\nexport interface FromPixelsAttrs {\n numChannels: number;\n}\n\nexport const RotateWithOffset = 'RotateWithOffset';\nexport type RotateWithOffsetInputs = Pick;\nexport interface RotateWithOffsetAttrs {\n radians: number;\n fillValue: number|[number, number, number];\n center: number|[number, number];\n}\n\nexport const _FusedMatMul = '_FusedMatMul';\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulInputs extends NamedTensorInfoMap {\n a: TensorInfo;\n b: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n activation: Activation;\n}\n\nexport const FusedConv2D = 'FusedConv2D';\nexport interface FusedConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n}\n\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\nexport interface FusedDepthwiseConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedDepthwiseConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from './environment';\n\nimport {getGlobal} from './global_util';\nimport {NamedGradientMap} from './tape';\nimport {Tensor} from './tensor';\nimport {DataType, RecursiveArray} from './types';\n\nconst kernelRegistry =\n getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry =\n getGlobal('gradRegistry', () => new Map());\n\nexport type DataId = object;\n\ntype AttributeValue =\n number|number[]|boolean|boolean[]|string|string[]|NamedAttrMap;\n\n/** These are extra non-tensor/primitive params passed to kernel functions. */\nexport type Attribute = AttributeValue|RecursiveArray;\n\n/** Specifies the code to run when executing a kernel. */\nexport type KernelFunc = (params: {\n inputs: NamedTensorInfoMap,\n backend: {},\n attrs?: NamedAttrMap,\n}) => TensorInfo|TensorInfo[];\n\n/** The function to run when computing a gradient during backprop. */\nexport type GradFunc =\n (dy: Tensor|Tensor[], saved: Tensor[], attrs: NamedAttrMap) =>\n NamedGradientMap;\n\n/** Function that gets called after the backend initializes. */\nexport type KernelSetupFunc = (backend: {}) => void;\n/** Function that gets called right before the backend is disposed. */\nexport type KernelDisposeFunc = KernelSetupFunc;\n\n/** Config object for registering a kernel in the global registry. */\nexport interface KernelConfig {\n kernelName: string;\n backendName: string;\n kernelFunc: KernelFunc;\n setupFunc?: KernelSetupFunc;\n disposeFunc?: KernelDisposeFunc;\n}\n\n/** Config object for registering a gradient in the global registry. */\nexport interface GradConfig {\n kernelName: string;\n inputsToSave?: string[];\n // When saveAllInputs is true, all inputs will be saved. Only use this flag\n // if inputs is an array of Tensors.\n saveAllInputs?: boolean;\n outputsToSave?: boolean[];\n gradFunc: GradFunc;\n}\n\n/** Holds metadata for a given tensor. */\nexport interface TensorInfo {\n dataId: DataId;\n shape: number[];\n dtype: DataType;\n}\n\nexport interface NamedTensorInfoMap {\n [name: string]: TensorInfo;\n}\n\nexport interface NamedAttrMap {\n [name: string]: Attribute;\n}\n\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(\n kernelName: string, backendName: string): KernelConfig {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName: string): GradConfig {\n return gradRegistry.get(kernelName);\n}\n\nexport function getKernelsForBackend(backendName: string): KernelConfig[] {\n const it = kernelRegistry.entries();\n const result: KernelConfig[] = [];\n\n while (true) {\n const {done, value} = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend, ] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config: KernelConfig) {\n const {kernelName, backendName} = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config: GradConfig) {\n const {kernelName} = config;\n\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(\n kernelName: string, backendName: string): void {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName: string): void {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(\n `The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(\n registeredBackendName: string, newBackendName: string): void {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig =\n Object.assign({}, kernelConfig, {backendName: newBackendName});\n registerKernel(newKernelConfig);\n });\n}\n\nfunction makeKey(kernelName: string, backendName: string) {\n return `${backendName}_${kernelName}`;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from './environment';\nimport {BackendValues, DataType, DataTypeMap, FlatVector, NumericDataType, RecursiveArray, TensorLike, TypedArray} from './types';\n\n/**\n * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array: any[]|Uint32Array|Int32Array|\n Float32Array): void {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n\n/** Clamps a value to a specified range. */\nexport function clamp(min: number, x: number, max: number): number {\n return Math.max(min, Math.min(x, max));\n}\n\nexport function nearestLargerEven(val: number): number {\n return val % 2 === 0 ? val : val + 1;\n}\n\nexport function sum(arr: number[]): number {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a: number, b: number) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a: FlatVector, b: FlatVector): number {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr: boolean, msg: () => string) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport function assertShapesMatch(\n shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {\n assert(\n arraysEqual(shapeA, shapeB),\n () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\n\nexport function assertNonNull(a: TensorLike): void {\n assert(\n a != null,\n () => `The input to the tensor constructor must be a non-null value.`);\n}\n\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function\nflatten|TypedArray>(\n arr: T|RecursiveArray, result: T[] = [], skipTypedArray = false): T[] {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n } else {\n result.push(arr as T);\n }\n return result;\n}\n\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\n\nexport function isScalarShape(shape: number[]): boolean {\n return shape.length === 0;\n}\n\nexport function arraysEqual(n1: FlatVector, n2: FlatVector) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\n\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\n\nexport function tanh(x: number): number {\n // tslint:disable-next-line:no-any\n if ((Math as any).tanh != null) {\n // tslint:disable-next-line:no-any\n return (Math as any).tanh(x);\n }\n if (x === Infinity) {\n return 1;\n } else if (x === -Infinity) {\n return -1;\n } else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\n\nexport function sizeToSquarishShape(size: number): [number, number] {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n: number): Uint32Array {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\n\nexport function rightPad(a: string, size: number): string {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\n\nexport function repeatedTry(\n checkFn: () => boolean, delayFn = (counter: number) => 0,\n maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(\n shape: number[], size: number): number[] {\n let shapeProd = 1;\n let implicitIdx = -1;\n\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n } else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(\n `Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n } else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n\n if (shapeProd === 0) {\n throw Error(\n `Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(\n `The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\n\nexport function parseAxisParam(\n axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n\n // Check for valid range\n assert(\n axis.every(ax => ax >= -rank && ax < rank),\n () =>\n `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n assert(\n axis.every(ax => isInt(ax)),\n () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape: number[], axis?: number[]):\n {newShape: number[], keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(\n `Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function getTypedArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function getArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else if (dtype === 'string') {\n values = new Array<'string'>(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function checkConversionForErrors(\n vals: DataTypeMap[D]|number[], dtype: D): void {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype: DataType): boolean {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType: DataType, newType: DataType): boolean {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\n\nexport function isTypedArray(a: {}): a is Float32Array|Int32Array|Uint8Array {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\n\nexport function bytesPerElement(dtype: DataType): number {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n } else if (dtype === 'complex64') {\n return 8;\n } else if (dtype === 'bool') {\n return 1;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr: Uint8Array[]): number {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n\n/** Returns true if the value is a string. */\nexport function isString(value: {}): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n\nexport function isBoolean(value: {}): boolean {\n return typeof value === 'boolean';\n}\n\nexport function isNumber(value: {}): boolean {\n return typeof value === 'number';\n}\n\nexport function inferDtype(values: TensorLike): DataType {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n } else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n } else if (isNumber(values)) {\n return 'float32';\n } else if (isString(values)) {\n return 'string';\n } else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\n\nexport function isFunction(f: Function) {\n return !!(f && f.constructor && f.call && f.apply);\n}\n\nexport function nearestDivisor(size: number, start: number): number {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\n\nexport function computeStrides(shape: number[]): number[] {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\n\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(\n value: DataType, dtype: DataType): BackendValues {\n if (dtype === 'string') {\n return encodeString(value);\n }\n\n return toTypedArray([value], dtype);\n}\n\nexport function toTypedArray(a: TensorLike, dtype: DataType): TypedArray {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = flatten(a);\n }\n\n if (env().getBool('DEBUG')) {\n checkConversionForErrors(a as number[], dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a as TypedArray;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a as number[]);\n } else if (dtype === 'int32') {\n return new Int32Array(a as number[]);\n } else if (dtype === 'bool') {\n const bool = new Uint8Array((a as number[]).length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round((a as number[])[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\nfunction createNestedArray(offset: number, shape: number[], a: TypedArray) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0];\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n } else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a);\n }\n }\n return ret;\n}\n\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(shape: number[], a: TypedArray) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}.`);\n }\n\n return createNestedArray(0, shape, a);\n}\n\nfunction noConversionNeeded(a: TensorLike, dtype: DataType): boolean {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\n\nexport function makeOnesTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\n\nexport function makeZerosTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size) as DataTypeMap[D];\n } else if (dtype === 'int32') {\n return new Int32Array(size) as DataTypeMap[D];\n } else if (dtype === 'bool') {\n return new Uint8Array(size) as DataTypeMap[D];\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(\n shape: number[], dtype: D) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n } else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n } else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now(): number {\n return env().platform.now();\n}\n\nexport function assertNonNegativeIntegerDimensions(shape: number[]) {\n shape.forEach(dimSize => {\n assert(\n Number.isInteger(dimSize) && dimSize >= 0,\n () =>\n `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(\n path: string, requestInits?: RequestInit): Promise {\n return env().platform.fetch(path, requestInits);\n}\n\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s: string, encoding = 'utf-8'): Uint8Array {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes: Uint8Array, encoding = 'utf-8'): string {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(\n locs: number[], rank: number, strides: number[]): number {\n if (rank === 0) {\n return 0;\n } else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(\n index: number, rank: number, strides: number[]): number[] {\n if (rank === 0) {\n return [];\n } else if (rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimer} from './backends/backend';\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport {DataType, DataTypeMap, TypedArray} from './types';\nimport * as util from './util';\n\nexport type KernelProfile = {\n kernelName: string,\n outputs: Tensor[],\n inputs: NamedTensorMap,\n timeMs: Promise,\n extraInfo: Promise\n};\n\nexport class Profiler {\n constructor(private backendTimer: BackendTimer, private logger?: Logger) {\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n\n profileKernel(kernelName: string, inputs: NamedTensorMap, f: () => Tensor[]):\n KernelProfile {\n let outputs: Tensor[];\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n const timer = this.backendTimer.time(holdResultWrapperFn);\n\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(\n timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n\n logKernelProfile(kernelProfile: KernelProfile): void {\n const {kernelName, outputs, timeMs, inputs, extraInfo} = kernelProfile;\n\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(\n kernelName, result, valueContainer[0], valueContainer[1], inputs,\n valueContainer[2]);\n });\n });\n }\n}\n\nexport function checkComputationForErrors(\n vals: DataTypeMap[D], dtype: D, kernelName: string): boolean {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\n\nexport class Logger {\n logKernelProfile(\n name: string, result: Tensor, vals: TypedArray,\n timeMs: number|{error: string}, inputs: NamedTensorMap,\n extraInfo?: string) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n\n console.log(\n `%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${\n inputShapesDescription}\\t%c${extraInfo}`,\n 'font-weight:bold', 'color:red', 'color:blue', 'color: orange',\n 'color: green', 'color: steelblue');\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport * as util from './util';\n\nexport interface TapeNode {\n id: number;\n kernelName: string;\n outputs: Tensor[];\n inputs: NamedTensorMap;\n // Optional params, defined only for ops with gradient impl.\n gradient?: (dys: Tensor[]) => NamedGradientMap;\n saved?: Tensor[];\n}\n\nexport type NamedGradientMap = {\n [inputName: string]: () => Tensor;\n};\n\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(\n tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[] {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX: {[tensorId: number]: boolean} = {};\n const nodesFromX: {[nodeId: number]: boolean} = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n\n if (anyInputFromX) {\n break;\n }\n }\n }\n\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY: {[tensorId: number]: boolean} = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY: {[nodeId: number]: boolean} = {};\n\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n\n // Return the paths that come from x and lead to y.\n const filteredTape: TapeNode[] = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs: {[inputName: string]: Tensor} = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n\n filteredTape.push(prunedNode);\n }\n }\n\n return filteredTape;\n}\n\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(\n tensorAccumulatedGradientMap: {[tensorId: number]: Tensor},\n filteredTape: TapeNode[], tidy: (f: Function) => Tensor,\n add: (a: Tensor, b: Tensor) => Tensor) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n\n const dys: Tensor[] = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n } else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n\n if (node.gradient == null) {\n throw new Error(\n `Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(\n `Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n } else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, TypedArray} from './types';\nimport {computeStrides, isString, rightPad, sizeFromShape} from './util';\n\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\n\nexport function tensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n verbose: boolean) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\n\nfunction computeMaxSizePerColumn(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[]): number[] {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples =\n dtype === 'complex64' ? createComplexTuples(vals) : vals;\n\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(\n padPerCol[j],\n valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\n\nfunction valToString(\n val: number|string|[number, number], pad: number, dtype: DataType) {\n let valStr: string;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n } else if (isString(val)) {\n valStr = `'${val}'`;\n } else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n } else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n\n return rightPad(valStr, pad);\n}\n\nfunction boolNumToString(v: number): string {\n return v === 0 ? 'false' : 'true';\n}\n\nfunction subTensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[], padPerCol: number[], isLast = true): string[] {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0] as number)];\n }\n return [vals[0].toString()];\n }\n\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n\n let firstVals = Array.from(\n vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice(\n (size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement,\n size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map(\n (x, i) => valToString(\n x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals: Array =\n dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines: string[] = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n } else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\n\nfunction createComplexTuples(vals: Array<{}>|\n TypedArray): Array<[number, number]> {\n const complexTuples: Array<[number, number]> = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]] as [number, number]);\n }\n return complexTuples;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensorToString} from './tensor_format';\nimport {ArrayMap, BackendValues, DataType, DataTypeMap, DataValues, NumericDataType, Rank, ShapeMap, SingleValueMap, TypedArray} from './types';\nimport * as util from './util';\nimport {computeStrides, toNestedArray} from './util';\n\nexport interface TensorData {\n dataId?: DataId;\n values?: DataTypeMap[D];\n}\n\n// This interface mimics KernelBackend (in backend.ts), which would create a\n// circular dependency if imported.\nexport interface Backend {}\n\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n size: number;\n shape: ShapeMap[R];\n strides: number[];\n values: DataTypeMap[D];\n\n constructor(shape: ShapeMap[R], public dtype: D, values?: DataTypeMap[D]) {\n this.shape = shape.slice() as ShapeMap[R];\n this.size = util.sizeFromShape(shape);\n\n if (values != null) {\n const n = values.length;\n util.assert(\n n === this.size,\n () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value: SingleValueMap[D], ...locs: number[]): void {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(\n locs.length === this.rank,\n () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n\n const index = this.locToIndex(locs);\n this.values[index] = value as number;\n }\n\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs: number[]): SingleValueMap[D] {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index] as SingleValueMap[D];\n }\n\n locToIndex(locs: number[]): number {\n if (this.rank === 0) {\n return 0;\n } else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n\n indexToLoc(index: number): number[] {\n if (this.rank === 0) {\n return [];\n } else if (this.rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n\n get rank() {\n return this.shape.length;\n }\n\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor(): Tensor {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype) as\n Tensor;\n }\n}\n\nexport interface TensorTracker {\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: Backend): Tensor;\n makeVariable(\n initialValue: Tensor, trainable?: boolean, name?: string,\n dtype?: DataType): Variable;\n incRef(a: Tensor, backend: Backend): void;\n disposeTensor(t: Tensor): void;\n disposeVariable(v: Variable): void;\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n}\n\n/**\n * The Tensor class calls into this handler to delegate chaining operations.\n */\nexport interface OpHandler {\n cast(x: T, dtype: DataType): T;\n buffer(\n shape: ShapeMap[R], dtype: D,\n values?: DataTypeMap[D]): TensorBuffer;\n print(x: T, verbose: boolean): void;\n clone(x: T): T;\n // TODO(yassogba) bring reshape back?\n}\n\n// For tracking tensor creation and disposal.\nlet trackerFn: () => TensorTracker = null;\n// Used by chaining methods to call into ops.\nlet opHandler: OpHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn: (msg: string) => void = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn: () => TensorTracker) {\n trackerFn = fn;\n}\n\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler: OpHandler) {\n opHandler = handler;\n}\n\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn: (msg: string) => void) {\n deprecationWarningFn = fn;\n}\n\n/**\n * We wrap data id since we use weak map to avoid memory leaks.\n * Since we have our own memory management, we have a reference counter\n * mapping a tensor to its data, so there is always a pointer (even if that\n * data is otherwise garbage collectable).\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/\n * Global_Objects/WeakMap\n */\nexport type DataId = object; // object instead of {} to force non-primitive.\n\n// Declare this namespace to make Tensor class augmentation work in google3.\nexport declare namespace Tensor {}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n /** Unique id of this tensor. */\n readonly id: number;\n /**\n * Id of the bucket holding the data for this tensor. Multiple arrays can\n * point to the same bucket (e.g. when calling array.reshape()).\n */\n dataId: DataId;\n /** The shape of the tensor. */\n readonly shape: ShapeMap[R];\n /** Number of elements in the tensor. */\n readonly size: number;\n /** The data type for the array. */\n readonly dtype: DataType;\n /** The rank type for the array (see `Rank` enum). */\n readonly rankType: R;\n\n /** Whether this tensor has been globally kept. */\n kept = false;\n /** The id of the scope this tensor is being tracked in. */\n scopeId: number;\n\n /**\n * Number of elements to skip in each dimension when indexing. See\n * https://docs.scipy.org/doc/numpy/reference/generated/\\\n * numpy.ndarray.strides.html\n */\n readonly strides: number[];\n\n constructor(shape: ShapeMap[R], dtype: DataType, dataId: DataId, id: number) {\n this.shape = shape.slice() as ShapeMap[R];\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;\n }\n\n get rank(): number {\n return this.shape.length;\n }\n\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer(): Promise> {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype as D, vals);\n }\n\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync(): TensorBuffer {\n return opHandler.buffer(this.shape, this.dtype as D, this.dataSync());\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array(): Promise {\n const vals = await this.data();\n return toNestedArray(this.shape, vals) as ArrayMap[R];\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync(): ArrayMap[R] {\n return toNestedArray(this.shape, this.dataSync()) as ArrayMap[R];\n }\n\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data(): Promise {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data as Uint8Array[];\n try {\n return bytes.map(b => util.decodeString(b)) as DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as Promise;\n }\n\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync(): DataTypeMap[D] {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return (data as Uint8Array[]).map(b => util.decodeString(b)) as\n DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as DataTypeMap[D];\n }\n\n /** Returns the underlying bytes of the tensor's data. */\n async bytes(): Promise {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data as Uint8Array[];\n } else {\n return new Uint8Array((data as TypedArray).buffer);\n }\n }\n\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n\n protected isDisposedInternal = false;\n get isDisposed(): boolean {\n return this.isDisposedInternal;\n }\n\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false): void {\n return opHandler.print(this, verbose);\n }\n\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone(this: T): T {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false): string {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n\n cast(dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this as T, dtype);\n }\n variable(trainable = true, name?: string, dtype?: DataType): Variable {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype) as\n Variable;\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance: Tensor) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\n\nexport interface NumericTensor extends Tensor {\n dtype: NumericDataType;\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\nexport interface StringTensor extends Tensor {\n dtype: 'string';\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\n/** @doclink Tensor */\nexport type Scalar = Tensor;\n/** @doclink Tensor */\nexport type Tensor1D = Tensor;\n/** @doclink Tensor */\nexport type Tensor2D = Tensor;\n/** @doclink Tensor */\nexport type Tensor3D = Tensor;\n/** @doclink Tensor */\nexport type Tensor4D = Tensor;\n/** @doclink Tensor */\nexport type Tensor5D = Tensor;\n/** @doclink Tensor */\nexport type Tensor6D = Tensor;\n\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n name: string;\n\n constructor(\n initialValue: Tensor, public trainable: boolean, name: string,\n tensorId: number) {\n super(\n initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.name = name;\n }\n\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue: Tensor): void {\n if (newValue.dtype !== this.dtype) {\n throw new Error(\n `dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(\n `shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n\n dispose(): void {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\n\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance: Variable) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** @docalias number[] */\nexport interface ShapeMap {\n R0: number[];\n R1: [number];\n R2: [number, number];\n R3: [number, number, number];\n R4: [number, number, number, number];\n R5: [number, number, number, number, number];\n R6: [number, number, number, number, number, number];\n}\n\n/** @docalias number[] */\nexport interface ArrayMap {\n R0: number;\n R1: number[];\n R2: number[][];\n R3: number[][][];\n R4: number[][][][];\n R5: number[][][][][];\n R6: number[][][][][][];\n}\n\nexport interface DataTypeMap {\n float32: Float32Array;\n int32: Int32Array;\n bool: Uint8Array;\n complex64: Float32Array;\n string: string[];\n}\n\nexport interface SingleValueMap {\n bool: boolean;\n int32: number;\n float32: number;\n complex64: number;\n string: string;\n}\n\n/** @docalias 'float32'|'int32'|'bool'|'complex64'|'string' */\nexport type DataType = keyof DataTypeMap;\nexport type NumericDataType = 'float32'|'int32'|'bool'|'complex64';\nexport type TypedArray = Float32Array|Int32Array|Uint8Array;\n/** Tensor data used in tensor creation and user-facing API. */\nexport type DataValues = DataTypeMap[DataType];\n/** The underlying tensor data that gets stored in a backend. */\nexport type BackendValues = Float32Array|Int32Array|Uint8Array|Uint8Array[];\n\nexport enum Rank {\n R0 = 'R0',\n R1 = 'R1',\n R2 = 'R2',\n R3 = 'R3',\n R4 = 'R4',\n R5 = 'R5',\n R6 = 'R6'\n}\n\nexport type FlatVector = boolean[]|number[]|TypedArray;\nexport type RegularArray =\n T[]|T[][]|T[][][]|T[][][][]|T[][][][][]|T[][][][][][];\n\n// tslint:disable-next-line:no-any\nexport interface RecursiveArray {\n [index: number]: T|RecursiveArray;\n}\n\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nenum UpcastInt32AndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'int32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastBoolAndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'bool',\n 'complex64' = 'complex64'\n}\n\nenum UpcastFloat32AndMap {\n 'float32' = 'float32',\n 'int32' = 'float32',\n 'bool' = 'float32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastComplex64AndMap {\n 'float32' = 'complex64',\n 'int32' = 'complex64',\n 'bool' = 'complex64',\n 'complex64' = 'complex64'\n}\n\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\n\nexport function upcastType(typeA: DataType, typeB: DataType): DataType {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n\n/** Returns the output type after summation. */\nexport function sumOutType(type: DataType): DataType {\n return upcastType(type, 'int32');\n}\n\n/** @docalias TypedArray|Array */\nexport type TensorLike =\n TypedArray|number|boolean|string|RecursiveArray|\n RecursiveArray|RecursiveArray|Uint8Array[];\nexport type ScalarLike = number|boolean|string|Uint8Array;\n/** @docalias TypedArray|Array */\nexport type TensorLike1D = TypedArray|number[]|boolean[]|string[]|Uint8Array[];\n/** @docalias TypedArray|Array */\nexport type TensorLike2D = TypedArray|number[]|number[][]|boolean[]|boolean[][]|\n string[]|string[][]|Uint8Array[]|Uint8Array[][];\n/** @docalias TypedArray|Array */\nexport type TensorLike3D = TypedArray|number[]|number[][][]|boolean[]|\n boolean[][][]|string[]|string[][][]|Uint8Array[]|Uint8Array[][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike4D = TypedArray|number[]|number[][][][]|boolean[]|\n boolean[][][][]|string[]|string[][][][]|Uint8Array[]|Uint8Array[][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike5D =\n TypedArray|number[]|number[][][][][]|boolean[]|boolean[][][][][]|string[]|\n string[][][][][]|Uint8Array[]|Uint8Array[][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike6D =\n TypedArray|number[]|number[][][][][][]|boolean[]|boolean[][][][][][]|\n string[]|string[][][][][][]|Uint8Array[]|Uint8Array[][][][][];\n\n/** Type for representing image dat in Uint8Array type. */\nexport interface PixelData {\n width: number;\n height: number;\n data: Uint8Array;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {TensorContainer, TensorContainerArray} from './tensor_types';\nimport {upcastType} from './types';\nimport {assert} from './util';\n\nexport function makeTypesMatch(a: T, b: T): [T, T] {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\n\nexport function assertTypesMatch(a: Tensor, b: Tensor): void {\n assert(\n a.dtype === b.dtype,\n () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\n\nexport function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean {\n return tensorList.some(x => x.id === tensor.id);\n}\n\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result: TensorContainer): Tensor[] {\n const list: Tensor[] = [];\n const seen = new Set<{}|void>();\n walkTensorContainer(result, list, seen);\n return list;\n}\n\nfunction walkTensorContainer(\n container: TensorContainer, list: Tensor[], seen: Set<{}|void>): void {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container as TensorContainerArray;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction isIterable(obj: any): boolean {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimingInfo, DataMover, KernelBackend} from './backends/backend';\nimport {Environment, setEnvironmentGlobal} from './environment';\nimport {getGlobalNamespace} from './global_util';\nimport {Add, Cast} from './kernel_names';\nimport {getGradient, getKernel, getKernelsForBackend, GradFunc, NamedAttrMap, TensorInfo} from './kernel_registry';\nimport {KernelProfile, Profiler} from './profiler';\nimport {backpropagateGradients, getFilteredNodesXToY, TapeNode} from './tape';\nimport {DataId, setTensorTracker, Tensor, TensorTracker, Variable} from './tensor';\nimport {GradSaveFunc, NamedTensorMap, NamedVariableMap, TensorContainer} from './tensor_types';\nimport {getTensorsInContainer} from './tensor_util';\nimport {BackendValues, DataType, DataValues} from './types';\nimport * as util from './util';\nimport {bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape} from './util';\n\n/**\n * A function that computes an output. The save function is for saving tensors\n * computed in the forward pass, that we need in the backward pass.\n */\nexport type ForwardFunc