SciKit-Surgery / scikit-surgeryimage

Image processing, using OpenCV.
Other
2 stars 2 forks source link

Can we use opencv-headless? #104

Open thompson318 opened 2 years ago

thompson318 commented 2 years ago

Not using headless leads to some Qt binaries being included in the build, which can mess things up when we include in something using PySide etc. Like this, https://github.com/opencv/opencv-python/issues/46

thompson318 commented 2 years ago

@tdowrick @MattClarkson I'm looking at using opencv-contrib-python-headless here to try and avoid downstream library conflicts with PySide2 (and just to simplify dependencies in general). This would break anything here with a GUI, namely sksurgeryimage/display/identify_cameras.py and sksurgeryimage/ui/ImageCropper.py. However neither of them appear to be integral to sksurgeryimage, they just seem to be useful utilities. If we want to keep them we could just move them to a separate library that has a GUI. Do either of you have an opinion on this?

tdowrick commented 2 years ago

I don't think either of those two are used anymore, or can be moved if needed, so I think you can go ahead and make the change.

MattClarkson commented 2 years ago

@thompson318 - turns out these things are referenced in BARD. Can we re-open? The question is also which packaged need updating, as some have a requirements.txt that explicitly names opencv-python-contrib as well, so you'd get both.

tdowrick commented 2 years ago

Where in bard is this used? I tried to find it but couldn't see the import statement.

thompson318 commented 2 years ago

I've repopened it for now. I don't think it's used directly by BARD, but maybe in the tutorial instructions. My preference would be to update the tutorial instructions and try and use opencv-headless wherever possible.

thompson318 commented 2 years ago

I can't find any reference to ImageCropper in BARD or MPHY0026

mxochicale commented 1 year ago

I am having a conflict using opencv-contrib-python-headless>=4.7.0.72 for https://github.com/SciKit-Surgery/scikit-surgeryutils:

The conflict is caused by:
    The user requested opencv-contrib-python-headless>=4.7.0.72
    scikit-surgeryvtk 2.0.0 depends on opencv-contrib-python-headless>=4.7.0.72
    scikit-surgeryimage 0.10.1 depends on opencv-contrib-python-headless>=4.2.0.32
    scikit-surgeryarucotracker 0.2.8 depends on opencv-contrib-python-headless<4.7

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
REFERENCE: https://github.com/SciKit-Surgery/scikit-surgeryutils/actions/runs/5253786647/jobs/9491551217

@thompson318, can we go for a scikit-surgeryimage new release v0.11.0, fixing opencv-contrib-python-headless version?

thompson318 commented 1 year ago

I don't understand why pip is choosing arucotracker 0.2.8. I can see it doing it here: https://github.com/SciKit-Surgery/scikit-surgeryutils/actions/runs/5253786647/jobs/9491551217#step:5:159 but I don't get where the requirement is coming from. If we can fix that so it uses an up to date version of aruco tracker then it should fix the conflict.