Full Image Tags (.ml5 js Userscript Example)

Model Homepage

ml5

In Diffgram

Search ml5js Full Image

Code

// Initialize the Image Classifier method with MobileNet
const classifier = ml5.imageClassifier(
  'MobileNet', modelLoaded);

// When the model is loaded
function modelLoaded() {
  console.log('Model Loaded!');
}

// Make a prediction with a selected image
let canvas = diffgram.get_new_canvas()
classifier.classify(canvas, 
  (err, results) => {
  console.log(results);
});

📘

Incomplete example

Please see other examples for more complete. This is a very high level print to console example.


Did this page help you?