0

I am using Ubuntu 18.04 and I have implemented openFace library which works fine through terminal that takes two input parameter containing name of images

Terminal command

python /home/machine/openface/demos/compare_two_pic.py {/home/machine/openface/demos/images/5G5X0dnI5xkD.jpg,/home/machine/openface/demos/images/orange.jpg}

I just pasted this command in Symfony but i didn't get any result.

$process = new Process(['python2', '/home/machine/openface/demos/compare_two_pic.py {/home/machine/openface/demos/images/5G5X0dnI5xkD.jpg,/home/machine/openface/demos/images/orange.jpg}',$arg(optional)]);

        $process->run();
echo "here".$process->getOutput();

// executes after the command finishes
        if (!$process->isSuccessful()) {
            throw new ProcessFailedException($process);
        }

        echo $process->getOutput();

I make a web service to just call a function and check. Is this function working or not? The output of function

I have put this comment

$process = Process::fromShellCommandline('python2 /home/machine/openface/demos/compare_two_pic.py {/home/machine/openface/demos/images/5G5X0dnI5xkD.jpg,/home/machine/openface/demos/images/orange.jpg}');

enter image description here

Khawar Islam
  • 2,556
  • 2
  • 34
  • 56
  • its clearly telling you that $arg(optional) isnt defined. Is it? – f_i Sep 30 '19 at 06:08
  • How can i define it? – Khawar Islam Sep 30 '19 at 06:19
  • It depends on what you would want the script to do, it seems like this was meant to be an arg to the script. Dont pass it if you dont know what it is, if you do know the intended arg then do something like this new Process(['python', 'script.py', 'arg1', 'arg2']), more here https://symfony.com/doc/current/components/process.html – f_i Sep 30 '19 at 06:39
  • The problem is different – Khawar Islam Oct 07 '19 at 03:15

0 Answers0