conda-forge / opencv-feedstock

A conda-smithy repository for opencv.
BSD 3-Clause "New" or "Revised" License
63 stars 59 forks source link

Build with Caffe, Protobuf, Gflags, Glog, OpenEXR, Leptonica, and Tesseract #128

Open jakirkham opened 6 years ago

jakirkham commented 6 years ago

OpenCV has support for and can use Caffe, Protobuf, Gflags, Glog, OpenEXR, Leptonica, and Tesseract. We have packages for all of these. Would be good to start building OpenCV with support for them.

Edit: There may be some pinning issues we need to sort out to do this.

ref: https://travis-ci.org/conda-forge/opencv-feedstock/jobs/426208605#L866-L868 ref: https://travis-ci.org/conda-forge/opencv-feedstock/jobs/426208605#L924-L927

hmaarrfk commented 5 years ago

will that make the python opencv depend on all those things?

Will python opencv be unusable without caffe for example?

jakirkham commented 5 years ago

We could build with them and then make them optional dependencies if it is a concern.

They should all be C++ dependencies FWIU.

Don't think so. Caffe specifically has its own Python bindings. Doubt OpenCV would try to also add Python bindings to Caffe, but I could be surprised.

jakirkham commented 5 years ago

Should add that some of these are already being built by OpenCV using vendored code. So having a dependency would be better to avoid duplication and shorten the build.

hmaarrfk commented 5 years ago

The issue is that the cv2 package is monolithic, and just links to EVERYTHING

below, I move a linked library for the face module, immediately, cv2 fails to import.

$ mv /home/mark2/miniconda3/envs/owl/./lib/python3.6/site-packages/../../libopencv_face.so.3.4 /home/mark2/miniconda3/envs/owl/./lib/python3.6/site-packages/../../libopencv_face.so.3.4_                          
(owl) mark2@xps ~/m/e/owl                                                                                                                                                                                          
$ ipython                                                                                                                                                                                                          
imPython 3.6.7 | packaged by conda-forge | (default, Nov 21 2018, 02:32:25) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import cv2                                                                                                                                                                                                 
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-c8ec22b3e787> in <module>
----> 1 import cv2

ImportError: libopencv_face.so.3.4: cannot open shared object file: No such file or directory