Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
"""
OpenCV Python bindings

This module provides Python bindings for OpenCV.

Important notes for multiprocessing:
- OpenCV is not fork-safe. Using cv2 functions after fork() can cause
"corrupted double-linked list" errors and memory corruption.
- If you use multiprocessing with fork (the default on Linux/macOS),
either:
1. Use spawn mode: multiprocessing.set_start_method('spawn')
2. Call cv2.setNumThreads(0) in each worker before using cv2
- See: https://github.com/opencv/opencv-python/issues/1166
"""

import os
import sys
import warnings

PYTHON_EXTENSIONS_PATHS = [
LOADER_DIR
] + PYTHON_EXTENSIONS_PATHS
Expand All @@ -21,4 +40,4 @@
if sys.platform.startswith("linux") and ci_and_not_headless:
os.environ["QT_QPA_FONTDIR"] = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "qt", "fonts"
)
)
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def main():

install_requires = [
'numpy<2.0; python_version<"3.9"',
'numpy>=2; python_version>="3.9"',
'numpy>=2.0.2; python_version>="3.9" and python_version<"3.13"',
'numpy>=2.1.3; python_version>="3.13" and python_version<"3.14"',
'numpy>=2.3.0; python_version>="3.14"',
]

python_version = cmaker.CMaker.get_python_version()
Expand Down
Loading