Check Lua subprocess before trying to interact with it.
This commit is contained in:
parent
7bd9405a74
commit
1ab061d23d
|
@ -45,13 +45,14 @@ class TorchWrap:
|
||||||
if self.p.poll() is None:
|
if self.p.poll() is None:
|
||||||
self.p.kill()
|
self.p.kill()
|
||||||
atexit.register(exitHandler)
|
atexit.register(exitHandler)
|
||||||
time.sleep(0.5)
|
|
||||||
|
def forwardPath(self, imgPath):
|
||||||
rc = self.p.poll()
|
rc = self.p.poll()
|
||||||
if rc is not None and rc != 0:
|
if rc is not None and rc != 0:
|
||||||
raise Exception("""
|
raise Exception("""
|
||||||
|
|
||||||
|
|
||||||
OpenFace: Unable to initialize the `openface_server.lua` subprocess.
|
OpenFace: `openface_server.lua` subprocess has died.
|
||||||
Is the Torch command `th` on your PATH? Check with `which th`.
|
Is the Torch command `th` on your PATH? Check with `which th`.
|
||||||
|
|
||||||
Diagnostic information:
|
Diagnostic information:
|
||||||
|
@ -67,7 +68,6 @@ stdout: {}
|
||||||
stderr: {}
|
stderr: {}
|
||||||
""".format(cmd, self.p.stdout.read(), self.p.stderr.read()))
|
""".format(cmd, self.p.stdout.read(), self.p.stderr.read()))
|
||||||
|
|
||||||
def forwardPath(self, imgPath):
|
|
||||||
self.p.stdin.write(imgPath + "\n")
|
self.p.stdin.write(imgPath + "\n")
|
||||||
output = self.p.stdout.readline()
|
output = self.p.stdout.readline()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue