Skip to content

Instantly share code, notes, and snippets.

@rocioDEV
Created February 28, 2020 08:48
Show Gist options
  • Save rocioDEV/4a7593906ac89e92ffbce42266f8c7a1 to your computer and use it in GitHub Desktop.
Save rocioDEV/4a7593906ac89e92ffbce42266f8c7a1 to your computer and use it in GitHub Desktop.
ml5-loop
const loop = classifier => {
classifier.classify().then(results => {
setResult({
label: results[0].label,
probability: results[0].confidence.toFixed(4)
})
loop(classifier) // Call again to create a loop
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment