From 6d76f91a067d101c88d20509f44bf522a5b0c688 Mon Sep 17 00:00:00 2001 From: Raaj Date: Fri, 29 Jun 2018 12:50:59 -0400 Subject: [PATCH] Allow Windows run on Debug Build for Python (#691) --- python/openpose/openpose.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/openpose/openpose.py b/python/openpose/openpose.py index 1ea92629..426b9e9b 100644 --- a/python/openpose/openpose.py +++ b/python/openpose/openpose.py @@ -23,7 +23,10 @@ class OpenPose(object): elif platform == "darwin": _libop= np.ctypeslib.load_library('_openpose', dir_path+'/_openpose.dylib') elif platform == "win32": - _libop= np.ctypeslib.load_library('_openpose', dir_path+'/Release/_openpose.dll') + try: + _libop= np.ctypeslib.load_library('_openpose', dir_path+'/Release/_openpose.dll') + except OSError as e: + _libop= np.ctypeslib.load_library('_openpose', dir_path+'/Debug/_openpose.dll') _libop.newOP.argtypes = [ ct.c_int, ct.c_char_p, ct.c_char_p, ct.c_char_p, ct.c_float, ct.c_float, ct.c_int, ct.c_float, ct.c_int, ct.c_bool, ct.c_char_p] _libop.newOP.restype = ct.c_void_p