diff options
author | Maxim Cournoyer <[email protected]> | 2021-10-01 17:10:49 -0400 |
---|---|---|
committer | Maxim Cournoyer <[email protected]> | 2021-10-01 17:10:49 -0400 |
commit | 2e65e4834a226c570866f2e8976ed7f252b45cd1 (patch) | |
tree | 21d625bce8d03627680214df4a6622bf8eb79dc9 /gnu/packages/image-processing.scm | |
parent | 9c68ecb24dd1660ce736cdcdea0422a73ec318a2 (diff) | |
parent | f1a3c11407b52004e523ec5de20d326c5661681f (diff) |
Merge remote-tracking branch 'origin/master' into staging
With resolved conflicts in:
gnu/packages/bittorrent.scm
gnu/packages/databases.scm
gnu/packages/geo.scm
gnu/packages/gnupg.scm
gnu/packages/gstreamer.scm
gnu/packages/gtk.scm
gnu/packages/linux.scm
gnu/packages/python-xyz.scm
gnu/packages/xorg.scm
guix/build/qt-utils.scm
Diffstat (limited to 'gnu/packages/image-processing.scm')
-rw-r--r-- | gnu/packages/image-processing.scm | 199 |
1 files changed, 196 insertions, 3 deletions
diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index ce2242a658..df77bef192 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -15,6 +15,8 @@ ;;; Copyright © 2021 Oleh Malyi <[email protected]> ;;; Copyright © 2021 Felix Gruber <[email protected]> ;;; Copyright © 2021 Andy Tai <[email protected]> +;;; Copyright © 2021 Ekaitz Zarraga <[email protected]> +;;; Copyright © 2021 Paul Garlick <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,6 +42,7 @@ #:use-module (guix build-system qt) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system python) #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages bison) @@ -70,6 +73,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) #:use-module (gnu packages serialization) @@ -297,6 +301,8 @@ many popular formats.") "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON" "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON" + "-DVTK_WRAP_PYTHON=ON" + "-DVTK_PYTHON_VERSION:STRING=3" ) #:phases (modify-phases %standard-phases @@ -327,6 +333,7 @@ many popular formats.") ("netcdf" ,netcdf) ("png" ,libpng) ("proj" ,proj.4) + ("python", python) ;("pugixml" ,pugixml) ("sqlite" ,sqlite) ("tiff" ,libtiff) @@ -349,6 +356,97 @@ a suite of 3D interaction widgets, supports parallel processing, and integrates with various databases on GUI toolkits such as Qt and Tk.") (license license:bsd-3))) +;; freecad needs an old version of VTK, because VTK's API changed from 8 to 9 +(define-public vtk-8 + (package + (name "vtk") + (version "8.2.0") + (source (origin + (method url-fetch) + (uri (string-append "https://vtk.org/files/release/" + (version-major+minor version) + "/VTK-" version ".tar.gz")) + (sha256 + (base32 + "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl")) + (patches + (search-patches "vtk-8-fix-freetypetools-build-failure.patch")) + (modules '((guix build utils))) + (snippet + '(begin + (for-each + (lambda (dir) + (delete-file-recursively + (string-append "ThirdParty/" dir "/vtk" dir))) + ;; ogg, pugixml depended upon unconditionally + '("doubleconversion" "eigen" "expat" "freetype" "gl2ps" + "glew" "hdf5" "jpeg" "jsoncpp" "libproj" "libxml2" "lz4" + "netcdf" "png" "sqlite" "theora" "tiff" "zlib")) + #t)))) + (build-system cmake-build-system) + (arguments + '(#:build-type "Release" ;Build without '-g' to save space. + #:configure-flags '(;"-DBUILD_TESTING:BOOL=TRUE" + ;"-DVTK_MODULE_USE_EXTERNAL_vtkogg:BOOL=TRUE" ; not honored + "-DVTK_USE_SYSTEM_DOUBLECONVERSION:BOOL=TRUE" + "-DVTK_USE_SYSTEM_EIGEN:BOOL=TRUE" + "-DVTK_USE_SYSTEM_EXPAT:BOOL=TRUE" + "-DVTK_USE_SYSTEM_FREETYPE:BOOL=TRUE" + "-DVTK_USE_SYSTEM_GL2PS:BOOL=TRUE" + "-DVTK_USE_SYSTEM_GLEW:BOOL=TRUE" + "-DVTK_USE_SYSTEM_HDF5:BOOL=TRUE" + "-DVTK_USE_SYSTEM_JPEG:BOOL=TRUE" + "-DVTK_USE_SYSTEM_JSONCPP:BOOL=TRUE" + "-DVTK_USE_SYSTEM_LIBPROJ:BOOL=TRUE" + "-DVTK_USE_SYSTEM_LIBXML2:BOOL=TRUE" + "-DVTK_USE_SYSTEM_LZ4:BOOL=TRUE" + "-DVTK_USE_SYSTEM_NETCDF:BOOL=TRUE" + "-DVTK_USE_SYSTEM_PNG:BOOL=TRUE" + ;"-DVTK_USE_SYSTEM_PUGIXML:BOOL=TRUE" ; breaks IO/CityGML + "-DVTK_USE_SYSTEM_SQLITE:BOOL=TRUE" + "-DVTK_USE_SYSTEM_THEORA:BOOL=TRUE" + "-DVTK_USE_SYSTEM_TIFF:BOOL=TRUE" + "-DVTK_USE_SYSTEM_ZLIB:BOOL=TRUE") + #:tests? #f)) ;XXX: test data not included + (inputs + `(("double-conversion" ,double-conversion) + ("eigen" ,eigen) + ("expat" ,expat) + ("freetype" ,freetype) + ("gl2ps" ,gl2ps) + ("glew" ,glew) + ("glu" ,glu) + ("hdf5" ,hdf5) + ("jpeg" ,libjpeg-turbo) + ("jsoncpp" ,jsoncpp) + ;("libogg" ,libogg) + ("libtheora" ,libtheora) + ("libX11" ,libx11) + ("libxml2" ,libxml2) + ("libXt" ,libxt) + ("lz4" ,lz4) + ("mesa" ,mesa) + ("netcdf" ,netcdf) + ("png" ,libpng) + ("proj" ,proj.4) + ;("pugixml" ,pugixml) + ("sqlite" ,sqlite) + ("tiff" ,libtiff) + ("xorgproto" ,xorgproto) + ("zlib" ,zlib))) + (home-page "https://vtk.org/") + (synopsis "Libraries for 3D computer graphics") + (description + "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics, +image processing and visualization. It supports a wide variety of +visualization algorithms including: scalar, vector, tensor, texture, and +volumetric methods; and advanced modeling techniques such as: implicit +modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay +triangulation. VTK has an extensive information visualization framework, has +a suite of 3D interaction widgets, supports parallel processing, and +integrates with various databases on GUI toolkits such as Qt and Tk.") + (license license:bsd-3))) + ;; itksnap needs an older variant of VTK. (define-public vtk-6 (package (inherit vtk) @@ -686,7 +784,7 @@ including 2D color images.") ("qttools" ,qttools))) (inputs `(("gmic" ,gmic) - ("qtbase" ,qtbase) + ("qtbase" ,qtbase-5) ,@(package-inputs gmic))) (synopsis "Qt frontend for the G'MIC image processing framework") (license license:gpl3+))) @@ -854,6 +952,7 @@ libraries designed for computer vision research and implementation.") ;; variable in the installed CMake files. This is necessary as other ;; packages using insight-toolkit could not be configured otherwise. "-DGTEST_ROOT=gtest") + #:phases (modify-phases %standard-phases (add-after 'unpack 'do-not-tune @@ -1013,7 +1112,7 @@ combine the information contained in both.") ;; not with 4.13. It really needs to be 4.12. ("itk" ,insight-toolkit-4.12) ("vtk" ,vtk-6) - ("qtbase" ,qtbase) + ("qtbase" ,qtbase-5) ("qtdeclarative" ,qtdeclarative) ("vxl" ,vxl-1) ("zlib" ,zlib))) @@ -1140,7 +1239,7 @@ substituted by matching images.") ("libjpeg" ,libjpeg-turbo) ("libpng" ,libpng) ("libtiff" ,libtiff) - ("qtbase" ,qtbase) + ("qtbase" ,qtbase-5) ("qtsvg" ,qtsvg) ("zlib" ,zlib))) (arguments @@ -1187,3 +1286,97 @@ and Scan Tailor Enhanced versions as well as including many more bug fixes.") Transport System} images to the more popular TIFF format for illustration purposes.") (license license:gpl3+))) + +(define-public python-imgviz + (package + (name "python-imgviz") + (version "1.2.6") + (source + (origin + ;; PyPi tarball lacks tests. + (method git-fetch) + (uri (git-reference + (url "https://github.com/wkentaro/imgviz.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1bm0wdv5p26i8nl4kx3145cz553v401sgbpgc96sddzjfmfiydcw")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key inputs outputs tests? #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + (invoke "pytest" "-v" "tests")) + #t))))) + (propagated-inputs + `(("python-matplotlib" ,python-matplotlib) + ("python-numpy" ,python-numpy) + ("python-pillow" ,python-pillow) + ("python-pyyaml" ,python-pyyaml))) + (native-inputs `(("python-pytest" ,python-pytest))) + (home-page "http://github.com/wkentaro/imgviz") + (synopsis "Image Visualization Tools") + (description "Python library for object detection, semantic and instance +segmentation.") + (license license:expat))) + +(define-public labelme + (package + (name "labelme") + (version "4.5.9") + (source + (origin + ;; PyPi tarball lacks tests. + (method git-fetch) + (uri (git-reference + (url "https://github.com/wkentaro/labelme.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "12wn291516kdv0wqngz4l04j95g3rwc6cvkcb0gw8rrv4wgc7c66")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'check 'start-xserver + (lambda* (#:key inputs #:allow-other-keys) + (let ((xorg-server (assoc-ref inputs "xorg-server"))) + ;; Options taken from CI workflow. + (system (string-append xorg-server "/bin/Xvfb :99 -screen 0 " + "1920x1200x24 -ac +extension GLX +render " + "-noreset &")) + (setenv "DISPLAY" ":99.0")))) + (replace 'check + (lambda* (#:key inputs outputs tests? #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + ;; Fails when invoking help2man for unknown reason. + (delete-file "tests/docs_tests/man_tests/test_labelme_1.py") + ;; One test hangs. + (delete-file "tests/labelme_tests/widgets_tests/test_label_dialog.py") + ;; Calls incompatible function signatures. + (delete-file "tests/labelme_tests/widgets_tests/test_label_list_widget.py") + (setenv "MPLBACKEND" "agg") + (invoke "pytest" "-v" "tests" "-m" "not gpu"))))))) + (propagated-inputs + `(("python-imgviz" ,python-imgviz) + ("python-matplotlib" ,python-matplotlib) + ("python-numpy" ,python-numpy) + ("python-pillow" ,python-pillow) + ("python-pyyaml" ,python-pyyaml) + ("python-qtpy" ,python-qtpy) + ("python-termcolor" ,python-termcolor))) + (native-inputs + `(("python-pytest" ,python-pytest) + ("python-pytest-qt" ,python-pytest-qt) + ("xorg-server" ,xorg-server-for-tests))) + (home-page "https://github.com/wkentaro/labelme") + (synopsis + "Image Polygonal Annotation") + (description + "Image and video labeling tool supporting different shapes like +polygons, rectangles, circles, lines, points and VOC/COCO export.") + (license license:gpl3+))) |