I searched a lot but didn't find any answers. I have html, js and css files and trained stargan net. I need to launch stargan generator from js script to generate new images from webcam screenshot. So question is how i can launch .py file directly or with cmd. All should be local, because I don't have server and launcing all directly from files.
I tryied ActiveX
var cmd = new ActiveXObject("WScript.Shell"); //создаем объект шел
myApp = cmd.Exec("C:\Users\User\Documents\star and co\stargan2-master\python src/test.py --source tst/me1.jpg --model train/mydata/mydata-256-9-005.ckpt");
while (myApp.Status === 0)
{
WScript.Sleep(100);//пауза что бы не перегружать проц
}
but it didn't work in case of I using chrome. IE Tabs didn't help also, it causes new problems with function definition and using. Also i tryied this:
var process = require('child_process');
process.exec('C:\Users\User\Documents\star and co\stargan2-master\python src/test.py --source tst/me1.jpg --model train/mydata/mydata-256-9-005.ckpt"',function (err,stdout,stderr) {
if (err) {
console.log("\n"+stderr);
} else {
console.log(stdout);
}
});
but it also didn't help because I don't have node.js => can't use require(as I understood). So will be glad to see some more variants, how to make idea possible, or how to fix this one's