If you are using our pre-made models like the above, we do all this resizing for you as it must fit the model’s supported input Tensor sizes correctly to use the ML model behind the scenes. To make these pre-made models easy to use we handle all of that.
Of course if you are using a raw TFJS model yourself (loading in the model.json and *.bin files manually) - not our nice JS wrapper classes, then of course you would need to do this resizing and conversion to Tensors yourself to perform an inference, but in the above, there is no need as we handle it all for you.
To resize images I recommend checking out the TensorFlow.js API which has functions for this purpose: TensorFlow.js API 5  Note the differences between:
tf.image.resizeBilinear 6
tf.image.resizeNearestNeighbor 12
As this can effect your image data. See this image for a quick visual comparison of what different types of resize do to an image:

Gant’s new TensorFlow.js book goes into a lot more detail on these methods if you are curious to learn more:  Learning TensorFlow.js [Book] 9