// 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()