You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have pre-built a custom OpenCV version (from 4.1.0) with optimizations specific to my device. I had to carefully make additional tweaks in CMake as well.
Using the instructions here, opencv-python simply re-downloads the source code, re-runs the build cycle (without my customizations/optimizations), and bundles the wheel from that.
I have the Python3 shared library (.so) built from my custom version, how do I wrap that with opencv-python?
The cv2 module works as is (installed by 'make install' from the custom OpenCV build). This is installed to /usr/local/lib/python3.6/dist-packages/cv2.
However, with the standard OpenCV python installation, static analysis often fails, and tools like PyCharm do not see the cv2 package. The only way to get it to work is to use opencv-python.
Is it possible to wrap my existing installation with opencv-python?
The text was updated successfully, but these errors were encountered:
In short, this is what this repository does to build the Linux version:
Carefully crafts a specific environment (see .travis.yml and multibuild)
Runs python setup.py bdist_wheel
customized scikit-build logic runs the cmake build and finally copies the resulting OpenCV binary to cv2 folder
Runs audits for the wheel files with auditwheel
This bundles all necessary dependencies to the wheel file and "repairs" the OpenCV .so file so that during import the bundled dependencies (shared libraries) are resolved correctly and the bundle is manylinux1 compatible (https://www.python.org/dev/peps/pep-0513/#the-manylinux1-policy)
The build logic is defined in the setup.py file. On Linux and macOS it's somewhat specific to this repository and does not work out of the box when running python setup.py bdist_wheel locally (that's why there is no source distribution yet in PyPI: #43).
If you built a custom binary separately without any setup.py file / package structure and wish to create a custom opencv-python version, then you should probably create a custom setup.py file and run python setup.py bdist_wheel with similar folder structure. The setup.py file should copy your custom binary to the cv2 folder.
The current setup.py file could also work for you if you remove all unnecessary code from it and alter it so that it contains the additional cmake flags. After that run python setup.py bdist_wheel. The actual "wrapper" code in this package is at https://github.com/skvark/opencv-python/blob/master/cv2/__init__.py.
I hope this answers at least partly to your questions.
I have pre-built a custom OpenCV version (from 4.1.0) with optimizations specific to my device. I had to carefully make additional tweaks in CMake as well.
Using the instructions here, opencv-python simply re-downloads the source code, re-runs the build cycle (without my customizations/optimizations), and bundles the wheel from that.
I have the Python3 shared library (.so) built from my custom version, how do I wrap that with opencv-python?
The cv2 module works as is (installed by 'make install' from the custom OpenCV build). This is installed to
/usr/local/lib/python3.6/dist-packages/cv2
.The .so file can be found in:
/usr/local/lib/python3.6/dist-packages/cv2/python-3.6/cv2.cpython-36m-x86_64-linux-gnu.so
However, with the standard OpenCV python installation, static analysis often fails, and tools like PyCharm do not see the cv2 package. The only way to get it to work is to use opencv-python.
Is it possible to wrap my existing installation with opencv-python?
The text was updated successfully, but these errors were encountered: