A simple Tfjs Image Classification in Node.js

Usage no npm install needed!

<script type="module">
  import tfjsImageClassification from '';


Image Classification : Machine Learning in Node.js with TensorFlow.js

Image Classification in Node.js with TensorFlow.js

Getting Started


Open it in GitHub Desktop or git clone the repository or download the zip & extract the project.

Open the terminal in the project folder and type npm install.


Go to the project folder, and Open the Terminal to that path.

You can use any image you have, just paste it in the project folder and give the name as the argument.

  • Run the file (classify.js) with an image file as an argument.
node classify.js rabbit.jpg
  • The result will be shown in the Terminal as :
Classification Results: [
    className: 'Angora, Angora rabbit',
    probability: 0.9488762617111206
  { className: 'hamster', probability: 0.023957064375281334 },
    className: 'guinea pig, Cavia cobaya',
    probability: 0.016880817711353302

First Author

Second Author

  • Anonymous