GNU bug report logs -
#59607
[PATCH 0/8] Upscale your anime pictures, now with 99% less malware
Previous Next
Full log
Message #26 received at 59607 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/machine-learning.scm (python-real-esrgan): New variable.
---
gnu/packages/machine-learning.scm | 62 +++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 73263962f5..c49886f50d 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -930,6 +930,68 @@ (define-public python-gfpgan
images.")
(license license:asl2.0)))
+(define-public python-real-esrgan
+ (package
+ (name "python-real-esrgan")
+ (version "0.3.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/xinntao/Real-ESRGAN")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin (substitute* (find-files "." "\\.py")
+ (("\\.cuda\\(\\)") ""))))
+ (sha256
+ (base32
+ "19qp8af1m50zawcnb31hq41nicad5k4hz7ffwizana17w069ilx5"))))
+ (build-system python-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-api
+ (lambda _
+ (substitute* (find-files "." "\\.py$")
+ (("from basicsr\\.losses\\.losses import .*")
+ "import basicsr.losses\n")
+ (("GANLoss")
+ "basicsr.losses.gan_loss.GANLoss")
+ (("(L1|Perceptual)Loss" loss)
+ (string-append "basicsr.losses.basic_loss." loss)))))
+ (add-after 'unpack 'fix-requirements
+ (lambda _
+ (substitute* "requirements.txt"
+ (("opencv-python") "")))) ; installed without egg-info
+ (add-before 'check 'pre-check
+ (lambda _
+ (setenv "HOME" (getcwd))
+ ;; Test requires pretrained model.
+ (delete-file "tests/test_utils.py")))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv")))))))
+ (propagated-inputs (list opencv
+ python-basicsr
+ python-facexlib
+ python-gfpgan
+ python-numpy
+ python-pillow
+ python-pytorch
+ python-torchvision
+ python-tqdm))
+ (native-inputs (list python-cython python-pytest))
+ (home-page "https://github.com/xinntao/Real-ESRGAN")
+ (synopsis "Restore low-resolution images")
+ (description "Real-ESRGAN is a @acronym{GAN, Generative Adversarial Network}
+aiming to restore low-resolution images. The techniques used are described in
+the paper 'Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure
+Synthetic Data' by Xintao Wang, Liangbin Xie, Chao Dong, and Ying Shan.")
+ (license license:bsd-3)))
+
(define-public ncnn
(package
(name "ncnn")
--
2.38.1
This bug report was last modified 2 years and 201 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.