Skip to content

Commit 9481238

Browse files
committed
use only one README, convert README to markdown, update licenses, update setup.py
1 parent b1a7fcc commit 9481238

File tree

6 files changed

+197
-388
lines changed

6 files changed

+197
-388
lines changed

LICENSE-3RD-PARTY.txt

+37-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ copy or use the software.
1010
For Open Source Computer Vision Library
1111
(3-clause BSD License)
1212

13-
Copyright (C) 2000-2016, Intel Corporation, all rights reserved.
13+
Copyright (C) 2000-2018, Intel Corporation, all rights reserved.
1414
Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
1515
Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved.
1616
Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
@@ -43,9 +43,44 @@ and on any theory of liability, whether in contract, strict liability,
4343
or tort (including negligence or otherwise) arising in any way out of
4444
the use of this software, even if advised of the possibility of such damage.
4545

46+
------------------------------------------------------------------------------
47+
libvpx is redistributed within opencv-python Linux packages.
48+
This license applies to libvpx binary in the directory cv2/.
49+
50+
Copyright (c) 2010, The WebM Project authors. All rights reserved.
51+
52+
Redistribution and use in source and binary forms, with or without
53+
modification, are permitted provided that the following conditions are
54+
met:
55+
56+
* Redistributions of source code must retain the above copyright
57+
notice, this list of conditions and the following disclaimer.
58+
59+
* Redistributions in binary form must reproduce the above copyright
60+
notice, this list of conditions and the following disclaimer in
61+
the documentation and/or other materials provided with the
62+
distribution.
63+
64+
* Neither the name of Google, nor the WebM Project, nor the names
65+
of its contributors may be used to endorse or promote products
66+
derived from this software without specific prior written
67+
permission.
68+
69+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
70+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
71+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
72+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
73+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
74+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
75+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
76+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
77+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
78+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
79+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
80+
4681
------------------------------------------------------------------------------
4782
FFmpeg is redistributed within opencv-python Windows packages.
48-
Qt 4.8.7 is redistributed within opencv-python Linux and macOS packages
83+
Qt 4.8.7 is redistributed within opencv-python Linux and macOS packages.
4984
This license applies to FFmpeg and Qt binaries in the directory cv2/.
5085

