browser_client/examples/example5_posenet_curves_combine/sketch.js
// Combine the keypoints of the two poss
Combine the keypoints of the two poss
Combine the keypoints of the two poss
function combinePoses(pose1, pose2, edges1, edges2) {
  let combinedPose = [];
  let leftSide;
  let rightSide;
  if (edges1.left.x < edges2.left.x) {
    leftSide = _.cloneDeep(pose1);
    rightSide = _.cloneDeep(pose2);
  } else {
    leftSide = _.cloneDeep(pose2);
    rightSide = _.cloneDeep(pose1);
  }
  for (let i = 0; i < 7; i++) {
    combinedPose.push(leftSide[i]);
  }
  if (mirror) {
    for (let i = 6; i >= 0; i--) {
      combinedPose.push(rightSide[i]);
    }
  } else {
    for (let i = 7; i < 14; i++) {
      combinedPose.push(rightSide[i]);
    }
  }
  return combinedPose;
}
function combinePoses ( pose1 , pose2 , edges1 , edges2 ) { let combinedPose = [ ] ; let leftSide ; let rightSide ; if ( edges1 . left . x < edges2 . left . x ) { leftSide = _ . cloneDeep ( pose1 ) ; rightSide = _ . cloneDeep ( pose2 ) ; } else { leftSide = _ . cloneDeep ( pose2 ) ; rightSide = _ . cloneDeep ( pose1 ) ; } for ( let i = 0 ; i < 7 ; i ++ ) { combinedPose . push ( leftSide [ i ] ) ; } if ( mirror ) { for ( let i = 6 ; i >= 0 ; i -- ) { combinedPose . push ( rightSide [ i ] ) ; } } else { for ( let i = 7 ; i < 14 ; i ++ ) { combinedPose . push ( rightSide [ i ] ) ; } } return combinedPose ; }
Combine the keypoints of the two poss
Combine the keypoints of the two poss
// Creat an array to hold the combined poses // Create variables to hold each side of the combined pose // If pose1 is on the left side // Put pose1 points in the left of the combined pose // And pose2 on the right side // Otherwise, put pose2 on the left side // ANd pose1 on the right side // Get first half of keypoints from the left side of one pose // If mirroring // Repeat the leftside, backwards ¯\_(ツ)_/¯ // Othwerwise // Get the second half of the keypoints from the right side of the other pose // Return the combined pose