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

Why not use opencv-python-headless also for newer versions of Python? #6

Open
niksirbi opened this issue Oct 10, 2024 · 5 comments
Open

Comments

@niksirbi
Copy link

I noticed that the package depends on opencv-python instead of opencv-python-headless for Python versions >= 3.10.

dependencies = [
    'opencv-python-headless>=3.0; python_version < "3.10"',
    'opencv-python; python_version >= "3.10"',
]

I was wondering if there is a reason for that. Could it still use "headless" for newer versions?

Context

I'm developing a napari plugin using QT, and I'd like to also use napari-video, which depends on this package.
However I keep hitting segmentation faults, and I have a strong suspicion they come a conflict between opencv-python and PyQt5. Uninstalling opencv-python and installing opencv-python-headless solves the issue on my end.

@niksirbi
Copy link
Author

This is somewhat related to janclemenslab/napari-video#3.

Perhaps it's also worth considering an alternative video backend...

@postpop
Copy link
Owner

postpop commented Oct 11, 2024

Hi, I agree, the headless version is clearly preferable. We had a good reason for the version split in the dependencies, but I do not remember it anymore. Maybe at the time of writing the package, there was no headless version of the package for py>=3.10. Let me try and make opencv headless the dep for all python version and see what happens.

@postpop
Copy link
Owner

postpop commented Oct 11, 2024

And yes, using pyav as the backend might be preferable. What @bjudkewitz has implemented here janclemenslab/napari-video#3 looks great but it need some more testing before we can use it.

@niksirbi
Copy link
Author

Thanks for the swift response, Jan.
If the headless version could be made to work, it would untie my hands at least for now.

I'll chime in on the discussion under janclemenslab/napari-video#3, because I also have a stake at having a robust video player in napari.

@niksirbi
Copy link
Author

niksirbi commented Nov 4, 2024

Thanks for releasing a version that only depends on opencv-python-headless @postpop, should this issue be closed?

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

No branches or pull requests

2 participants