Skip to content

Commit 4d83cc9

Browse files
committed
.
1 parent 6ffc23e commit 4d83cc9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/YOLO/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@ class YOLO {
108108
}
109109

110110
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;
112115

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);
117117

118118
// Scale Stuff
119119
this.scaleX = this.imgHeight / this.inputHeight;
120120
this.scaleY = this.imgWidth / this.inputWidth;
121-
return img;
121+
return img1;
122122
}
123123

124124
async postProccess(rawPrediction) {

0 commit comments

Comments
 (0)