DEV Community

Discussion on: Machine Learning In Node.js With TensorFlow.js

Collapse
 
aralroca profile image
Aral Roca • Edited

Good article! 😊 Nevertheless, in the tfjs documentation I see that there is the method tf.fromPixels that creates a tf.Tensor from an image. Maybe is possible to replace it? Instead of jpeg-js library?

I'm not familiar with tensorflow.js, but I think that for matrix operations like this is performing better (with GPU) than using two nested fors. (Not sure...)

Thank you!! BTW; Very good article!

Collapse
 
jthomas profile image
James Thomas

Hello Aral, tf.fromPixels can only be used in the browser I'm afraid. It extract pixels from DOM elements like video, image or canvas tags, rather than native buffers.

Collapse
 
aralroca profile image
Aral Roca

Thank you for that clarification! I would like to try tfjs in node.js!