Ml5 - Feature Extractor Classification using image files (edited)

After having viewed Dan Shiffman’s Feature Extractor Classification lesson, I’m attempting to train my model using preloaded jpgs rather than grabbing webcam images, similar to the option offered in Google’s Teachable Machine. I haven’t yet found an example of this though it seems a few have encountered issues when trying to do something similar - “Can we add our DataSet(Images) to ML5 Data Model #260” I’m not sure how to revise the classifier and image-adding functions. Would appreciate advice from the community.

 classifier = mobilenet.classification(video, videoReady);

  happyButton = createButton('happy');
  happyButton.mousePressed(function() {
    classifier.addImage('happy');
  });

  sadButton = createButton('sad');
  sadButton.mousePressed(function() {
    classifier.addImage('sad');
  });