about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyannote-audio/default.nix
blob: 9f4510785b0f8c7167d4a63383a07fdff9accbb7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  wheel,
  asteroid-filterbanks,
  einops,
  huggingface-hub,
  pytorch-lightning,
  omegaconf,
  pyannote-core,
  pyannote-database,
  pyannote-metrics,
  pyannote-pipeline,
  pytorch-metric-learning,
  rich,
  semver,
  soundfile,
  speechbrain,
  tensorboardx,
  torch,
  torch-audiomentations,
  torchaudio,
  torchmetrics,
  numpy,
  pyscaffold,
}:

buildPythonPackage rec {
  pname = "pyannote-audio";
  version = "3.3.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pyannote";
    repo = "pyannote-audio";
    rev = "refs/tags/${version}";
    hash = "sha256-AFBT6vpOgEIqEn778TWJ04gai7UOyfOeZdmtliYJLvs=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    pyscaffold
    setuptools
    wheel
  ];

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "pyscaffold>=3.2a0,<3.3a0" "pyscaffold"
    substituteInPlace requirements.txt \
      --replace "lightning" "pytorch-lightning"
  '';

  propagatedBuildInputs = [
    asteroid-filterbanks
    einops
    huggingface-hub
    omegaconf
    pyannote-core
    pyannote-database
    pyannote-metrics
    pyannote-pipeline
    pytorch-metric-learning
    rich
    semver
    soundfile
    speechbrain
    tensorboardx
    torch
    torch-audiomentations
    torchaudio
    torchmetrics
    numpy
    pytorch-lightning
  ];

  pythonImportsCheck = [ "pyannote.audio" ];

  meta = with lib; {
    description = "Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding";
    homepage = "https://github.com/pyannote/pyannote-audio";
    changelog = "https://github.com/pyannote/pyannote-audio/blob/${src.rev}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
}