Skip to content

Commit

Permalink
Merge pull request #995 from nature-of-code/notion-update-docs
Browse files Browse the repository at this point in the history
[Notion] Update docs
  • Loading branch information
shiffman authored Jul 11, 2024
2 parents 0221a78 + 2fb28ab commit 535a4a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions content/examples/10_nn/10_2_gesture_classifier/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let start, end;

function setup() {
createCanvas(640, 240);
ml5.setBackend('cpu');
ml5.setBackend("cpu");
// Step 2: set your neural network options
let options = {
task: "classification",
Expand Down Expand Up @@ -69,12 +69,10 @@ function mouseReleased() {
let dir = p5.Vector.sub(end, start);
dir.normalize();
let inputs = [dir.x, dir.y];
console.log(inputs);
classifier.classify(inputs, gotResults);
}

// Step 9: define a function to handle the results of your classification
function gotResults(error, results) {
function gotResults(results) {
status = results[0].label;
console.log(JSON.stringify(results,null,2));
}

0 comments on commit 535a4a4

Please sign in to comment.