File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -108,17 +108,17 @@ class YOLO {
108
108
}
109
109
110
110
preProccess ( input ) {
111
- let img = tf . fromPixels ( input ) ;
111
+ const img = tf . fromPixels ( input ) ;
112
+ const [ w , h ] = [ img . shape [ 1 ] , img . shape [ 0 ] ] ;
113
+ this . imgWidth = w ;
114
+ this . imgHeight = h ;
112
115
113
- this . imgWidth = img . shape [ 1 ] ;
114
- this . imgHeight = img . shape [ 0 ] ;
115
-
116
- img = tf . image . resizeBilinear ( img , [ this . inputHeight , this . inputWidth ] ) . toFloat ( ) . div ( tf . scalar ( 255 ) ) . expandDims ( 0 ) ;
116
+ const img1 = tf . image . resizeBilinear ( img , [ this . inputHeight , this . inputWidth ] ) . toFloat ( ) . div ( tf . scalar ( 255 ) ) . expandDims ( 0 ) ;
117
117
118
118
// Scale Stuff
119
119
this . scaleX = this . imgHeight / this . inputHeight ;
120
120
this . scaleY = this . imgWidth / this . inputWidth ;
121
- return img ;
121
+ return img1 ;
122
122
}
123
123
124
124
async postProccess ( rawPrediction ) {
You can’t perform that action at this time.
0 commit comments