p5(sketch => {
let mobileNet
function onModelReady() {
mobileNet.predict(image, onPrediction)
}
function onPrediction(error, results) {
if (error) mutable output = [error]
else mutable output = results
}
sketch.setup = function() {
sketch.createCanvas(width, 0)
sketch.background(0)
mobileNet = ml5.imageClassifier('MobileNet', onModelReady)
};
sketch.draw = function() {
}
})