Hi , thanks for clarification . I was wondering isnt there an inbuilt ålibrary for displaying the skeleton overlay ?
Another question, i tried to run this code on mobile browser of smartphone activating the front camera but didn’t seem to get any detection. I was under the impression it was independent of front camera/back camera to make detection.
Sample p5js sketch snippet
let detector;
let poses;
let video;
let wv=1280; //the default input size of the camera
let hv=720;
let w=640; //the size of the canvas
let h=480;
let f=2; //the amount we want to scale down the video input
var capture ;

async function init() {
  const detectorConfig = {
    modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
  };
  detector = await poseDetection.createDetector(
    poseDetection.SupportedModels.PoseNet,
    detectorConfig
  );
  //detector.initCropRegion(w,h); //not callable

}

async function videoReady() {
  console.log("Capture loaded... or has it?");
  console.log("Capture: " + video.width + ", " + video.height);
  console.log("Video element: " + video.elt.videoWidth + ", " + video.elt.videoHeight);
  
  wv = video.elt.videoWidth;
  hv = video.elt.videoHeight;
  
  //console.log("video ready");
  await getPoses();
}

function setup() {
  createCanvas(displayWidth, displayHeight);
  var constraints = {
    audio: false,
    video: {
      facingMode: {
        exact: "environment"
      }
    }    
    //video: {
      //facingMode: "user"
    //} 
  };
  capture = createCapture(constraints,videoReady);
  
  capture.hide();
}


async function getPoses() {
  if(detector){
    poses = await detector.estimatePoses(video.elt);
  
  }
       
  console.log(poses);
  requestAnimationFrame(getPoses);
}



function draw() {
 image(capture, 0, 0); 

}