I want to visualize 3D face data using OpenCV or dlib in Blender, or combine it with machine learning in cooperation with pytorch.
In the initial state, pip is not included, so ensure pip https://docs.python.org/ja/3/library/ensurepip.html
Install with.
$ /path/to/blender/2.82/python/bin/python3.7m -m ensurepip
After this, you can use it with -m pip
.
$ /path/to/blender/2.82/python/bin/python3.7m -m pip
Some modules, such as dlib, need to be compiled from source code during pip.
Python 3.7 development environment (header file) is required. Blender does not include Python.h etc.
For Ubuntu 18.04, put python3.7-dev with apt,
$ env CXXFLAGS="-I/usr/include/python3.7m" /path/to/blender/2.82/python/bin/python3.7m -m pip install dlib
If you add a header path with CXXFLAGS, for the time being, pyconfig.h is different, so I'm a little worried.
I think it is safe to drop the python source code and install the header related items in / path / to / blender / 2.82 / python / include / python3.7m
on the blender side.
You should now be able to install modules that require C / C ++ compilation!
You should be able to import it in the Blender Python console!
TODO
blender --background --python-console
.Recommended Posts