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
Copy file name to clipboardExpand all lines: .github/issue_template.md
+27
Original file line number
Diff line number
Diff line change
@@ -13,3 +13,30 @@ Write here what went wrong.
13
13
- architecture (e.g. x86)
14
14
- opencv-python version
15
15
16
+
##### Issue submission checklist
17
+
18
+
-[ ] This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
19
+
<!--
20
+
21
+
Use Q&A forums such as https://answers.opencv.org/questions/ and https://stackoverflow.com/ and other communities
22
+
to discuss problems. Tickets without real issue statements related to this build toolchain will be closed.
23
+
24
+
-->
25
+
-[ ] I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
26
+
<!--
27
+
28
+
If you have some OpenCV bug report which needs to fixed in the C++ code,
-[ ] The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
42
+
-[ ] I'm using the latest version of ``opencv-python``
Copy file name to clipboardExpand all lines: README.md
+38-24
Original file line number
Diff line number
Diff line change
@@ -73,11 +73,11 @@ A: It's easier for users to understand ``opencv-python`` than ``cv2`` and it mak
73
73
## Documentation for opencv-python
74
74
75
75
[](https://ci.appveyor.com/project/skvark/opencv-python)
76
-
[](https://travis-ci.org/skvark/opencv-python)
76
+
[](https://travis-ci.org/skvark/opencv-python)
77
77
78
78
The aim of this repository is to provide means to package each new [OpenCV release](https://github.com/opencv/opencv/releases) for the most used Python versions and platforms.
79
79
80
-
### Build process
80
+
### CI build process
81
81
82
82
The project is structured like a normal Python package with a standard ``setup.py`` file.
83
83
The build process for a single entry in the build matrices is as follows (see for example ``appveyor.yml`` file):
@@ -91,43 +91,57 @@ The build process for a single entry in the build matrices is as follows (see fo
91
91
- Contrib modules are also included as a submodule
92
92
93
93
2. Find OpenCV version from the sources
94
-
3. Install Python dependencies
95
94
96
-
-``setup.py`` installs the dependencies itself, so you need to run it in an environment
97
-
where you have the rights to install modules with Pip for the running Python
98
-
99
-
4. Build OpenCV
95
+
3. Build OpenCV
100
96
101
97
- tests are disabled, otherwise build time increases too much
102
98
- there are 4 build matrix entries for each build combination: with and without contrib modules, with and without GUI (headless)
103
99
- Linux builds run in manylinux Docker containers (CentOS 5)
100
+
- source distributions are separate entries in the build matrix
6. Linux and macOS wheels are transformed with auditwheel and delocate, correspondingly
104
+
5. Linux and macOS wheels are transformed with auditwheel and delocate, correspondingly
108
105
109
-
7. Install the generated wheel
110
-
8. Test that Python can import the library and run some sanity checks
111
-
9. Use twine to upload the generated wheel to PyPI (only in release builds)
106
+
6. Install the generated wheel
107
+
7. Test that Python can import the library and run some sanity checks
108
+
8. Use twine to upload the generated wheel to PyPI (only in release builds)
112
109
113
-
Steps 1--5 are handled by ``setup.py bdist_wheel``.
110
+
Steps 1--4 are handled by ``pip wheel``.
114
111
115
-
The build can be customized with environment variables.
116
-
In addition to any variables that OpenCV's build accepts, we recognize:
112
+
The build can be customized with environment variables. In addition to any variables that OpenCV's build accepts, we recognize:
117
113
114
+
-``CI_BUILD``. Set to ``1`` to emulate the CI environment build behaviour. Used only in CI builds to force certain build flags on in ``setup.py``. Do not use this unless you know what you are doing.
118
115
-``ENABLE_CONTRIB`` and ``ENABLE_HEADLESS``. Set to ``1`` to build the contrib and/or headless version
119
-
-``CMAKE_ARGS``. Additional arguments for OpenCV's CMake invocation. You can use this to make a custom build.
116
+
-``CMAKE_ARGS``. Additional arguments for OpenCV's CMake invocation. You can use this to make a custom build.
117
+
118
+
See the next section for more info about manual builds outside the CI environment.
120
119
121
120
### Manual builds
122
121
123
-
If some dependency is not enabled in the pre-built wheels, you can also run the `setup.py` locally to create a custom wheel.
122
+
If some dependency is not enabled in the pre-built wheels, you can also run the build locally to create a custom wheel.
124
123
125
124
1. Clone this repository: `git clone --recursive https://github.com/skvark/opencv-python.git`
126
-
2. Go to the root of the repository
127
-
3. Add custom Cmake flags if needed, for example: `export CMAKE_FLAGS="-DSOME_FLAG=ON -DSOME_OTHER_FLAG=OFF"`
128
-
4. Run ``python setup.py bdist_wheel``
129
-
- Optionally use the `manylinux` images as a build hosts if maximum portability is needed (and run `auditwheel` for the wheel after build)
130
-
5. You'll have the wheel file in the `dist` folder and you can do with that whatever you wish
125
+
2.``cd opencv-python``
126
+
3. Add custom Cmake flags if needed, for example: `export CMAKE_FLAGS="-DSOME_FLAG=ON -DSOME_OTHER_FLAG=OFF"` (in Windows you need to set environment variables differently depending on Command Line or PowerShell)
127
+
4. Select the version which you wish to build with `ENABLE_CONTRIB` and `ENABLE_HEADLESS`: i.e. `export ENABLE_CONTRIB=1` if you wish to build `opencv-contrib-python`
128
+
5. Run ``pip wheel . --verbose``. NOTE: make sure you have the latest ``pip``, the ``pip wheel`` command replaces the old ``python setup.py bdist_wheel`` command which does not support ``pyproject.toml``.
129
+
- Optional: on Linux use the `manylinux` images as a build hosts if maximum portability is needed and run `auditwheel` for the wheel after build
130
+
- Optional: on macOS use ``delocate`` (same as ``auditwheel`` but for macOS)
131
+
6. You'll have the wheel file in the `dist` folder and you can do with that whatever you wish
132
+
133
+
#### Source distributions
134
+
135
+
Since OpenCV version 4.3.0, also source distributions are provided in PyPI. This means that if your system is not compatible with any of the wheels in PyPI, ``pip`` will attempt to build OpenCV from sources.
136
+
137
+
You can also force ``pip`` to build the wheels from the source distribution for example with:
If you need contrib modules or headless version, just change the package name (step 4 in the previous section is not needed). However, any additional CMake flags can be provided via environment variables as described in step 3 of the manual build section. If none are provided, OpenCV's CMake scripts will attempt to find and enable any suitable dependencies and enable them. Headless distributions have hard coded CMake flags which disable all possible GUI dependencies.
143
+
144
+
Please note that build tools and ``numpy`` are required for the build to succeed. On slow systems such as Raspberry Pi the full build may take several hours. On a 8-core Ryzen 7 3700X the build takes about 6 minutes.
131
145
132
146
### Licensing
133
147
@@ -147,7 +161,7 @@ The packages include also other binaries. Full list of licenses can be found fro
147
161
148
162
### Versioning
149
163
150
-
``find_version.py`` script searches for the version information from OpenCV sources and appends also a revision number specific to this repository to the version string.
164
+
``find_version.py`` script searches for the version information from OpenCV sources and appends also a revision number specific to this repository to the version string. It saves the version information to ``version.py`` file under ``cv2`` in addition to some other flags.
151
165
152
166
### Releases
153
167
@@ -177,7 +191,7 @@ Python 3.x releases are provided for officially supported versions (not in EOL).
177
191
178
192
Currently, builds for following Python versions are provided:
179
193
180
-
- 3.5
194
+
- 3.5 (EOL in 2020-09-13, builds for 3.5 will not be provided after this)
0 commit comments