diff --git a/examples/tutorial_api_python/1_body_from_image.py b/examples/tutorial_api_python/1_body_from_image.py index 544e0089..0619d5fb 100644 --- a/examples/tutorial_api_python/1_body_from_image.py +++ b/examples/tutorial_api_python/1_body_from_image.py @@ -14,13 +14,13 @@ try: # Change these variables to point to the correct folder (Release/x64 etc.) sys.path.append(dir_path + '/../../python/openpose/Release'); os.environ['PATH'] = os.environ['PATH'] + ';' + dir_path + '/../../x64/Release;' + dir_path + '/../../bin;' - import _openpose as op + import openpose_python as op else: # Change these variables to point to the correct folder (Release/x64 etc.) sys.path.append('../../python'); # If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it. # sys.path.append('/usr/local/python') - from openpose import openpose as op + from openpose import openpose_python as op except: raise Exception('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') diff --git a/examples/tutorial_api_python/2_whole_body_from_image.py b/examples/tutorial_api_python/2_whole_body_from_image.py index 40ce9d15..e7cb5430 100644 --- a/examples/tutorial_api_python/2_whole_body_from_image.py +++ b/examples/tutorial_api_python/2_whole_body_from_image.py @@ -14,13 +14,13 @@ try: # Change these variables to point to the correct folder (Release/x64 etc.) sys.path.append(dir_path + '/../../python/openpose/Release'); os.environ['PATH'] = os.environ['PATH'] + ';' + dir_path + '/../../x64/Release;' + dir_path + '/../../bin;' - import _openpose as op + import openpose_python as op else: # Change these variables to point to the correct folder (Release/x64 etc.) sys.path.append('../../python'); # If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it. # sys.path.append('/usr/local/python') - from openpose import openpose as op + from openpose import openpose_python as op except: raise Exception('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') diff --git a/examples/tutorial_api_python/3_heatmaps_from_image.py b/examples/tutorial_api_python/3_heatmaps_from_image.py index 675f564a..6bb54f92 100644 --- a/examples/tutorial_api_python/3_heatmaps_from_image.py +++ b/examples/tutorial_api_python/3_heatmaps_from_image.py @@ -15,13 +15,13 @@ try: # Change these variables to point to the correct folder (Release/x64 etc.) sys.path.append(dir_path + '/../../python/openpose/Release'); os.environ['PATH'] = os.environ['PATH'] + ';' + dir_path + '/../../x64/Release;' + dir_path + '/../../bin;' - import _openpose as op + import openpose_python as op else: # Change these variables to point to the correct folder (Release/x64 etc.) sys.path.append('../../python'); # If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it. # sys.path.append('/usr/local/python') - from openpose import openpose as op + from openpose import openpose_python as op except: raise Exception('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') diff --git a/examples/tutorial_api_python/openpose_python.py b/examples/tutorial_api_python/openpose_python.py index 939a846e..34149559 100644 --- a/examples/tutorial_api_python/openpose_python.py +++ b/examples/tutorial_api_python/openpose_python.py @@ -14,13 +14,13 @@ try: # Change these variables to point to the correct folder (Release/x64 etc.) sys.path.append(dir_path + '/../../python/openpose/Release'); os.environ['PATH'] = os.environ['PATH'] + ';' + dir_path + '/../../x64/Release;' + dir_path + '/../../bin;' - import _openpose as op + import openpose_python as op else: # Change these variables to point to the correct folder (Release/x64 etc.) sys.path.append('../../python'); # If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it. # sys.path.append('/usr/local/python') - from openpose import openpose as op + from openpose import openpose_python as op except: raise Exception('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') diff --git a/python/openpose/CMakeLists.txt b/python/openpose/CMakeLists.txt index ddafec7e..3746096d 100644 --- a/python/openpose/CMakeLists.txt +++ b/python/openpose/CMakeLists.txt @@ -1,9 +1,9 @@ set(PYTHON_FILES openpose.py __init__.py - _openpose.cpp) + openpose_python.cpp) -pybind11_add_module(openpose_python _openpose.cpp) +pybind11_add_module(openpose_python openpose_python.cpp) target_link_libraries(openpose_python PRIVATE pybind11::module openpose ${OpenPose_3rdparty_libraries}) SET_TARGET_PROPERTIES(openpose_python PROPERTIES PREFIX "") diff --git a/python/openpose/__init__.py b/python/openpose/__init__.py index 1ed8198a..68b84d92 100644 --- a/python/openpose/__init__.py +++ b/python/openpose/__init__.py @@ -1 +1 @@ -from . import _openpose as openpose +from . import openpose_python as openpose_python diff --git a/python/openpose/_openpose.cpp b/python/openpose/openpose_python.cpp similarity index 97% rename from python/openpose/_openpose.cpp rename to python/openpose/openpose_python.cpp index ee3af76f..13205674 100644 --- a/python/openpose/_openpose.cpp +++ b/python/openpose/openpose_python.cpp @@ -168,7 +168,7 @@ public: } }; -PYBIND11_MODULE(_openpose, m) { +PYBIND11_MODULE(openpose_python, m) { // Functions for Init Params m.def("init_int", &init_int, "Init Function");