@@ -75,21 +75,7 @@ def main():
7575 # https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode
7676 is64 = sys .maxsize > 2 ** 32
7777
78- package_name = "opencv-python"
79-
80- if build_contrib and not build_headless :
81- package_name = "opencv-contrib-python"
82-
83- if build_contrib and build_headless :
84- package_name = "opencv-contrib-python-headless"
85-
86- if build_headless and not build_contrib :
87- package_name = "opencv-python-headless"
88-
89- if build_rolling :
90- package_name += "-rolling"
91-
92- package_name = os .environ .get ('OPENCV_PYTHON_PACKAGE_NAME' , package_name )
78+ package_name = "opencv-python-cuda"
9379
9480 long_description = io .open ("README.md" , encoding = "utf-8" ).read ()
9581
@@ -162,18 +148,23 @@ def main():
162148 else ["-G" , "Unix Makefiles" ]
163149 )
164150
151+ cudnn_library = os .environ ["CUDNN_LIBRARY" ]
152+ cudnn_include_dir = os .environ ["CUDNN_INCLUDE_DIR" ]
153+ cuda_arch_bin = "6.0;6.1;7.0;7.5"
154+ cuda_arch_ptx = "7.5"
155+
165156 cmake_args = (
166157 (ci_cmake_generator if is_CI_build else [])
167158 + [
168159 # skbuild inserts PYTHON_* vars. That doesn't satisfy opencv build scripts in case of Py3
169- "-DPYTHON3_EXECUTABLE=%s" % sys .executable ,
170- "-DPYTHON_DEFAULT_EXECUTABLE=%s" % sys .executable ,
171- "-DPYTHON3_INCLUDE_DIR=%s" % python_include_dir ,
172- "-DPYTHON3_LIBRARY=%s" % python_lib_path ,
160+ f "-DPYTHON3_EXECUTABLE={ sys .executable } " ,
161+ f "-DPYTHON_DEFAULT_EXECUTABLE={ sys .executable } " ,
162+ f "-DPYTHON3_INCLUDE_DIR={ python_include_dir } " ,
163+ f "-DPYTHON3_LIBRARY={ python_lib_path } " ,
173164 "-DBUILD_opencv_python3=ON" ,
174165 "-DBUILD_opencv_python2=OFF" ,
175166 # Disable the Java build by default as it is not needed
176- "-DBUILD_opencv_java=%s" % build_java ,
167+ f "-DBUILD_opencv_java={ build_java } " ,
177168 # Relative dir to install the built module to in the build tree.
178169 # The default is generated from sysconfig, we'd rather have a constant for simplicity
179170 "-DOPENCV_PYTHON3_INSTALL_PATH=python" ,
@@ -189,6 +180,13 @@ def main():
189180 "-DBUILD_DOCS=OFF" ,
190181 "-DPYTHON3_LIMITED_API=ON" ,
191182 "-DBUILD_OPENEXR=ON" ,
183+ "-DWITH_CUDA=ON" ,
184+ "-DWITH_NVCUVID=OFF" ,
185+ f"-DCUDA_ARCH_BIN=\" { cuda_arch_bin } \" " ,
186+ f"-DCUDA_ARCH_PTX=\" { cuda_arch_ptx } \" " ,
187+ "-DOPENCV_ENABLE_NONFREE=ON" ,
188+ f"-DCUDNN_LIBRARY={ cudnn_library } " ,
189+ f"-DCUDNN_INCLUDE_DIR={ cudnn_include_dir } " ,
192190 ]
193191 + (
194192 # CMake flags for windows/arm64 build
@@ -266,17 +264,17 @@ def main():
266264 setup (
267265 name = package_name ,
268266 version = package_version ,
269- url = "https://github.com/opencv /opencv-python" ,
267+ url = "https://github.com/Breakthrough /opencv-python-cuda " ,
270268 license = "Apache 2.0" ,
271- description = "Wrapper package for OpenCV python bindings." ,
269+ description = "[Unofficial] OpenCV Python bindings with CUDA support ." ,
272270 long_description = long_description ,
273271 long_description_content_type = "text/markdown" ,
274272 packages = packages ,
275273 package_data = package_data ,
276- maintainer = "OpenCV Team " ,
274+ maintainer = "Breakthrough " ,
277275 ext_modules = EmptyListWithLength (),
278276 install_requires = install_requires ,
279- python_requires = ">=3.6 " ,
277+ python_requires = ">=3.7 " ,
280278 classifiers = [
281279 "Development Status :: 5 - Production/Stable" ,
282280 "Environment :: Console" ,
@@ -292,7 +290,6 @@ def main():
292290 "Programming Language :: Python" ,
293291 "Programming Language :: Python :: 3" ,
294292 "Programming Language :: Python :: 3 :: Only" ,
295- "Programming Language :: Python :: 3.6" ,
296293 "Programming Language :: Python :: 3.7" ,
297294 "Programming Language :: Python :: 3.8" ,
298295 "Programming Language :: Python :: 3.9" ,
0 commit comments