- Notifications
You must be signed in to change notification settings - Fork0
OpenCV on wheels. This repository generates precompiled opencv-python and opencv-contrib-python packages and uploads them to PyPI.
License
Python3pkg/opencv-python
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Unofficial OpenCV packages for Python.
The aim of this repository is to provide means to package each newOpenCV release for themost used Python versions and platforms.
At the same time it allows anyone to build a custom version of OpenCVfor any Python version: just fork this repo and modify the build filesand scripts to fit your needs.
To install this package:
pip install opencv-python
To import the package:
import cv2
The project is structured like a normal Python package with a standardsetup.py
file. The build process is as follows (see for exampleappveyor.yml
file):
- Checkout repository and submodules
- OpenCV is included as submodule and the version is updatedmanually by maintainers when a new OpenCV release has been made
- Find OpenCV version from the sources
- Upgrade pip and install numpy for each Python version
- Build OpenCV
- tests are disabled, otherwise build time increases too much
- Copy each
.pyd/.so
file to cv2 folder of this project andgenerate wheel - Install the generated wheels for each Python version
- Test that the Python versions can import them
- Use twine to upload all wheels to PyPI
Currently thefind_version.py
file parses OpenCV version informationfrom the OpenCV sources. OpenCV depends on numpy, sosetup.py
checksthe numpy version also with the help of pip.
Thecv2.pyd
file for example on Windows is normally copied to site-packages.To avoid polluting the root folder the__init__.py
file in cv2 folderhandles the import logic correctly by importing the actual.pyd
moduleand replacing the imported cv2 package insys.modudes
with thecv2 module to retain backward compatibility.
Opencv-python package (scripts in this repository) is available underMIT license.
OpenCV itself is available under3-clause BSDLicense(LICENSE-3RD-PARTY.txt).
This software uses code ofFFmpeg licensed under theLGPLv2.1.
Currently thefind_version.py
script searches for the versioninformation from OpenCV sources and appends also a revision numberspecific to this repository to the version string.
A release is made and uploaded to PyPI when a new tag is pushed tomaster branch. These tags differentiate packages (this repo might havemodifications but OpenCV version stays same) and should be incrementedsequentially. In practice, release version numbers look like this:
cv_major.cv_minor.cv_revision.package_revision
e.g.3.1.0.0
Every commit to the master branch of this repo will be built. Possiblebuild artifacts use local version identifiers:
cv_major.cv_minor.cv_revision+git_hash_of_this_repo
e.g.3.1.0+14a8d39
These artifacts can't be and will not be uploaded to PyPI.
Linux wheels are built usingmanylinux. Thesewheels should work out of the box for most of the distros(which use GNU C standard library) out there since they are builtagainst an old version of glibc.
There's a build time limitation (AppVeyor open source builds may takemax 1 hour) which restricts the supported Python versions to two(note: the performance is better nowadays, for example py33 and py34could be added to appveyor.yml). As Python's 2.x releases are slowlyapproaching legacy state, 2.7.x releases will be the only supported Python 2versions on Windows. On Python 3 side, builds will be run only for the latest release.
However, if you wan't to get some other versions, just fork this repoand change the dependencies.
Manylinux wheels are built for all the Python versions which aresupported by the manylinux containers.
Currently built for Python 2.7, 3.4 and 3.5.
About
OpenCV on wheels. This repository generates precompiled opencv-python and opencv-contrib-python packages and uploads them to PyPI.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- Shell62.5%
- Python28.0%
- Batchfile8.2%
- CMake1.3%