Skip to content

Commit 72b7787

Browse files
committed
Fix posenet on video ready
1 parent d7ba040 commit 72b7787

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/PoseNet/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ class PoseNet extends EventEmitter {
4141
async load() {
4242
this.net = await posenet.load(this.multiplier);
4343

44-
if (this.video && this.video.readyState === 0) {
45-
await new Promise((resolve) => {
46-
this.video.onloadeddata = () => resolve();
47-
});
48-
44+
if (this.video) {
45+
if (this.video.readyState === 0) {
46+
await new Promise((resolve) => {
47+
this.video.onloadeddata = () => resolve();
48+
});
49+
}
4950
if (this.detectionType === 'single') {
5051
this.singlePose();
5152
}

src/YOLO/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class YOLOBase extends Video {
5151
if (this.videoElt && !this.video) {
5252
this.video = await this.loadVideo();
5353
}
54-
5554
this.model = await tf.loadModel(URL);
5655
this.modelReady = true;
5756
return this;

0 commit comments

Comments
 (0)