Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
personOrPersonPartSegmentation.forEach(personSegmentation => {
let pose = personSegmentation.pose;
if (flipHorizontally) {
pose = bodyPix.flipPoseHorizontal(pose, personSegmentation.width);
}
drawKeypoints(pose.keypoints, 0.1, ctx);
drawSkeleton(pose.keypoints, 0.1, ctx);
});
} else {
personOrPersonPartSegmentation.allPoses.forEach(pose => {
if (flipHorizontally) {
pose = bodyPix.flipPoseHorizontal(
pose, personOrPersonPartSegmentation.width);
}
drawKeypoints(pose.keypoints, 0.1, ctx);
drawSkeleton(pose.keypoints, 0.1, ctx);
})
}