diff --git a/package.json b/package.json index 3ae3cd7..9f2aae5 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "bluebird": "^3.5.3", "jsdoc": "^3.5.5", "opencv4nodejs": "^4.14.1", + "pngjs": "^3.4.0", "semantic-release": "^15.13.3", "xo": "^0.24.0" }, diff --git a/test/examples/simple-example.js b/test/examples/simple-example.js index 121288c..4d59aa6 100644 --- a/test/examples/simple-example.js +++ b/test/examples/simple-example.js @@ -1,15 +1,14 @@ // Tfjs does not provide any read/write manipulation // function on nodejs, so we nee to to this with pngjs - -const {PNG} = require('pngjs'); const fs = require('fs'); +const {PNG} = require('pngjs'); const fileToTensor = function (filename) { return new Promise((resolve, reject) => { const inputPng = new PNG(); fs.createReadStream(filename) - .pipe(inputPng) - .on('parsed', () => { + .pipe(inputPng) + .on('parsed', () => { const images = tf.tensor4d(inputPng.data, [1, inputPng.height, inputPng.width, 4]); resolve({images}); })