Last active
March 11, 2019 21:12
-
-
Save vabarbosa/e085304561ee05cdfe6a879e45c1c79d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a tensor from an image - tensorflow.js 0.15.1 | |
// https://js.tensorflow.org/api/0.15.1/#fromPixels | |
const imageTensor = tf.fromPixels(imageElement) | |
// insert a dimension into the tensor's shape | |
const preprocessedInput = imageTensor.expandDims() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment