9
9
OpenCV on wheels
10
10
================
11
11
12
- Unofficial OpenCV packages for Python.
13
-
14
- Work in progress!
12
+ Unofficial OpenCV packages for Python. Work in progress!
15
13
16
14
The aim of this repository is to provide means to package each new
17
- `OpenCV release <https://github.com/Itseez /opencv/releases >`__ for the
15
+ `OpenCV release <https://github.com/opencv /opencv/releases >`__ for the
18
16
most used Python versions and platforms.
19
17
20
18
At the same time it allows anyone to build a custom version of OpenCV
21
19
for any Python version: just fork this repo and modify the build files
22
20
and scripts to fit your needs.
23
21
24
- Why?
25
- ----
22
+ Installation and Usage
23
+ ----------------------
26
24
27
- 1. Installation of OpenCV for Python is pretty hideous :
25
+ To install this package :
28
26
29
- 1. Download OpenCV
30
- 2. Find cv2.pyd from the package
27
+ ``pip install opencv-python ``
31
28
32
- - If it exists, copy it to the root of Python site-packages
33
- - If it does not exist for some reason for your setup, you have
34
- to setup the build environment and compile it manually
29
+ To import the package:
35
30
36
- 3. Try to import cv2 and hope it works
31
+ `` import cv2 ``
37
32
38
- 2. Everyone should be able to install OpenCV (or any package for that
39
- matter) with pip with a single command without building anything
40
- 3. Python `wheels <http://pythonwheels.com/ >`__ are nice, we should use
41
- them more
33
+ `OpenCV documentation <http://docs.opencv.org/ >`__
42
34
43
- Documentation
35
+ Build process
44
36
-------------
45
37
46
38
The project is structured like a normal Python package with a standard
47
- ``setup.py `` file. The build process is as follows (see
48
- ``appveyor.yml ``):
39
+ ``setup.py `` file. The build process is as follows (see for example
40
+ ``appveyor.yml `` file ):
49
41
50
42
1. Checkout repository and submodules
51
43
52
44
- OpenCV is included as submodule and the version is updated
53
- manually when a new OpenCV release has been made
45
+ manually by maintainers when a new OpenCV release has been made
54
46
55
47
2. Find OpenCV version from the sources
56
48
3. Upgrade pip and install numpy for each Python version
@@ -62,18 +54,17 @@ The project is structured like a normal Python package with a standard
62
54
generate wheel
63
55
6. Install the generated wheels for each Python version
64
56
7. Test that the Python versions can import them
65
- 8. TO DO: upload the wheels to PyPi
57
+ 8. Use twine to upload all wheels to PyPI
66
58
67
59
Currently the ``find_version.py `` file parses OpenCV version information
68
60
from the OpenCV sources. OpenCV depends on numpy, so ``setup.py `` checks
69
61
the numpy version also with the help of pip.
70
62
71
- As described earlier, for example the ``.pyd `` file on Windows is
72
- normally copied to site-packages. To avoid polluting the root folder the
73
- ``__init__.py `` file in cv2 folder handles the import logic correctly by
74
- importing the actual ``.pyd `` module and replacing the imported cv2
75
- package in ``sys.modudes `` with the cv2 module to retain backward
76
- compatibility.
63
+ The ``cv2.pyd `` file for example on Windows is normally copied to site-packages.
64
+ To avoid polluting the root folder the ``__init__.py `` file in cv2 folder
65
+ handles the import logic correctly by importing the actual ``.pyd `` module
66
+ and replacing the imported cv2 package in ``sys.modudes `` with the
67
+ cv2 module to retain backward compatibility.
77
68
78
69
Licensing
79
70
---------
@@ -126,7 +117,7 @@ Windows:
126
117
~~~~~~~~
127
118
128
119
There's a build time limitation (AppVeyor open source builds may take
129
- max. 1 hour) which restricts the supported Python versions to two. As
120
+ max 1 hour) which restricts the supported Python versions to two. As
130
121
Python's 2.x releases are slowly approaching legacy state, 2.7.x
131
122
releases will be the only supported Python 2 versions on Windows. On
132
123
Python 3 side, builds will be run only for the latest release.
144
135
~~~~
145
136
146
137
TODO
147
-
148
- .. |buildstatus | image :: https://ci.appveyor.com/api/projects/status/5kjqpmvll5dwj5jd?svg=true
149
- :target: https://ci.appveyor.com/project/skvark/opencv-python
150
- .. |Build Status | image :: https://travis-ci.org/skvark/opencv-python.svg?branch=master
151
- :target: https://travis-ci.org/skvark/opencv-python
0 commit comments