Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

OpenCV on wheels. This repository generates precompiled opencv-python and opencv-contrib-python packages and uploads them to PyPI.

License

NotificationsYou must be signed in to change notification settings

Python3pkg/opencv-python

 
 

Repository files navigation

AppVeyor CI test status (Windows)Travis CI test status (Linux and OS X)

OpenCV on wheels

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.

Installation and Usage

To install this package:

pip install opencv-python

To import the package:

import cv2

OpenCV documentation

Build process

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):

  1. Checkout repository and submodules
    • OpenCV is included as submodule and the version is updatedmanually by maintainers when a new OpenCV release has been made
  2. Find OpenCV version from the sources
  3. Upgrade pip and install numpy for each Python version
  4. Build OpenCV
    • tests are disabled, otherwise build time increases too much
  5. Copy each.pyd/.so file to cv2 folder of this project andgenerate wheel
  6. Install the generated wheels for each Python version
  7. Test that the Python versions can import them
  8. 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.

Licensing

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.

Versioning

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.

Releases

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

Development builds

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.

Manylinux wheels

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.

Supported Python versions

Windows:

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.

Linux

Manylinux wheels are built for all the Python versions which aresupported by the manylinux containers.

OS X

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

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell62.5%
  • Python28.0%
  • Batchfile8.2%
  • CMake1.3%

[8]ページ先頭

©2009-2025 Movatter.jp