From 97fe47df8650ba9a6a87e1edf26c69bdf148d855 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 15 Apr 2021 15:26:31 -0400 Subject: [PATCH] fix image orientation --- test/test-main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-main.js b/test/test-main.js index 165a4c7c..f7cd71d5 100644 --- a/test/test-main.js +++ b/test/test-main.js @@ -41,7 +41,7 @@ async function getImage(human, input) { const tensor = human.tf.tensor(Array.from(imageData.data), [canvas.height, canvas.width, 4], 'int32'); // create rgba image tensor from flat array const channels = human.tf.split(tensor, 4, 2); // split rgba to channels const rgb = human.tf.stack([channels[0], channels[1], channels[2]], 2); // stack channels back to rgb - const reshape = human.tf.reshape(rgb, [1, canvas.width, canvas.height, 3]); // move extra dim from the end of tensor and use it as batch number instead + const reshape = human.tf.reshape(rgb, [1, canvas.height, canvas.width, 3]); // move extra dim from the end of tensor and use it as batch number instead return reshape; }); if (res && res.shape[0] === 1 && res.shape[3] === 3) log('state', 'passed: load image:', input, res.shape);