This work connects p5js and Google MediaPipe to draw bezier curves around a human form:
You can clone and experiment with the work here:
In this sketch a separate file connects to Google MediaPipe and abstracts away the tricky aspect of using this machine learning tool. P5js gets access to all the tracking data and a function draws bezier curves and uses lerp to smooth things.
Both Ml5js and other machine learning tools have been experimented with. Google MediaPipe pose detection is much more accurate than PoseNet on ml5js, however its a bigger download, so slower to load and it is much tricker to get started with.