diff mbox series

[bug#59607,6/8] gnu: Add python-facexlib.

Message ID 237e70d8b319a981b9b992e4d7577aca8a1e988f.camel@gmail.com
State New
Headers show
Series Upscale your anime pictures, now with 99% less malware | expand

Commit Message

Liliana Marie Prikler Nov. 25, 2022, 10:31 p.m. UTC
* gnu/packages/machine-learning.scm (python-facexlib): New variable.
---
 gnu/packages/machine-learning.scm | 43 +++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index a5767a2c31..6116834578 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -816,6 +816,49 @@  (define-public python-basicsr
 artifacts.")
     (license license:asl2.0)))
 
+(define-public python-facexlib
+  (package
+    (name "python-facexlib")
+    (version "0.2.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "facexlib" version))
+              (modules '((guix build utils)))
+              (snippet
+               #~(begin (substitute* (find-files "." "\\.py$")
+                          (("\\.cuda\\(\\)") "")
+                          (("'cuda' if .* else ") "")
+                          (("'cuda'") "'cpu'"))))
+              (sha256
+               (base32
+                "1r378mb167k2hynrn1wsi78xbh2aw6x68i8f70nmcqsxxp20rqii"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:tests? #f                  ; No tests
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'fix-requirements
+                 (lambda _
+                   (substitute* "requirements.txt"
+                     (("opencv-python") ""))))))) ; installed without egg-info
+    (propagated-inputs (list opencv
+                             python-filterpy
+                             python-numba
+                             python-numpy
+                             python-pillow
+                             python-scipy
+                             python-pytorch
+                             python-torchvision
+                             python-tqdm))
+    (native-inputs (list python-cython))
+    (home-page "https://github.com/xinntao/facexlib")
+    (synopsis "Basic face library")
+    (description "This package provides a collection of face-related
+functions, such as detection, alignment, recognition or tracking.")
+    (license (list license:gpl3+
+                   license:asl2.0
+                   license:expat))))
+
 (define-public ncnn
   (package
     (name "ncnn")