Models Covered:

demo code for all models mentioned in lecture: week3-pose


bodyPix PartMask code

ml5 website > getting started. quick start link to add to html

then go to reference page to see the things you can do with it, also has examples

  1. have video so can pass to model
//always get video like this. but plain video element and dont want so hide
//want diff one, one we draw as img on canvas
let video;

function setup() {
  video = createCapture(VIDEO)
  video.hide()
  createCanvas(640, 480);
  
}

function draw() {
  image(video, 0, 0, width, height)
}
  1. load model
function setup() {
myBodyPix = ml5.bodyPix(video, modelLoaded)
function modelLoaded(){
  console.log('model is ready', myBodyPix)
  
  
}