function drawPose(context, pose, showLabels, showFacePoints) {
if (pose.keypoints) {
const points = new Map();
pose.keypoints.map(point => points.set(point.name, point));
drawLine(context, points.get('left_shoulder'), points.get('right_shoulder'));
drawLine(context, points.get('left_hip'), points.get('right_hip'));
drawLine(context, points.get('left_shoulder'), points.get('left_elbow'));
drawLine(context, points.get('left_elbow'), points.get('left_wrist'));
drawLine(context, points.get('left_shoulder'), points.get('left_hip'));
drawLine(context, points.get('left_hip'), points.get('left_knee'));
drawLine(context, points.get('left_knee'), points.get('left_ankle'));
drawLine(context, points.get('right_shoulder'), points.get('right_elbow'));
drawLine(context, points.get('right_elbow'), points.get('right_wrist'));
drawLine(context, points.get('right_shoulder'), points.get('right_hip'));
drawLine(context, points.get('right_hip'), points.get('right_knee'));
drawLine(context, points.get('right_knee'), points.get('right_ankle'));
if (showFacePoints) {
drawLine(context, points.get('right_ear'), points.get('right_eye'));
drawLine(context, points.get('right_eye'), points.get('nose'));
drawLine(context, points.get('nose'), points.get('left_eye'));
drawLine(context, points.get('left_eye'), points.get('left_ear'));
}
pose.keypoints.forEach(point => drawPoint(context, point, showLabels, showFacePoints));
}
}