Skip to content

Commit

Permalink
xo
Browse files Browse the repository at this point in the history
  • Loading branch information
piercus committed Mar 29, 2019
1 parent f69fa90 commit 4f3a64b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
7 changes: 3 additions & 4 deletions test/examples/simple-example.js
Original file line number Diff line number Diff line change
@@ -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});
})
Expand Down

0 comments on commit 4f3a64b

Please sign in to comment.