Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
padding: Padding,
flipHorizontal = false
) {
const config = {
maxDetections: MAX_PREDICTIONS,
scoreThreshold: 0.5,
nmsRadius: 20
};
const [height, width] = getInputTensorDimensions(input);
const outputStride = this.posenetModel.baseModel.outputStride;
const inputResolution = this.posenetModel.inputResolution;
const [scoresBuffer, offsetsBuffer, displacementsFwdBuffer, displacementsBwdBuffer]
= await toTensorBuffers3D([heatmapScores, offsets, displacementFwd, displacementBwd]);
const poses = await decodeMultiplePoses(scoresBuffer, offsetsBuffer, displacementsFwdBuffer,
displacementsBwdBuffer, outputStride, config.maxDetections, config.scoreThreshold, config.nmsRadius);
const resultPoses = scaleAndFlipPoses(poses, [height, width], inputResolution,
padding, flipHorizontal);
heatmapScores.dispose();
offsets.dispose();
displacementFwd.dispose();
displacementBwd.dispose();
return resultPoses[0];
}