I’m building OpenCV 4.5.1 from source with the following configuration:
-D WITH_CUDA=ON \ -D WITH_CUDNN=ON \ -D WITH_CUBLAS=1 \ -D OPENCV_DNN_CUDA=ON \ -D ENABLE_FAST_MATH=1 \ -D CUDA_FAST_MATH=1 \ -D CUDA_ARCH_BIN=7.0 \ -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11.0 \ -D OPENCV_EXTRA_MODULES_PATH=/opencv_compile/opencv_contrib-4.5.1/modules \ -D OPENCV_GENERATE_PKGCONFIG=YES \ -D BUILD_opencv_python3=ON \ -D PYTHON3_EXECUTABLE=/usr/bin/python3 \ -D PYTHON3_NUMPY_INCLUDE_DIR=/usr/lib64/python3.6/site-packages/numpy/core/include \ -D PYTHON3_PACKAGES_PATH=/opt/opencv_python \ -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/opt/opencv .. && \
I’m building this in a Docker image which takes approx. 1hr 45mins and creates a file 8Gb in size.
I need to ship this image to another user.
Is there anyway that the build can be slimmed down?