about summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authorJussi Kuokkanen <jussi.kuokkanen@protonmail.com>2023-08-19 22:33:32 +0300
committerJussi Kuokkanen <jussi.kuokkanen@protonmail.com>2023-08-19 22:34:31 +0300
commit7a7bf33edf9d9c865fe88e55ad4639e4c9654c96 (patch)
treea498f511ff3ca1a89df7509f91c46feea8ffc1a6 /pkgs/applications/video
parentd14dd2e9af9398ff54aee8521722cba180e93b05 (diff)
downloadnixlib-7a7bf33edf9d9c865fe88e55ad4639e4c9654c96.tar
nixlib-7a7bf33edf9d9c865fe88e55ad4639e4c9654c96.tar.gz
nixlib-7a7bf33edf9d9c865fe88e55ad4639e4c9654c96.tar.bz2
nixlib-7a7bf33edf9d9c865fe88e55ad4639e4c9654c96.tar.lz
nixlib-7a7bf33edf9d9c865fe88e55ad4639e4c9654c96.tar.xz
nixlib-7a7bf33edf9d9c865fe88e55ad4639e4c9654c96.tar.zst
nixlib-7a7bf33edf9d9c865fe88e55ad4639e4c9654c96.zip
deface: init at 1.4.0
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/deface/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/applications/video/deface/default.nix b/pkgs/applications/video/deface/default.nix
new file mode 100644
index 000000000000..43c009c9dbb8
--- /dev/null
+++ b/pkgs/applications/video/deface/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, stdenv
+, python3
+, fetchFromGitHub
+, makeWrapper
+, pkgs
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "deface";
+  version = "1.4.0";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "ORB-HD";
+    repo = "deface";
+    rev = "v${version}";
+    hash = "sha256-tLNTgdnKKmyYHVajz0dHIb7cvC1by5LQ5CFIbMvPEYk=";
+  };
+
+  nativeBuildInputs = with python3.pkgs; [
+    setuptools-scm
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    imageio
+    imageio-ffmpeg
+    numpy
+    onnx
+    onnxruntime # Nixpkgs onnxruntime is missing CUDA support
+    opencv4
+    scikit-image
+    tqdm
+  ];
+
+  # Native onnxruntime lib used by Python module onnxruntime can't find its other libs without this
+  makeWrapperArgs = [
+    ''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ pkgs.onnxruntime ]}"''
+  ];
+
+  patchPhase = ''
+    substituteInPlace pyproject.toml requirements.txt --replace "opencv-python" "opencv"
+  '';
+
+  # Let setuptools know deface version
+  SETUPTOOLS_SCM_PRETEND_VERSION = "v${version}";
+
+  pythonImportsCheck = [ "deface" "onnx" "onnxruntime" ];
+
+  meta = with lib; {
+    description = "Video anonymization by face detection";
+    homepage = "https://github.com/ORB-HD/deface";
+    license = licenses.mit;
+    maintainers = with maintainers; [ lurkki ];
+  };
+}