how to use ml5 js

Solutions on MaxInterview for how to use ml5 js by the best coders in the world

showing results for - "how to use ml5 js"
Chahine
04 Jun 2018
1// Step 1: Create an image classifier with MobileNet
2const classifier = ml5.imageClassifier("MobileNet", onModelReady);
3
4// Step 2: select an image
5const img = document.querySelector("#myImage");
6
7// Step 3: Make a prediction
8let prediction = classifier.predict(img, gotResults);
9
10// Step 4: Do something with the results!
11function gotResults(err, results) {
12  console.log(results);
13  // all the amazing things you'll add
14}