Angad Sandhu
Search
Browse

2_js

Source name
2_js.js
const img = document.getElementById('img');
const outp = document.getElementById('output');

mobilenet.load().then((model) => {
    model.classify(img).then(predictions => {
        console.log(predictions);

        for (var i = 0; i < predictions.length; i++) {
            outp.innerHTML += "<br/>" + predictions[i].className
                + " : " + predictions[i].probability;
        }
    })
})

Browse the library