Skip to content

Commit d8de242

Browse files
committed
bug fix for when modelLoaded callback is not supplied
1 parent 282fc6a commit d8de242

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/Handpose/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function setup() {
88
video.size(width, height);
99

1010
const options = { maxHands: 2 };
11-
handpose = ml5.handpose(video, options);
11+
handpose = ml5.handpose(video, options, modelReady);
1212

1313
// This sets up an event that fills the global variable "predictions"
1414
// with an array every time new hand poses are detected

src/Handpose/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Handpose extends EventEmitter {
9191
const handpose = (...inputs) => {
9292
const { video, options = {}, callback } = handleArguments(...inputs);
9393
const instance = new Handpose(video, options, callback);
94-
return callback ? instance : instance.ready;
94+
return instance;
9595
};
9696

9797
export default handpose;

0 commit comments

Comments
 (0)