How to use the @tensorflow-models/posenet/dist/util.getAdjacentKeyPoints 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 / utils / pose-draw.ts View on Github external
export function drawSkeleton(
	keypoints: Keypoint[],
	minConfidence: number,
	ctx: CanvasRenderingContext2D,
	lineWidth: number = LINE_WIDTH,
	strokeColor: string = STROKE_COLOR,
	scale = 1
) {
	const adjacentKeyPoints = getAdjacentKeyPoints(keypoints, minConfidence);

	adjacentKeyPoints.forEach(keypoints => {
		drawSegment(
			toTuple(keypoints[0].position),
			toTuple(keypoints[1].position),
			ctx,
			lineWidth,
			strokeColor,
			scale
		);
	});
}