boss不知道从哪淘换来的pose_iter_440000.caffemodel和basicModel_f_lbs_10_207_0_v1.0.0.pkl让我搞2d图像3d蒙皮,人都麻了,最后还是从头过了一下openpose和smplx。这里记录一下
这个是用来得到骨架坐标的,可以理解为(x,y,置信度)
不过boss那猴年马月的版本已经不适配数据格式了,现在与下游衔接的版本格式如下
{
"version":1.3,
"people":[{
"person_id":[-1],
"pose_keypoints_2d":
"face_keypoints_2d":
"hand_left_keypoints_2d":
"hand_right_keypoints_2d":
省略了一些暂时没用的东西
cd openpose/
git submodule update --init --recursive --remote
mkdir build/
cd build/
cmake-gui ..
我卡在了cmake报错
-- Could NOT find GFlags (missing: GFLAGS_INCLUDE_DIR GFLAGS_LIBRARY)
-- Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY)
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindProtobuf.cmake:543 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:429 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/pengpeng/wyh/openpose/build/CMakeFiles/CMakeOutput.log".
See also "/home/pengpeng/wyh/openpose/build/CMakeFiles/CMakeError.log".
看到一些教程1,教程2元旦就懒得继续了,不过Win10上有用简易版
直接走bat就可以,不过有可能下载不了模型,那就直接在这个博文下载,然后移到对应文件夹就好
bin\OpenPoseDemo.exe --video examples\media\video.avi --face --hand --write_json output_json_folder/
输入当然可以换成图片,不如说1650小破机子连face和hand都不能做,更别提视频了
注意这里没有做face和hand的话,后面smplx也要相应去掉,否则张量维度出问题。
另外骨架和原图的可视化不能保存,只能保存前面提到的坐标json,不过xxw23大佬推荐我用某方法,之后看一下
另外一张图里有多人的坐标的话好像smplx也会乱,就像游戏里建模扯面筋了一样,还得多试试
说真的我一开始被smpl搞得晕头转向,真的没有好好把这个讲清楚怎么做的都是那个破basicModel什么pkl的直接或者改一下python3就用,感觉就是个固定的骨架坐标啊,pose等参数就是固定/随机值,很迷
好在看到xxw23大佬的博文明白点该怎么用到任意图像上了
大体上看大佬的教程就好,我再补充点我的想法
Installing collected packages: pyzmq, psbody-mesh
Running setup.py develop for psbody-mesh
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [30 lines of output]
[VERSION] read version is 0.4
running develop
E:\Anaconda3\envs\gait\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
E:\Anaconda3\envs\gait\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
creating psbody_mesh.egg-info
writing psbody_mesh.egg-info\PKG-INFO
writing dependency_links to psbody_mesh.egg-info\dependency_links.txt
writing namespace_packages to psbody_mesh.egg-info\namespace_packages.txt
writing requirements to psbody_mesh.egg-info\requires.txt
writing top-level names to psbody_mesh.egg-info\top_level.txt
writing manifest file 'psbody_mesh.egg-info\SOURCES.txt'
reading manifest file 'psbody_mesh.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'psbody_mesh.egg-info\SOURCES.txt'
running build_ext
[CGAL] deflating cgal from "mesh\thirdparty\CGAL-4.7.tar.gz" to "D:\Doctor\smplify-x\src\human-body-prior\mesh\build\temp.win-amd64-3.9"
building 'psbody.mesh.aabb_normals' extension
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\mesh
creating build\temp.win-amd64-3.9\Release\mesh\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DNDEBUG=1 -DCGAL_NDEBUG=1 -DMESH_CGAL_AVOID_COMPILED_VERSION=1 -DCGAL_HAS_NO_THREADS=1 -DCGAL_NO_AUTOLINK_CGAL=1 -Imesh/src -IE:\Anaconda3\envs\gait\lib\site-packages\numpy\core\include -ID:\Doctor\smplify-x\src\human-body-prior\mesh\build\temp.win-amd64-3.9\Release\CGAL-4.7\include -IE:\Anaconda3\envs\gait\include -IE:\Anaconda3\envs\gait\include -IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE -IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt -IC:\Program Files (x86)\Windows Kits\8.1\include\shared -IC:\Program Files (x86)\Windows Kits\8.1\include\um -IC:\Program Files (x86)\Windows Kits\8.1\include\winrt /EHsc /Tpmesh/src/aabb_normals.cpp /Fobuild\temp.win-amd64-3.9\Release\mesh/src/aabb_normals.obj -O3
cl : Command line warning D9002 : ignoring unknown option '-O3'
aabb_normals.cpp
e:\anaconda3\envs\gait\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
d:\doctor\smplify-x\src\human-body-prior\mesh\mesh\src\AABB_n_tree.h(9): fatal error C1083: Cannot open include file: 'CGAL/AABB_tree.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [30 lines of output]
[VERSION] read version is 0.4
running develop
E:\Anaconda3\envs\gait\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
E:\Anaconda3\envs\gait\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
creating psbody_mesh.egg-info
writing psbody_mesh.egg-info\PKG-INFO
writing dependency_links to psbody_mesh.egg-info\dependency_links.txt
writing namespace_packages to psbody_mesh.egg-info\namespace_packages.txt
writing requirements to psbody_mesh.egg-info\requires.txt
writing top-level names to psbody_mesh.egg-info\top_level.txt
writing manifest file 'psbody_mesh.egg-info\SOURCES.txt'
reading manifest file 'psbody_mesh.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'psbody_mesh.egg-info\SOURCES.txt'
running build_ext
[CGAL] deflating cgal from "mesh\thirdparty\CGAL-4.7.tar.gz" to "D:\Doctor\smplify-x\src\human-body-prior\mesh\build\temp.win-amd64-3.9"
building 'psbody.mesh.aabb_normals' extension
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\mesh
creating build\temp.win-amd64-3.9\Release\mesh\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DNDEBUG=1 -DCGAL_NDEBUG=1 -DMESH_CGAL_AVOID_COMPILED_VERSION=1 -DCGAL_HAS_NO_THREADS=1 -DCGAL_NO_AUTOLINK_CGAL=1 -Imesh/src -IE:\Anaconda3\envs\gait\lib\site-packages\numpy\core\include -ID:\Doctor\smplify-x\src\human-body-prior\mesh\build\temp.win-amd64-3.9\Release\CGAL-4.7\include -IE:\Anaconda3\envs\gait\include -IE:\Anaconda3\envs\gait\include -IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE -IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt -IC:\Program Files (x86)\Windows Kits\8.1\include\shared -IC:\Program Files (x86)\Windows Kits\8.1\include\um -IC:\Program Files (x86)\Windows Kits\8.1\include\winrt /EHsc /Tpmesh/src/aabb_normals.cpp /Fobuild\temp.win-amd64-3.9\Release\mesh/src/aabb_normals.obj -O3
cl : Command line warning D9002 : ignoring unknown option '-O3'
aabb_normals.cpp
e:\anaconda3\envs\gait\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
d:\doctor\smplify-x\src\human-body-prior\mesh\mesh\src\AABB_n_tree.h(9): fatal error C1083: Cannot open include file: 'CGAL/AABB_tree.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
GPT4让我去安装CGAL和Boost,没有成功
另外也找到一些其他教程1,教程2,暂时也没有成功
Installing collected packages: psbody-mesh
Running setup.py develop for psbody-mesh
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [81 lines of output]
[VERSION] read version is 0.4
/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/setuptools/dist.py:945: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
!!
********************************************************************************
Please replace its usage with implicit namespaces (PEP 420).
See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
********************************************************************************
!!
ep.load()(self, ep.name, value)
running develop
/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!!
easy_install.initialize_options(self)
/media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/setup.py:145: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
return _install.initialize_options(self)
running egg_info
writing psbody_mesh.egg-info/PKG-INFO
writing dependency_links to psbody_mesh.egg-info/dependency_links.txt
writing namespace_packages to psbody_mesh.egg-info/namespace_packages.txt
writing requirements to psbody_mesh.egg-info/requires.txt
writing top-level names to psbody_mesh.egg-info/top_level.txt
reading manifest file 'psbody_mesh.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'psbody_mesh.egg-info/SOURCES.txt'
running build_ext
[CGAL] deflating cgal from "mesh/thirdparty/CGAL-4.7.tar.gz" to "/media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39"
building 'psbody.mesh.aabb_normals' extension
gcc -pthread -B /home/pengpeng/.conda/envs/wyh/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/pengpeng/.conda/envs/wyh/include -I/home/pengpeng/.conda/envs/wyh/include -fPIC -O2 -isystem /home/pengpeng/.conda/envs/wyh/include -fPIC -DNDEBUG=1 -DCGAL_NDEBUG=1 -DMESH_CGAL_AVOID_COMPILED_VERSION=1 -DCGAL_HAS_NO_THREADS=1 -DCGAL_NO_AUTOLINK_CGAL=1 -Imesh/src -I/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include -I/media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include -I/home/pengpeng/.conda/envs/wyh/include/python3.9 -c mesh/src/aabb_normals.cpp -o build/temp.linux-x86_64-cpython-39/mesh/src/aabb_normals.o -O3 -fopenmp
In file included from /home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929:0,
from /home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5,
from mesh/src/aabb_normals.cpp:4:
/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^~~~~~~
In file included from /media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/Profile_counter.h:53:0,
from /media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_node.h:24,
from /media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h:24,
from /media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/AABB_tree.h:26,
from mesh/src/AABB_n_tree.h:9,
from mesh/src/aabb_normals.cpp:10:
/media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/config.h:85:10: fatal error: boost/config.hpp: 没有那个文件或目录
#include
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [81 lines of output]
[VERSION] read version is 0.4
/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/setuptools/dist.py:945: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
!!
********************************************************************************
Please replace its usage with implicit namespaces (PEP 420).
See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
********************************************************************************
!!
ep.load()(self, ep.name, value)
running develop
/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!!
easy_install.initialize_options(self)
/media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/setup.py:145: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
return _install.initialize_options(self)
running egg_info
writing psbody_mesh.egg-info/PKG-INFO
writing dependency_links to psbody_mesh.egg-info/dependency_links.txt
writing namespace_packages to psbody_mesh.egg-info/namespace_packages.txt
writing requirements to psbody_mesh.egg-info/requires.txt
writing top-level names to psbody_mesh.egg-info/top_level.txt
reading manifest file 'psbody_mesh.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'psbody_mesh.egg-info/SOURCES.txt'
running build_ext
[CGAL] deflating cgal from "mesh/thirdparty/CGAL-4.7.tar.gz" to "/media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39"
building 'psbody.mesh.aabb_normals' extension
gcc -pthread -B /home/pengpeng/.conda/envs/wyh/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/pengpeng/.conda/envs/wyh/include -I/home/pengpeng/.conda/envs/wyh/include -fPIC -O2 -isystem /home/pengpeng/.conda/envs/wyh/include -fPIC -DNDEBUG=1 -DCGAL_NDEBUG=1 -DMESH_CGAL_AVOID_COMPILED_VERSION=1 -DCGAL_HAS_NO_THREADS=1 -DCGAL_NO_AUTOLINK_CGAL=1 -Imesh/src -I/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include -I/media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include -I/home/pengpeng/.conda/envs/wyh/include/python3.9 -c mesh/src/aabb_normals.cpp -o build/temp.linux-x86_64-cpython-39/mesh/src/aabb_normals.o -O3 -fopenmp
In file included from /home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929:0,
from /home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5,
from mesh/src/aabb_normals.cpp:4:
/home/pengpeng/.conda/envs/wyh/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^~~~~~~
In file included from /media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/Profile_counter.h:53:0,
from /media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_node.h:24,
from /media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h:24,
from /media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/AABB_tree.h:26,
from mesh/src/AABB_n_tree.h:9,
from mesh/src/aabb_normals.cpp:10:
/media/pengpeng/新加卷/pose_smpl/smplify-x/src/human-body-prior/mesh/build/temp.linux-x86_64-cpython-39/CGAL-4.7/include/CGAL/config.h:85:10: fatal error: boost/config.hpp: 没有那个文件或目录
#include
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
其实本质上也是psbody-mesh这个子包有问题,也是要Boost库,不过Ubuntu上确实方便多了
sudo apt-get update
sudo apt-get install libboost-all-dev