5186
GNU LESSER GENERAL PUBLIC LICENSE

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016-2017 Olli-Pekka Heinisuo and contributors
3+
Copyright (c) 2016-2018 Olli-Pekka Heinisuo and contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
## OpenCV on Wheels
2+
3+
**Unofficial** pre-built OpenCV packages for Python.
4+
5+
### Installation and Usage
6+
7+
1. If you have previous/other manually installed version of OpenCV installed (e.g. cv2 module in the root of Python's site-packages), remove it before installation to avoid conflicts.
8+
2. Select the correct package for your environment:
9+
10+
There are four different packages and you should **select only one of them**. Do not install multiple different packages in the same enviroment.
11+
12+
**a.** Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution)
13+
14+
- run ``pip install opencv-python`` if you need only main modules
15+
- run ``pip install opencv-contrib-python`` if you need both main and contrib modules (check extra modules listing from [OpenCV documentation](https://docs.opencv.org/master/))
16+
17+
**b.** Packages for server (headless) environments
18+
19+
These packages do not contain any GUI functionality. They are smaller and suitable for more restricted environments.
20+
21+
- run ``pip install opencv-python-headless`` if you need only main modules
22+
- run ``pip install opencv-contrib-python-headless`` if you need both main and contrib modules (check extra modules listing from [OpenCV documentation](https://docs.opencv.org/master/))
23+
24+
3. Import the package:
25+
26+
``import cv2``
27+
28+
All packages contain haarcascade files. ``cv2.data.haarcascades`` can be used as a shortcut to the data folder. For example:
29+
30+
``cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")``
31+
32+
5. Read [OpenCV documentation](https://docs.opencv.org/master/)
33+
34+
6. Before opening a new issue, read the FAQ below and have a look at the other issues which are already open.
35+
36+
Frequently Asked Questions
37+
--------------------------
38+
39+
**Q: Do I need to install also OpenCV separately?**
40+
41+
A: No, the packages are special wheel binary packages and they already contain statically built OpenCV binaries.
42+
43+
**Q: Pip fails with ``Could not find a version that satisfies the requirement ...``?**
44+
45+
A: Most likely the issue is related to too old pip and can be fixed by running ``pip install --upgrade pip``. Note that PyPI does not currently support ARM architecture so you can't install these packages for example on Raspberry Pi.
46+
47+
**Q: Import fails on Windows: ``ImportError: DLL load failed: The specified module could not be found.``?**
48+
49+
A: If the import fails on Windows, make sure you have [Visual C++ redistributable 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145) installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, [Universal C Runtime](https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows) might be also required.
50+
51+
If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see [this issue](https://github.com/skvark/opencv-python/issues/36) for a manual fix.
52+
53+
**Q: I have some other import errors?**
54+
55+
A: Make sure you have removed old manual installations of OpenCV Python bindings (cv2.so or cv2.pyd in site-packages).
56+
57+
## Documentation for opencv-python
58+
59+
.. image:: https://img.shields.io/appveyor/ci/skvark/opencv-python.svg?maxAge=3600&label=Windows
60+
:target: https://ci.appveyor.com/project/skvark/opencv-python
61+
:alt: AppVeyor CI test status (Windows)
62+
63+
.. image:: https://img.shields.io/travis/skvark/opencv-python.svg?maxAge=3600&label="Linux / OS X"
64+
:target: https://travis-ci.org/skvark/opencv-python
65+
:alt: Travis CI test status (Linux and OS X)
66+
67+
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.
68+
69+
### Build process
70+
71+
The project is structured like a normal Python package with a standard ``setup.py`` file. The build process for a single entry in the build matrices is as follows (see for example ``appveyor.yml`` file):
72+
73+
1. Checkout repository and submodules
74+
75+
- OpenCV is included as submodule and the version is updated
76+
manually by maintainers when a new OpenCV release has been made
77+
- Contrib modules are also included as a submodule
78+
79+
2. Find OpenCV version from the sources
80+
3. Install dependencies (numpy)
81+
4. Build OpenCV
82+
83+
- tests are disabled, otherwise build time increases too much
84+
- there are 4 build matrix entries for each build combination: with and without contrib modules, with and without GUI (headless)
85+
- Linux builds run in manylinux Docker containers (CentOS 5)
86+
87+
5. Copy each ``.pyd/.so`` file to cv2 folder of this project and
88+
generate wheel
89+
90+
- Linux and macOS wheels are checked with auditwheel and delocate
91+
92+
6. Install the generated wheel
93+
7. Test that Python can import the library and run some sanity checks
94+
8. Use twine to upload the generated wheel to PyPI (only in release builds)
95+
96+
The ``cv2.pyd/.so`` file is normally copied to site-packages. To avoid polluting the root folder this package wraps the statically built binary into cv2 package and ``__init__.py`` file in the package handles the import logic correctly.
97+
98+
Since all packages use the same ``cv2`` namespace explained above, uninstall the other package before switching for example from ``opencv-python`` to ``opencv-contrib-python``.
99+
100+
### Licensing
101+
102+
Opencv-python package (scripts in this repository) is available under MIT license.
103+
104+
OpenCV itself is available under [3-clause BSD License](https://github.com/opencv/opencv/blob/master/LICENSE).
105+
106+
Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt).
107+
108+
All wheels ship with [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).
109+
110+
Linux and MacOS wheels ship with [Qt 4.8.7](http://doc.qt.io/qt-4.8/lgpl.html) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).
111+
112+
### Versioning
113+
114+
``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.
115+
116+
### Releases
117+
118+
A release is made and uploaded to PyPI when a new tag is pushed to master branch. These tags differentiate packages (this repo might have modifications but OpenCV version stays same) and should be incremented sequentially. In practice, release version numbers look like this:
119+
120+
``cv_major.cv_minor.cv_revision.package_revision`` e.g. ``3.1.0.0``
121+
122+
### Development builds
123+
124+
Every commit to the master branch of this repo will be built. Possible build artifacts use local version identifiers:
125+
126+
``cv_major.cv_minor.cv_revision+git_hash_of_this_repo`` e.g. ``3.1.0+14a8d39``
127+
128+
These artifacts can't be and will not be uploaded to PyPI.
129+
130+
### Manylinux wheels
131+
132+
Linux wheels are built using [manylinux](https://github.com/pypa/python-manylinux-demo). These wheels should work out of the box for most of the distros (which use GNU C standard library) out there since they are built against an old version of glibc.
133+
134+
The default ``manylinux`` images have been extended with some OpenCV dependencies. See [Docker folder](https://github.com/skvark/opencv-python/tree/master/docker) for more info.
135+
136+
### Supported Python versions
137+
138+
Python 2.7 is the only supported version in 2.x series. Python 3.x releases follow Numpy releases. For example Python 3.3 is no longer supported by Numpy so support for it has been dropped in ``opencv-python``, too.
139+
140+
Currently, builds for following Python versions are provided:
141+
142+
- 2.7
143+
- 3.4
144+
- 3.5
145+
- 3.6

README.rst

-190
This file was deleted.

0 commit comments

Comments
 (0)