Last active
April 17, 2016 16:56
-
-
Save kidapu/d9b6d469bacbcd3fad15778149d72c12 to your computer and use it in GitHub Desktop.
neural-style-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _child = require('child_process'); | |
// convert | |
init(); | |
function init() | |
{ | |
// safety success | |
var args = [ | |
"neural_style.lua", | |
"-style_image" , "outputs/kida/jiburi.jpg", | |
"-content_image" , "outputs/kida/kida.jpg", | |
"-output_image" , "outputs/kida/result.jpg", | |
"-gpu" , -1, | |
"-print_iter" , 1, | |
"-save_iter" , 5 | |
]; | |
// var args = [ | |
// "neural_style.lua", | |
// "-style_image" , "outputs/kida/jiburi.jpg", | |
// "-content_image" , "outputs/kida/kida.jpg", | |
// "-output_image" , "outputs/kida/result.jpg", | |
// "-gpu" , 0, | |
// "-print_iter" , 1, | |
// "-save_iter" , 5 | |
// ]; | |
console.log() | |
console.log( args.toString().replace(/,/g," ") ); | |
console.log() | |
var exec = _child.spawn("th", args); | |
exec.stdout.on('data', function(data) { | |
console.log('[stdout]: ' + data); | |
//Here is where the output goes | |
}); | |
exec.stderr.on('data', function(data) { | |
console.log('[stderr]: ' + data); | |
//Here is where the error output goes | |
}); | |
exec.stdout.on('end', function(code) { | |
console.log('[end]: ' + code); | |
//Here you can get the exit code of the script | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment