biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / video / deface / default.nix
blob054bb04aee72a047e53ffbac35f9615e7a90549f
1 { lib
2 , stdenv
3 , python3
4 , fetchFromGitHub
5 , pkgs
6 }:
8 python3.pkgs.buildPythonApplication rec {
9   pname = "deface";
10   version = "1.5.0";
11   pyproject = true;
13   disabled = python3.pythonOlder "3.8";
15   src = fetchFromGitHub {
16     owner = "ORB-HD";
17     repo = "deface";
18     rev = "refs/tags/v${version}";
19     hash = "sha256-/mXWeL6OSgW4BMXtAZD/3UxQUGt7UE5ZvH8CXNCueJo=";
20   };
22   build-system = with python3.pkgs; [
23     setuptools-scm
24   ];
26   dependencies = with python3.pkgs; [
27     imageio
28     imageio-ffmpeg
29     numpy
30     onnx
31     onnxruntime # Nixpkgs onnxruntime is missing CUDA support
32     opencv4
33     scikit-image
34     tqdm
35   ];
37   # Native onnxruntime lib used by Python module onnxruntime can't find its other libs without this
38   makeWrapperArgs = [
39     ''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ pkgs.onnxruntime ]}"''
40   ];
42   postPatch = ''
43     substituteInPlace pyproject.toml \
44       --replace-fail "opencv-python" "opencv"
45   '';
47   pythonImportsCheck = [ "deface" "onnx" "onnxruntime" ];
49   meta = {
50     description = "Video anonymization by face detection";
51     homepage = "https://github.com/ORB-HD/deface";
52     changelog = "https://github.com/ORB-HD/deface/releases/tag/v${version}";
53     license = lib.licenses.mit;
54     maintainers = with lib.maintainers; [ lurkki ];
55     mainProgram = "deface";
56     # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException'
57     broken = stdenv.hostPlatform.system == "aarch64-linux";
58   };