File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,12 @@ Image Classifier using pre-trained networks
10
10
import * as tf from '@tensorflow/tfjs' ;
11
11
import callCallback from '../utils/callcallback' ;
12
12
import { array3DToImage } from '../utils/imageUtilities' ;
13
- import Video from '../utils/Video' ;
14
13
import p5Utils from '../utils/p5Utils' ;
15
14
16
15
const URL = 'https://raw.githubusercontent.com/zaidalyafeai/HostedModels/master/unet-128/model.json' ;
17
16
const imageSize = 128 ;
18
17
19
- class UNET extends Video {
18
+ class UNET {
20
19
/**
21
20
* Create UNET class.
22
21
* @param {HTMLVideoElement | HTMLImageElement } video - The video or image to be used for segmentation.
@@ -25,16 +24,12 @@ class UNET extends Video {
25
24
* that will be resolved once the model has loaded.
26
25
*/
27
26
constructor ( video , options , callback ) {
28
- super ( video , imageSize ) ;
29
27
this . modelReady = false ;
30
28
this . isPredicting = false ;
31
29
this . ready = callCallback ( this . loadModel ( ) , callback ) ;
32
30
}
33
31
34
32
async loadModel ( ) {
35
- if ( this . videoElt && ! this . video ) {
36
- this . video = await this . loadVideo ( ) ;
37
- }
38
33
this . model = await tf . loadLayersModel ( URL ) ;
39
34
this . modelReady = true ;
40
35
return this ;
You can’t perform that action at this time.
0 commit comments