chaiNNer-org / chaiNNer

A node-based image processing GUI aimed at making chaining image processing tasks easy and customizable. Born as an AI upscaling application, chaiNNer has grown into an extremely flexible and powerful programmatic image processing application.
https://chaiNNer.app
GNU General Public License v3.0
4.54k stars 280 forks source link

Solve opencv conflicts #1551

Open joeyballentine opened 1 year ago

joeyballentine commented 1 year ago

We should consider switching our opencv package to the opencv-contrib package, and preferably the non-headless version. And, in our install command we should uninstall other versions.

This is something that was brought up in #1546. The contrib version has the most features, and is a superset of regular opencv. Right now, if we install opencv to a users systen python, we could cause a package conflict (which i think is the cause of that cv2.cv2 import issue some users reported).

If we uninstall any other versions and install non-headless contrib, we ensure full compatibility with any other package that requires opencv while also getting all the features we could potentially use.

theflyingzamboni commented 1 year ago

Isn't this something we don't want to do for system python? I'm not really a fan of programs forcibly changing which packages I have installed on system python.

joeyballentine commented 1 year ago

I consider people switching on system python as an "opt in" to us doing whatever we want to their system python. We default to integrated and recommend using it, it's their choice to have us use and modify their system one.

If we don't uninstall the other opencv packages for them, then installing an extra one will break the imports (which already has the possibility of happening). Keeping only the contrib one is the only way to ensure that everything works no matter what

joeyballentine commented 1 year ago

@theflyingzamboni it's worth noting that right now as it's implemented we actually would break people's system python if they have the contrib version installed

theflyingzamboni commented 1 year ago

What a bothersome feature. XD