From 214a486be266ddc3eb51f27084db9de7231e5215 Mon Sep 17 00:00:00 2001 From: Carly Richmond <74931905+carlyrichmond@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:27:19 +0100 Subject: [PATCH] Tidying comments --- model-classification-app/scripts/transfer-learning.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model-classification-app/scripts/transfer-learning.js b/model-classification-app/scripts/transfer-learning.js index 108fe77..a1ca311 100644 --- a/model-classification-app/scripts/transfer-learning.js +++ b/model-classification-app/scripts/transfer-learning.js @@ -41,6 +41,8 @@ async function run() { // Get features from MobileNet const mobileNetFeatures = images.map((image) => { + // Normalize the image data. Image data is always in the range of 0 to 255, + // so you can simply divide resizedTensorFrame by 255 to ensure all values are between 0 and 1 instead as MobileNet expects const normalizedImageTensor = image.div(255); return mobileNetModel.predict(normalizedImageTensor.expandDims()).squeeze(); });