File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,12 @@ class PoseNet extends EventEmitter {
41
41
async load ( ) {
42
42
this . net = await posenet . load ( this . multiplier ) ;
43
43
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
+ }
49
50
if ( this . detectionType === 'single' ) {
50
51
this . singlePose ( ) ;
51
52
}
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ class YOLOBase extends Video {
51
51
if ( this . videoElt && ! this . video ) {
52
52
this . video = await this . loadVideo ( ) ;
53
53
}
54
-
55
54
this . model = await tf . loadModel ( URL ) ;
56
55
this . modelReady = true ;
57
56
return this ;
You can’t perform that action at this time.
0 commit comments