-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
opencv 4.x: refactor to allow fine-grained selection of each module/contrib #15193
opencv 4.x: refactor to allow fine-grained selection of each module/contrib #15193
Conversation
It has been "fixed" upstream for OpenCV 4.6.0 It fixes few things in this recipe: - avoid a bug where quirc is in requirements, but not required by any component in package_indo() when dnn is False - a regression introduced by conan-io#11009. Indeed objdetect can be built without dnn in all OpenCV version before 4.5.4, so this PR was breaking these versions when dnn was False by not exposing opencv_objdetect and few contrib components.
components: - dnn_objdetect & opencv_text - dnn_superres since 4.1.2 - mcc since 4.5.0 - wechat_qrcode since 4.5.2 - barcode since 4.5.3
This comment has been minimized.
This comment has been minimized.
Hooks produced the following warnings for commit 2b84e4eopencv/4.5.1
opencv/4.5.5
opencv/4.1.2
opencv/4.5.3
|
This comment has been minimized.
This comment has been minimized.
f9ba580
to
7619df4
Compare
This comment has been minimized.
This comment has been minimized.
WTF |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hooks produced the following warnings for commit 186011aopencv/4.5.3
opencv/4.5.5
opencv/4.1.2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just an info about a patch
Co-authored-by: Uilian Ries <uilianries@gmail.com>
Conan v1 pipeline ✔️All green in build 3 (
Conan v2 pipeline ✔️
All green in build 3 ( |
Hooks produced the following warnings for commit a3ad99aopencv/4.1.2
|
… of each module/contrib * allow to build opencv_objdetect without dnn in 4.5.5 It has been "fixed" upstream for OpenCV 4.6.0 It fixes few things in this recipe: - avoid a bug where quirc is in requirements, but not required by any component in package_indo() when dnn is False - a regression introduced by conan-io#11009. Indeed objdetect can be built without dnn in all OpenCV version before 4.5.4, so this PR was breaking these versions when dnn was False by not exposing opencv_objdetect and few contrib components. * add missing contrib components when dnn is True components: - dnn_objdetect & opencv_text - dnn_superres since 4.1.2 - mcc since 4.5.0 - wechat_qrcode since 4.5.2 - barcode since 4.5.3 * fix photo & stitching components when cuda is enabled * add quality component in contrib only if version >= 4.1.0 * add dnn as an option dependency of video since 4.5.1 * dnn is an optional dependency of tracking * text is an optional dependency of datasets * move cuda components under contrib * fix requires of several contrib components * improve requires of main components * add an option for each contrib and deprecate contrib option * fix internal requirements of tracking module * force disable tesseract in text module for the moment * deprecate with_ade option in favor of gapi option * add option to allow to disable stitching module * remove useless comments * adapt test package to new options * add option to allow disabling highgui * add option to allow disabling videoio * add option to allow disabling ml * add option to allow disabling photo * move options related to modules first * add missing frameworks for imgcodecs * add with_tesseract option for text module * also handle cuda contribs * add option to allow disabling objdetect * add option to allow disabling video * prefer to force enable options required by modules explicitly required by consumers * improve CMakeLists of test package * add option to allow disabling imgcodecs * typo * remove with_imgcodec_* options when imgcodecs module is disabled * add option to allow disabling calib3d * add option to allow disabling features2d * classification of options by category * add option to allow disabling flann * split executables in test package per tested module * add option to allow disabling imgproc * opencv 4.x requires at least C++11 * test opencv_core * add options for gdal & gdcm support in imgcodecs * test opencv_imgcodecs * minor change * add missing mantadory dependency to tracking * minor change * add contrib_ovis option * add contrib_hdf option * fix system libs of opencv_gapi on Windows * remove with_v4l option if videoio module is disabled * control build of cudev through with_cuda option * add vulkan support in dnn module * add with_opencl option * do not build Android examples * fix discovery of zlib static if Android * fix install layout for Android * better filter to collect extra libs in opencv core * remove contrib prefix * add deprecation messages * alphamat requires eigen support * fix injection of cpu_baseline and cpu_dispatch in case of empty string * neon stuff * pass False to WITH_FFMPEG if option removed * remove deprecated options from package id * simplify * add cvv and viz options viz module can't be enabled yet, due to lack of vtk recipe in conan-center * avoid redefining cmake variables * do not force disable openexr if Android * better handling of qt * no base_path in conandata.yml * fix qt link * improve deprecated contrib option handling * factorize modules in options & default_options * declare frameworks & system_libs in _opencv_modules * typo * fix link to qt in cvv module * add a test of calib3d module * add a test of flann module * add a test of objdetect module * add a test of video module * add a test of photo module * add a test of stitching module * add a test of ml module * add a test of highgui module * parallel ctest in test package * add a test of features2d module * add a test of freetype module * parallel ctest in test v1 package * add a test of structured_light module * add a test of shape module * add a test of reg module * simplify test_imgproc.cpp * test more extra modules * more elegant workaround of get_safe in test_v1_package * small change * missing tesseract in requires of text component * add a test of text module * add test of xfeatures2d module * add test of ximgproc module * test more extra modules * add missing header in alphamat.hpp * typo * sfm module needs eigen enabled * test more extra modules * test more extra modules * test more extra modules * simplify CMakeLists of test package * simplify test package even more * test more modules * adapt dnn_superres test to work with old versions * fix build of sfm extra module in opencv < 4.5.3 * check again internal dependencies between options in validate() in conan v2 downstream options values always have precedence, so we have to check again in validate() that combination of opencv options is still valid * add world option * minor change * minor comment change * factorize a little bit * bump protobuf to 3.21.9 * compat with openexr 3.x in old opencv versions * add res to resdirs of components * bump dependencies * some conan v2 stuff * bump freetype * properly set requires of each component regarding eigen Eigen is a private dependency of: - calib3d - core - features2d - stitching - rgbd - sfm - ximgproc * fix cuda internal dependencies * use self.dependencies["ffmpeg"] * fix ffmpeg required components * improve ffmpeg handling * ffmpeg workaround for the moment * bump ffmpeg * avutil always available in ffmpeg * bump dependencies * factorize * remove patches of removed versions * fix world option * bump dependencies * fix typo in requires of cudacodec * bump several dependencies * Update recipes/opencv/4.x/conandata.yml Co-authored-by: Uilian Ries <uilianries@gmail.com> --------- Co-authored-by: Uilian Ries <uilianries@gmail.com>
Refactoring to allow disabling each module independently:
Add options with consistent names to allow enabling/disabling:
main modules (except
core
obviously), not onlygapi
&dnn
:calib3d
,features2d
,flann
,highgui
,imgproc
,imgcodecs
,ml
,objdetect
,photo
,stitching
,video
andvideoio
.As a consequence
with_ade
option is deprecated in favor ofgapi
option.each extra module (~55 libraries).
As a consequence
contrib
option is deprecated.contrib_sfm
&contrib_freetype
options are also deprecated in favor ofsfm
&freetype
options respectively (for option naming consistency).Due to the huge number of optional modules and internal dependencies between them, it may be very hard for consumers to find the good combination allowing to build a specific module (raising for each bad tuples of options would be a nightmare for users). Therefore when a module is enabled by users, opencv modules of its internal dependency graph are also enabled if they were disabled, and recipe displays a warning for each module enabled with this mechanism (if they were disabled by default or by consumers).
Several issues had to be fixed to allow this refactoring:
Properly declare in
package_info()
these missing contrib modules (they were built when contrib option was True, but not properly declared as components):dnn_objdetect
&text
dnn_superres
since 4.1.2mcc
since 4.5.0wechat_qrcode
since 4.5.2barcode
since 4.5.3Allow to build 3 more extra modules
cvv
,hdf
&ovis
.Allow to build
objdetect
main module withoutdnn
module in 4.5.5 (it can't be built upstream withoutdnn
only in 4.5.4 & 4.5.5). It has been "fixed" upstream in OpenCV 4.6.0 (see Fix support objdetect module for UWP opencv/opencv#21369).It fixes few things in this recipe:
objdetect
can be built without dnn in all OpenCV versions before 4.5.4, so this PR was breaking these versions whendnn
option was False by not exposingopencv_objdetect
and few contrib components.package_indo()
whendnn=False
(the one opencv(4.x): disable quirc if dnn is disabled #13215 was trying to address, but badly due to previous regression).Fix "requires" of
photo
&stitching
components when cuda is enabled.Refactor tests to take into account these changes, it's more modular. It allows to test each component in isolation and more easily detect issues in opencv recipe.
Few options have been added in the meantime:
world
which aggregates all modules (exceptimg_hash
&sfm
) in one lib (aggregated modules still have a dedicated imported target to properly mimic official OpenCV config file, but these targets depend onopencv_world
).with_tesseract
(enabled by default): buildtext
extra module withtesseract
support. Option is removed iftext
module is not built.with_gdal
&with_gdcm
(disabled by default): optional dependencies ofimgcodecs
main module. Options are removed ifimgcodecs
module is not built.with_qt
(disabled by default): optional dependency ofhighgui
main module, and mandatory forcvv
extra module. Option is removed ifhighgui
andcvv
module are not built.with_vulkan
(disabled by default): optional dependency ofdnn
main module. Option is removed ifdnn
module is not built.with_opencl
(disabled by default): optional global dependency.Few compat improvements:
conan v2 fix:
self.dependencies["gtk"].options.version
instead ofself.options["gtk"].version
res
dir toresdirs
attribute of components inpackage_info()
closes #4265
closes #7439
closes #9127
closes #14816
closes #15581
closes #16726
closes #17042
closes #17182
closes #17368