1{
2 lib,
3 asteroid-filterbanks,
4 buildPythonPackage,
5 einops,
6 fetchFromGitHub,
7 huggingface-hub,
8 hydra-core,
9 numpy,
10 omegaconf,
11 pyannote-core,
12 pyannote-database,
13 pyannote-metrics,
14 pyannote-pipeline,
15 pyscaffold,
16 pythonOlder,
17 pytorch-lightning,
18 pytorch-metric-learning,
19 rich,
20 semver,
21 setuptools,
22 soundfile,
23 speechbrain,
24 tensorboardx,
25 torch-audiomentations,
26 torch,
27 torchaudio,
28 torchmetrics,
29 typer,
30}:
31
32buildPythonPackage rec {
33 pname = "pyannote-audio";
34 version = "3.4.0";
35 pyproject = true;
36
37 disabled = pythonOlder "3.9";
38
39 src = fetchFromGitHub {
40 owner = "pyannote";
41 repo = "pyannote-audio";
42 tag = version;
43 hash = "sha256-NnwJJasObePBYWBnuVzOLFz2eqOHoOA6W5CzAEpkDV4=";
44 fetchSubmodules = true;
45 };
46
47 pythonRelaxDeps = [ "torchaudio" ];
48
49 build-system = [
50 pyscaffold
51 setuptools
52 ];
53
54 postPatch = ''
55 substituteInPlace setup.cfg \
56 --replace-fail "pyscaffold>=3.2a0,<3.3a0" "pyscaffold"
57 substituteInPlace requirements.txt \
58 --replace-fail "lightning" "pytorch-lightning"
59 '';
60
61 dependencies = [
62 asteroid-filterbanks
63 einops
64 huggingface-hub
65 omegaconf
66 pyannote-core
67 pyannote-database
68 pyannote-metrics
69 pyannote-pipeline
70 pytorch-metric-learning
71 rich
72 semver
73 soundfile
74 speechbrain
75 tensorboardx
76 torch
77 torch-audiomentations
78 torchaudio
79 torchmetrics
80 numpy
81 pytorch-lightning
82 ];
83
84 optional-dependencies = {
85 cli = [
86 hydra-core
87 typer
88 ];
89 };
90
91 pythonImportsCheck = [ "pyannote.audio" ];
92
93 meta = with lib; {
94 description = "Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding";
95 homepage = "https://github.com/pyannote/pyannote-audio";
96 changelog = "https://github.com/pyannote/pyannote-audio/blob/${src.rev}/CHANGELOG.md";
97 license = licenses.mit;
98 maintainers = [ ];
99 };
100}