1{
2 lib,
3 stdenv,
4 python3,
5 fetchFromGitHub,
6 pkgs,
7}:
8
9python3.pkgs.buildPythonApplication rec {
10 pname = "deface";
11 version = "1.5.0";
12 pyproject = true;
13
14 disabled = python3.pythonOlder "3.8";
15
16 src = fetchFromGitHub {
17 owner = "ORB-HD";
18 repo = "deface";
19 tag = "v${version}";
20 hash = "sha256-/mXWeL6OSgW4BMXtAZD/3UxQUGt7UE5ZvH8CXNCueJo=";
21 };
22
23 build-system = with python3.pkgs; [
24 setuptools-scm
25 ];
26
27 dependencies = with python3.pkgs; [
28 imageio
29 imageio-ffmpeg
30 numpy
31 onnx
32 onnxruntime # Nixpkgs onnxruntime is missing CUDA support
33 opencv-python
34 scikit-image
35 tqdm
36 ];
37
38 # Native onnxruntime lib used by Python module onnxruntime can't find its other libs without this
39 makeWrapperArgs = [
40 ''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ pkgs.onnxruntime ]}"''
41 ];
42
43 pythonImportsCheck = [
44 "deface"
45 "onnx"
46 "onnxruntime"
47 ];
48
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 };
59}