Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow opencv-contrib-* to satisfy opencv requirement #837

Merged

Conversation

agchang-cgl
Copy link
Contributor

opencv-contrib-* is a superset of the opencv-python-* API, so this allows dependents to use the contrib variants along with albumentations [1] (see point #3).

I'm working on a project which uses albumentations, but also needs to use opencv-contrib-python-headless. Since albumentations doesn't recognize that as satisfying opencv (as an abstract dependency), it installs the opencv-python-headless version, which causes the cv2 namespace to be clobbered and no longer recognize modules in contrib.

Note, the imgaug dependency also forces an install of opencv-python [2] (the non-headless version :(), but this can be worked around with:

pip install --no-binary imgaug .

[1] aleju/imgaug#473
[2] https://pypi.org/project/opencv-contrib-python-headless/

… satisfy the opencv requirement.

`opencv-contrib-*` is a superset of the `opencv-python-*` API, so this allows dependents to use the contrib
variant along with albumentations.
@agchang-cgl agchang-cgl marked this pull request as ready for review February 5, 2021 05:37
@creafz creafz merged commit ff83de8 into albumentations-team:master Feb 5, 2021
@agchang-cgl agchang-cgl deleted the opencv-contrib-support branch February 5, 2021 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants