Skip to content

Instantly share code, notes, and snippets.

@poshaughnessy
Last active October 31, 2018 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poshaughnessy/41955844f0c34d7020e63d17cc4ade69 to your computer and use it in GitHub Desktop.
Save poshaughnessy/41955844f0c34d7020e63d17cc4ade69 to your computer and use it in GitHub Desktop.
// Load the prediction model
mobilenet.load().then(model => {
// Now we can keep checking the camera feed at regular intervals, like this:
model.classify(video).then(predictions => {
const topResult = predictions[0];
if (topResult.className === 'llama') {
// Woo! Llama! NB. We can also get the confidence value from the `probability`
...
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment