File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,24 @@ class StyleTransfer extends Video {
30
30
callback = videoOrCallback ;
31
31
}
32
32
33
- this . loadVideo ( ) . then ( ( ) => {
34
- this . videoReady = true ;
33
+ if ( this . videoElt ) {
34
+ this . loadVideo ( ) . then ( ( ) => {
35
+ this . videoReady = true ;
36
+ this . loadCheckpoints ( model ) . then ( ( ) => {
37
+ this . ready = true ;
38
+ if ( callback ) {
39
+ callback ( ) ;
40
+ }
41
+ } ) ;
42
+ } ) ;
43
+ } else {
35
44
this . loadCheckpoints ( model ) . then ( ( ) => {
36
45
this . ready = true ;
37
46
if ( callback ) {
38
47
callback ( ) ;
39
48
}
40
49
} ) ;
41
- } ) ;
50
+ }
42
51
}
43
52
44
53
async loadCheckpoints ( path ) {
@@ -92,7 +101,7 @@ class StyleTransfer extends Video {
92
101
if ( inputOrCallback instanceof HTMLVideoElement || inputOrCallback instanceof HTMLImageElement ) {
93
102
input = inputOrCallback ;
94
103
} else if ( typeof inputOrCallback === 'object' && ( inputOrCallback . elt instanceof HTMLVideoElement || inputOrCallback . elt instanceof HTMLImageElement ) ) {
95
- input = inputOrCallback ;
104
+ input = inputOrCallback . elt ;
96
105
} else if ( typeof inputOrCallback === 'function' ) {
97
106
input = this . video ;
98
107
callback = inputOrCallback ;
You can’t perform that action at this time.
0 commit comments