posenet/demos/coco.js
function drawResults(canvas, poses, minPartConfidence, minPoseConfidence) {
  renderImageToCanvas(image, [513, 513], canvas);
  poses.forEach((pose) => {
    if (pose.score >= minPoseConfidence) {
      if (guiState.showKeypoints) {
        drawKeypoints(
            pose.keypoints, minPartConfidence, canvas.getContext('2d'));
      }

      if (guiState.showSkeleton) {
        drawSkeleton(
            pose.keypoints, minPartConfidence, canvas.getContext('2d'));
      }

      if (guiState.showBoundingBox) {
        drawBoundingBox(pose.keypoints, canvas.getContext('2d'));
      }
    }
  });
}
function drawResults(canvas, poses, minPartConfidence, minPoseConfidence) {
  renderImageToCanvas(image, [513, 513], canvas);
  poses.forEach((pose) => {
    if (pose.score >= minPoseConfidence) {
      if (guiState.showKeypoints) {
        drawKeypoints(
            pose.keypoints, minPartConfidence, canvas.getContext('2d'));
      }

      if (guiState.showSkeleton) {
        drawSkeleton(
            pose.keypoints, minPartConfidence, canvas.getContext('2d'));
      }

      if (guiState.showBoundingBox) {
        drawBoundingBox(pose.keypoints, canvas.getContext('2d'));
      }
    }
  });
}
function drawResults ( canvas , poses , minPartConfidence , minPoseConfidence ) { renderImageToCanvas ( image , [ 513 , 513 ] , canvas ) ; poses . forEach ( ( pose ) => { if ( pose . score >= minPoseConfidence ) { if ( guiState . showKeypoints ) { drawKeypoints ( pose . keypoints , minPartConfidence , canvas . getContext ( '2d' ) ) ; } if ( guiState . showSkeleton ) { drawSkeleton ( pose . keypoints , minPartConfidence , canvas . getContext ( '2d' ) ) ; } if ( guiState . showBoundingBox ) { drawBoundingBox ( pose . keypoints , canvas . getContext ( '2d' ) ) ; } } } ) ; }
Draws a pose if it passes a minimum confidence onto a canvas.
Only the pose's keypoints that pass a minPartConfidence are drawn.
Draws a pose if it passes a minimum confidence onto a canvas . Only the pose s keypoints that pass a minPartConfidence are drawn .