How to use the @tensorflow-models/posenet/dist/util.padAndResizeTo function in @tensorflow-models/posenet

To help you get started, we’ve selected a few @tensorflow-models/posenet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlecreativelab / teachablemachine-community / libraries / pose / src / custom-posenet.ts View on Github external
public async estimatePoseOutputs(sample: PosenetInput) {
		const inputResolution = this.posenetModel.inputResolution;

		const { resized, padding } = padAndResizeTo(sample, inputResolution);

		const {heatmapScores, offsets, displacementFwd, displacementBwd} 
			= await this.posenetModel.baseModel.predict(resized);

		resized.dispose();

		return {heatmapScores, offsets, displacementFwd, displacementBwd, padding};
	}