Commit
·
9063905
1
Parent(s):
5d88cba
add handler
Browse files- create_handler.ipynb +664 -0
- handler.py +47 -0
- requirements.txt +2 -0
create_handler.ipynb
ADDED
@@ -0,0 +1,664 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"## 1. Setup & Installation"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": 1,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [
|
15 |
+
{
|
16 |
+
"name": "stdout",
|
17 |
+
"output_type": "stream",
|
18 |
+
"text": [
|
19 |
+
"Overwriting requirements.txt\n"
|
20 |
+
]
|
21 |
+
}
|
22 |
+
],
|
23 |
+
"source": [
|
24 |
+
"%%writefile requirements.txt\n",
|
25 |
+
"torchaudio\n",
|
26 |
+
"pyannote.audio"
|
27 |
+
]
|
28 |
+
},
|
29 |
+
{
|
30 |
+
"cell_type": "code",
|
31 |
+
"execution_count": 2,
|
32 |
+
"metadata": {},
|
33 |
+
"outputs": [
|
34 |
+
{
|
35 |
+
"name": "stdout",
|
36 |
+
"output_type": "stream",
|
37 |
+
"text": [
|
38 |
+
"Collecting torchaudio\n",
|
39 |
+
" Downloading torchaudio-0.12.1-cp39-cp39-manylinux1_x86_64.whl (3.7 MB)\n",
|
40 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.7/3.7 MB\u001b[0m \u001b[31m95.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n",
|
41 |
+
"\u001b[?25hCollecting pyannote.audio\n",
|
42 |
+
" Downloading pyannote.audio-2.0.1-py2.py3-none-any.whl (385 kB)\n",
|
43 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m385.9/385.9 kB\u001b[0m \u001b[31m47.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
44 |
+
"\u001b[?25hCollecting torch==1.12.1\n",
|
45 |
+
" Using cached torch-1.12.1-cp39-cp39-manylinux1_x86_64.whl (776.4 MB)\n",
|
46 |
+
"Requirement already satisfied: typing-extensions in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from torch==1.12.1->torchaudio->-r requirements.txt (line 1)) (4.3.0)\n",
|
47 |
+
"Collecting pytorch-lightning<1.7,>=1.5.4\n",
|
48 |
+
" Downloading pytorch_lightning-1.6.5-py3-none-any.whl (585 kB)\n",
|
49 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m585.9/585.9 kB\u001b[0m \u001b[31m56.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
50 |
+
"\u001b[?25hCollecting hmmlearn<0.3,>=0.2.7\n",
|
51 |
+
" Downloading hmmlearn-0.2.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (217 kB)\n",
|
52 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m217.2/217.2 kB\u001b[0m \u001b[31m22.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
53 |
+
"\u001b[?25hCollecting torch-audiomentations>=0.11.0\n",
|
54 |
+
" Downloading torch_audiomentations-0.11.0-py3-none-any.whl (47 kB)\n",
|
55 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m47.9/47.9 kB\u001b[0m \u001b[31m5.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
56 |
+
"\u001b[?25hCollecting speechbrain<0.6,>=0.5.12\n",
|
57 |
+
" Downloading speechbrain-0.5.13-py3-none-any.whl (498 kB)\n",
|
58 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m499.0/499.0 kB\u001b[0m \u001b[31m56.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
59 |
+
"\u001b[?25hCollecting singledispatchmethod\n",
|
60 |
+
" Downloading singledispatchmethod-1.0-py2.py3-none-any.whl (4.7 kB)\n",
|
61 |
+
"Collecting torchmetrics<1.0,>=0.6\n",
|
62 |
+
" Downloading torchmetrics-0.10.0-py3-none-any.whl (529 kB)\n",
|
63 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m529.2/529.2 kB\u001b[0m \u001b[31m49.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
64 |
+
"\u001b[?25hCollecting pyannote.pipeline<3.0,>=2.3\n",
|
65 |
+
" Downloading pyannote.pipeline-2.3-py3-none-any.whl (30 kB)\n",
|
66 |
+
"Collecting pyannote.metrics<4.0,>=3.2\n",
|
67 |
+
" Downloading pyannote.metrics-3.2.1-py3-none-any.whl (51 kB)\n",
|
68 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m51.4/51.4 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
69 |
+
"\u001b[?25hCollecting backports.cached-property\n",
|
70 |
+
" Downloading backports.cached_property-1.0.2-py3-none-any.whl (6.1 kB)\n",
|
71 |
+
"Collecting pytorch-metric-learning<2.0,>=1.0.0\n",
|
72 |
+
" Downloading pytorch_metric_learning-1.6.2-py3-none-any.whl (111 kB)\n",
|
73 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m111.4/111.4 kB\u001b[0m \u001b[31m18.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
74 |
+
"\u001b[?25hCollecting networkx<3.0,>=2.6\n",
|
75 |
+
" Downloading networkx-2.8.7-py3-none-any.whl (2.0 MB)\n",
|
76 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━��━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m73.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
77 |
+
"\u001b[?25hCollecting omegaconf<3.0,>=2.1\n",
|
78 |
+
" Downloading omegaconf-2.2.3-py3-none-any.whl (79 kB)\n",
|
79 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m79.3/79.3 kB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
80 |
+
"\u001b[?25hCollecting asteroid-filterbanks<0.5,>=0.4\n",
|
81 |
+
" Downloading asteroid_filterbanks-0.4.0-py3-none-any.whl (29 kB)\n",
|
82 |
+
"Collecting huggingface-hub<0.9,>=0.7\n",
|
83 |
+
" Using cached huggingface_hub-0.8.1-py3-none-any.whl (101 kB)\n",
|
84 |
+
"Requirement already satisfied: soundfile<0.11,>=0.10.2 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pyannote.audio->-r requirements.txt (line 2)) (0.10.3.post1)\n",
|
85 |
+
"Collecting einops<0.4.0,>=0.3\n",
|
86 |
+
" Downloading einops-0.3.2-py3-none-any.whl (25 kB)\n",
|
87 |
+
"Collecting pyannote.core<5.0,>=4.4\n",
|
88 |
+
" Downloading pyannote.core-4.5-py3-none-any.whl (60 kB)\n",
|
89 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.5/60.5 kB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
90 |
+
"\u001b[?25hCollecting pyannote.database<5.0,>=4.1.1\n",
|
91 |
+
" Downloading pyannote.database-4.1.3-py3-none-any.whl (41 kB)\n",
|
92 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m41.6/41.6 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
93 |
+
"\u001b[?25hCollecting semver<3.0,>=2.10.2\n",
|
94 |
+
" Downloading semver-2.13.0-py2.py3-none-any.whl (12 kB)\n",
|
95 |
+
"Requirement already satisfied: numpy in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from asteroid-filterbanks<0.5,>=0.4->pyannote.audio->-r requirements.txt (line 2)) (1.22.4)\n",
|
96 |
+
"Requirement already satisfied: scipy>=0.19 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from hmmlearn<0.3,>=0.2.7->pyannote.audio->-r requirements.txt (line 2)) (1.9.0)\n",
|
97 |
+
"Requirement already satisfied: scikit-learn>=0.16 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from hmmlearn<0.3,>=0.2.7->pyannote.audio->-r requirements.txt (line 2)) (1.1.2)\n",
|
98 |
+
"Requirement already satisfied: requests in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (2.28.1)\n",
|
99 |
+
"Requirement already satisfied: tqdm in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (4.64.0)\n",
|
100 |
+
"Requirement already satisfied: filelock in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (3.8.0)\n",
|
101 |
+
"Requirement already satisfied: packaging>=20.9 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (21.3)\n",
|
102 |
+
"Requirement already satisfied: pyyaml>=5.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (6.0)\n",
|
103 |
+
"Collecting antlr4-python3-runtime==4.9.*\n",
|
104 |
+
" Downloading antlr4-python3-runtime-4.9.3.tar.gz (117 kB)\n",
|
105 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m117.0/117.0 kB\u001b[0m \u001b[31m14.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
106 |
+
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n",
|
107 |
+
"\u001b[?25hRequirement already satisfied: sortedcontainers>=2.0.4 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pyannote.core<5.0,>=4.4->pyannote.audio->-r requirements.txt (line 2)) (2.4.0)\n",
|
108 |
+
"Collecting simplejson>=3.8.1\n",
|
109 |
+
" Downloading simplejson-3.17.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (136 kB)\n",
|
110 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m136.6/136.6 kB\u001b[0m \u001b[31m17.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
111 |
+
"\u001b[?25hRequirement already satisfied: pandas>=0.19 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pyannote.database<5.0,>=4.1.1->pyannote.audio->-r requirements.txt (line 2)) (1.4.3)\n",
|
112 |
+
"Collecting typer[all]>=0.2.1\n",
|
113 |
+
" Downloading typer-0.6.1-py3-none-any.whl (38 kB)\n",
|
114 |
+
"Collecting matplotlib>=2.0.0\n",
|
115 |
+
" Downloading matplotlib-3.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.8 MB)\n",
|
116 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.8/11.8 MB\u001b[0m \u001b[31m72.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
117 |
+
"\u001b[?25hRequirement already satisfied: tabulate>=0.7.7 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pyannote.metrics<4.0,>=3.2->pyannote.audio->-r requirements.txt (line 2)) (0.8.10)\n",
|
118 |
+
"Collecting docopt>=0.6.2\n",
|
119 |
+
" Downloading docopt-0.6.2.tar.gz (25 kB)\n",
|
120 |
+
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
|
121 |
+
"\u001b[?25hRequirement already satisfied: sympy>=1.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pyannote.metrics<4.0,>=3.2->pyannote.audio->-r requirements.txt (line 2)) (1.11.1)\n",
|
122 |
+
"Collecting optuna>=1.4\n",
|
123 |
+
" Downloading optuna-3.0.2-py3-none-any.whl (348 kB)\n",
|
124 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m348.3/348.3 kB\u001b[0m \u001b[31m27.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
125 |
+
"\u001b[?25hRequirement already satisfied: protobuf<=3.20.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (3.19.4)\n",
|
126 |
+
"Requirement already satisfied: tensorboard>=2.2.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (2.10.0)\n",
|
127 |
+
"Collecting pyDeprecate>=0.3.1\n",
|
128 |
+
" Downloading pyDeprecate-0.3.2-py3-none-any.whl (10 kB)\n",
|
129 |
+
"Requirement already satisfied: fsspec[http]!=2021.06.0,>=2021.05.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (2022.7.1)\n",
|
130 |
+
"Requirement already satisfied: torchvision in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pytorch-metric-learning<2.0,>=1.0.0->pyannote.audio->-r requirements.txt (line 2)) (0.12.0+cu113)\n",
|
131 |
+
"Requirement already satisfied: cffi>=1.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from soundfile<0.11,>=0.10.2->pyannote.audio->-r requirements.txt (line 2)) (1.15.1)\n",
|
132 |
+
"Requirement already satisfied: joblib in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from speechbrain<0.6,>=0.5.12->pyannote.audio->-r requirements.txt (line 2)) (1.1.0)\n",
|
133 |
+
"Requirement already satisfied: sentencepiece in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from speechbrain<0.6,>=0.5.12->pyannote.audio->-r requirements.txt (line 2)) (0.1.97)\n",
|
134 |
+
"Collecting hyperpyyaml\n",
|
135 |
+
" Downloading HyperPyYAML-1.0.1.tar.gz (14 kB)\n",
|
136 |
+
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
|
137 |
+
"\u001b[?25hCollecting torch-pitch-shift>=1.2.2\n",
|
138 |
+
" Downloading torch_pitch_shift-1.2.2-py3-none-any.whl (5.0 kB)\n",
|
139 |
+
"Requirement already satisfied: librosa>=0.6.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from torch-audiomentations>=0.11.0->pyannote.audio->-r requirements.txt (line 2)) (0.9.2)\n",
|
140 |
+
"Collecting julius<0.3,>=0.2.3\n",
|
141 |
+
" Downloading julius-0.2.7.tar.gz (59 kB)\n",
|
142 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.6/59.6 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
143 |
+
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n",
|
144 |
+
"\u001b[?25hRequirement already satisfied: pycparser in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from cffi>=1.0->soundfile<0.11,>=0.10.2->pyannote.audio->-r requirements.txt (line 2)) (2.21)\n",
|
145 |
+
"Requirement already satisfied: aiohttp in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from fsspec[http]!=2021.06.0,>=2021.05.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (3.8.1)\n",
|
146 |
+
"Requirement already satisfied: pooch>=1.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from librosa>=0.6.0->torch-audiomentations>=0.11.0->pyannote.audio->-r requirements.txt (line 2)) (1.6.0)\n",
|
147 |
+
"Requirement already satisfied: numba>=0.45.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from librosa>=0.6.0->torch-audiomentations>=0.11.0->pyannote.audio->-r requirements.txt (line 2)) (0.56.0)\n",
|
148 |
+
"Requirement already satisfied: resampy>=0.2.2 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from librosa>=0.6.0->torch-audiomentations>=0.11.0->pyannote.audio->-r requirements.txt (line 2)) (0.4.0)\n",
|
149 |
+
"Requirement already satisfied: audioread>=2.1.9 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from librosa>=0.6.0->torch-audiomentations>=0.11.0->pyannote.audio->-r requirements.txt (line 2)) (3.0.0)\n",
|
150 |
+
"Requirement already satisfied: decorator>=4.0.10 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from librosa>=0.6.0->torch-audiomentations>=0.11.0->pyannote.audio->-r requirements.txt (line 2)) (5.1.1)\n",
|
151 |
+
"Collecting cycler>=0.10\n",
|
152 |
+
" Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)\n",
|
153 |
+
"Requirement already satisfied: python-dateutil>=2.7 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from matplotlib>=2.0.0->pyannote.metrics<4.0,>=3.2->pyannote.audio->-r requirements.txt (line 2)) (2.8.2)\n",
|
154 |
+
"Requirement already satisfied: pillow>=6.2.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from matplotlib>=2.0.0->pyannote.metrics<4.0,>=3.2->pyannote.audio->-r requirements.txt (line 2)) (9.2.0)\n",
|
155 |
+
"Collecting kiwisolver>=1.0.1\n",
|
156 |
+
" Downloading kiwisolver-1.4.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.6 MB)\n",
|
157 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m44.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n",
|
158 |
+
"\u001b[?25hRequirement already satisfied: pyparsing>=2.2.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from matplotlib>=2.0.0->pyannote.metrics<4.0,>=3.2->pyannote.audio->-r requirements.txt (line 2)) (3.0.9)\n",
|
159 |
+
"Collecting contourpy>=1.0.1\n",
|
160 |
+
" Downloading contourpy-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (296 kB)\n",
|
161 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m296.3/296.3 kB\u001b[0m \u001b[31m27.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
162 |
+
"\u001b[?25hCollecting fonttools>=4.22.0\n",
|
163 |
+
" Downloading fonttools-4.37.4-py3-none-any.whl (960 kB)\n",
|
164 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m960.8/960.8 kB\u001b[0m \u001b[31m44.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
165 |
+
"\u001b[?25hCollecting cmaes>=0.8.2\n",
|
166 |
+
" Downloading cmaes-0.8.2-py3-none-any.whl (15 kB)\n",
|
167 |
+
"Collecting sqlalchemy>=1.3.0\n",
|
168 |
+
" Downloading SQLAlchemy-1.4.41-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB)\n",
|
169 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m93.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
170 |
+
"\u001b[?25hCollecting alembic>=1.5.0\n",
|
171 |
+
" Downloading alembic-1.8.1-py3-none-any.whl (209 kB)\n",
|
172 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m209.8/209.8 kB\u001b[0m \u001b[31m19.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
173 |
+
"\u001b[?25hRequirement already satisfied: colorlog in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from optuna>=1.4->pyannote.pipeline<3.0,>=2.3->pyannote.audio->-r requirements.txt (line 2)) (6.6.0)\n",
|
174 |
+
"Collecting cliff\n",
|
175 |
+
" Downloading cliff-4.0.0-py3-none-any.whl (80 kB)\n",
|
176 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m81.0/81.0 kB\u001b[0m \u001b[31m10.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
177 |
+
"\u001b[?25hCollecting scipy>=0.19\n",
|
178 |
+
" Downloading scipy-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.2 MB)\n",
|
179 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m42.2/42.2 MB\u001b[0m \u001b[31m33.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
180 |
+
"\u001b[?25hRequirement already satisfied: pytz>=2020.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pandas>=0.19->pyannote.database<5.0,>=4.1.1->pyannote.audio->-r requirements.txt (line 2)) (2022.2.1)\n",
|
181 |
+
"Requirement already satisfied: threadpoolctl>=2.0.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from scikit-learn>=0.16->hmmlearn<0.3,>=0.2.7->pyannote.audio->-r requirements.txt (line 2)) (3.1.0)\n",
|
182 |
+
"Requirement already satisfied: mpmath>=0.19 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from sympy>=1.1->pyannote.metrics<4.0,>=3.2->pyannote.audio->-r requirements.txt (line 2)) (1.2.1)\n",
|
183 |
+
"Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (1.8.1)\n",
|
184 |
+
"Requirement already satisfied: wheel>=0.26 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (0.37.1)\n",
|
185 |
+
"Requirement already satisfied: werkzeug>=1.0.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (2.2.2)\n",
|
186 |
+
"Requirement already satisfied: setuptools>=41.0.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (65.0.0)\n",
|
187 |
+
"Requirement already satisfied: grpcio>=1.24.3 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (1.47.0)\n",
|
188 |
+
"Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (0.6.1)\n",
|
189 |
+
"Requirement already satisfied: markdown>=2.6.8 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (3.4.1)\n",
|
190 |
+
"Requirement already satisfied: google-auth<3,>=1.6.3 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (2.11.0)\n",
|
191 |
+
"Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (0.4.6)\n",
|
192 |
+
"Requirement already satisfied: absl-py>=0.4 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (1.2.0)\n",
|
193 |
+
"Requirement already satisfied: certifi>=2017.4.17 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from requests->huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (2022.6.15)\n",
|
194 |
+
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from requests->huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (1.26.11)\n",
|
195 |
+
"Requirement already satisfied: idna<4,>=2.5 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from requests->huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (3.3)\n",
|
196 |
+
"Requirement already satisfied: charset-normalizer<3,>=2 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from requests->huggingface-hub<0.9,>=0.7->pyannote.audio->-r requirements.txt (line 2)) (2.1.0)\n",
|
197 |
+
"Collecting primePy>=1.3\n",
|
198 |
+
" Downloading primePy-1.3-py3-none-any.whl (4.0 kB)\n",
|
199 |
+
"Requirement already satisfied: click<9.0.0,>=7.1.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from typer[all]>=0.2.1->pyannote.database<5.0,>=4.1.1->pyannote.audio->-r requirements.txt (line 2)) (8.1.3)\n",
|
200 |
+
"Collecting rich<13.0.0,>=10.11.0\n",
|
201 |
+
" Downloading rich-12.6.0-py3-none-any.whl (237 kB)\n",
|
202 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m237.5/237.5 kB\u001b[0m \u001b[31m25.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
203 |
+
"\u001b[?25hCollecting shellingham<2.0.0,>=1.3.0\n",
|
204 |
+
" Downloading shellingham-1.5.0-py2.py3-none-any.whl (9.3 kB)\n",
|
205 |
+
"Requirement already satisfied: colorama<0.5.0,>=0.4.3 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from typer[all]>=0.2.1->pyannote.database<5.0,>=4.1.1->pyannote.audio->-r requirements.txt (line 2)) (0.4.5)\n",
|
206 |
+
"Collecting ruamel.yaml>=0.17.8\n",
|
207 |
+
" Downloading ruamel.yaml-0.17.21-py3-none-any.whl (109 kB)\n",
|
208 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m109.5/109.5 kB\u001b[0m \u001b[31m9.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
209 |
+
"\u001b[?25hCollecting torchvision\n",
|
210 |
+
" Using cached torchvision-0.13.1-cp39-cp39-manylinux1_x86_64.whl (19.1 MB)\n",
|
211 |
+
"Collecting Mako\n",
|
212 |
+
" Downloading Mako-1.2.3-py3-none-any.whl (78 kB)\n",
|
213 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m78.7/78.7 kB\u001b[0m \u001b[31m9.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
214 |
+
"\u001b[?25hRequirement already satisfied: rsa<5,>=3.1.4 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (4.9)\n",
|
215 |
+
"Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (0.2.8)\n",
|
216 |
+
"Requirement already satisfied: cachetools<6.0,>=2.0.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (5.2.0)\n",
|
217 |
+
"Requirement already satisfied: six>=1.9.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (1.16.0)\n",
|
218 |
+
"Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (1.3.1)\n",
|
219 |
+
"Requirement already satisfied: importlib-metadata>=4.4 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from markdown>=2.6.8->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (4.11.4)\n",
|
220 |
+
"Requirement already satisfied: llvmlite<0.40,>=0.39.0dev0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from numba>=0.45.1->librosa>=0.6.0->torch-audiomentations>=0.11.0->pyannote.audio->-r requirements.txt (line 2)) (0.39.0)\n",
|
221 |
+
"Requirement already satisfied: appdirs>=1.3.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pooch>=1.0->librosa>=0.6.0->torch-audiomentations>=0.11.0->pyannote.audio->-r requirements.txt (line 2)) (1.4.4)\n",
|
222 |
+
"Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from rich<13.0.0,>=10.11.0->typer[all]>=0.2.1->pyannote.database<5.0,>=4.1.1->pyannote.audio->-r requirements.txt (line 2)) (2.12.0)\n",
|
223 |
+
"Collecting commonmark<0.10.0,>=0.9.0\n",
|
224 |
+
" Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)\n",
|
225 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m51.1/51.1 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
226 |
+
"\u001b[?25hCollecting ruamel.yaml.clib>=0.2.6\n",
|
227 |
+
" Downloading ruamel.yaml.clib-0.2.6-cp39-cp39-manylinux1_x86_64.whl (539 kB)\n",
|
228 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m539.7/539.7 kB\u001b[0m \u001b[31m36.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
229 |
+
"\u001b[?25hCollecting greenlet!=0.4.17\n",
|
230 |
+
" Downloading greenlet-1.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (154 kB)\n",
|
231 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m154.1/154.1 kB\u001b[0m \u001b[31m18.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
232 |
+
"\u001b[?25hRequirement already satisfied: MarkupSafe>=2.1.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from werkzeug>=1.0.1->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (2.1.1)\n",
|
233 |
+
"Requirement already satisfied: multidict<7.0,>=4.5 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from aiohttp->fsspec[http]!=2021.06.0,>=2021.05.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (6.0.2)\n",
|
234 |
+
"Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from aiohttp->fsspec[http]!=2021.06.0,>=2021.05.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (4.0.2)\n",
|
235 |
+
"Requirement already satisfied: frozenlist>=1.1.1 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from aiohttp->fsspec[http]!=2021.06.0,>=2021.05.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (1.3.1)\n",
|
236 |
+
"Requirement already satisfied: attrs>=17.3.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from aiohttp->fsspec[http]!=2021.06.0,>=2021.05.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (22.1.0)\n",
|
237 |
+
"Requirement already satisfied: yarl<2.0,>=1.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from aiohttp->fsspec[http]!=2021.06.0,>=2021.05.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (1.8.1)\n",
|
238 |
+
"Requirement already satisfied: aiosignal>=1.1.2 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from aiohttp->fsspec[http]!=2021.06.0,>=2021.05.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (1.2.0)\n",
|
239 |
+
"Collecting autopage>=0.4.0\n",
|
240 |
+
" Downloading autopage-0.5.1-py3-none-any.whl (29 kB)\n",
|
241 |
+
"Collecting cmd2>=1.0.0\n",
|
242 |
+
" Downloading cmd2-2.4.2-py3-none-any.whl (147 kB)\n",
|
243 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m147.1/147.1 kB\u001b[0m \u001b[31m7.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
244 |
+
"\u001b[?25hCollecting stevedore>=2.0.1\n",
|
245 |
+
" Downloading stevedore-4.0.0-py3-none-any.whl (49 kB)\n",
|
246 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.5/49.5 kB\u001b[0m \u001b[31m5.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
247 |
+
"\u001b[?25hCollecting PrettyTable>=0.7.2\n",
|
248 |
+
" Downloading prettytable-3.4.1-py3-none-any.whl (26 kB)\n",
|
249 |
+
"Requirement already satisfied: wcwidth>=0.1.7 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from cmd2>=1.0.0->cliff->optuna>=1.4->pyannote.pipeline<3.0,>=2.3->pyannote.audio->-r requirements.txt (line 2)) (0.2.5)\n",
|
250 |
+
"Collecting pyperclip>=1.6\n",
|
251 |
+
" Downloading pyperclip-1.8.2.tar.gz (20 kB)\n",
|
252 |
+
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
|
253 |
+
"\u001b[?25hRequirement already satisfied: zipp>=0.5 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (3.8.1)\n",
|
254 |
+
"Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (0.4.8)\n",
|
255 |
+
"Requirement already satisfied: oauthlib>=3.0.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard>=2.2.0->pytorch-lightning<1.7,>=1.5.4->pyannote.audio->-r requirements.txt (line 2)) (3.2.0)\n",
|
256 |
+
"Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /home/ubuntu/miniconda/envs/dev/lib/python3.9/site-packages (from stevedore>=2.0.1->cliff->optuna>=1.4->pyannote.pipeline<3.0,>=2.3->pyannote.audio->-r requirements.txt (line 2)) (5.10.0)\n",
|
257 |
+
"Building wheels for collected packages: antlr4-python3-runtime, docopt, julius, hyperpyyaml, pyperclip\n",
|
258 |
+
" Building wheel for antlr4-python3-runtime (setup.py) ... \u001b[?25ldone\n",
|
259 |
+
"\u001b[?25h Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144554 sha256=66a81504d29d763868c1dfe04d45cca872f78e97b7b92112e556731e2cab617d\n",
|
260 |
+
" Stored in directory: /home/ubuntu/.cache/pip/wheels/23/cf/80/f3efa822e6ab23277902ee9165fe772eeb1dfb8014f359020a\n",
|
261 |
+
" Building wheel for docopt (setup.py) ... \u001b[?25ldone\n",
|
262 |
+
"\u001b[?25h Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=13706 sha256=3805c1a127c79f3a81ed6be5ddee9d3313fd0aa7107216896e89e5cecf2bbe27\n",
|
263 |
+
" Stored in directory: /home/ubuntu/.cache/pip/wheels/70/4a/46/1309fc853b8d395e60bafaf1b6df7845bdd82c95fd59dd8d2b\n",
|
264 |
+
" Building wheel for julius (setup.py) ... \u001b[?25ldone\n",
|
265 |
+
"\u001b[?25h Created wheel for julius: filename=julius-0.2.7-py3-none-any.whl size=21878 sha256=bf68d9142aaa911aa76fec8e020953044482054bd72a37b2f7c4a18e77edb1b0\n",
|
266 |
+
" Stored in directory: /home/ubuntu/.cache/pip/wheels/53/0a/a7/fc08f97438f4969d86afa7904336c2eb7eb422101359f3ad11\n",
|
267 |
+
" Building wheel for hyperpyyaml (setup.py) ... \u001b[?25ldone\n",
|
268 |
+
"\u001b[?25h Created wheel for hyperpyyaml: filename=HyperPyYAML-1.0.1-py3-none-any.whl size=15174 sha256=4c1e243d17ff4f7740e60bbe69d33602ef80a0011868ac15fc5b1dbc63ad5c70\n",
|
269 |
+
" Stored in directory: /home/ubuntu/.cache/pip/wheels/c2/bb/de/befc66499e9c2b4b8b163e018abcace61c80220e6a28950a65\n",
|
270 |
+
" Building wheel for pyperclip (setup.py) ... \u001b[?25ldone\n",
|
271 |
+
"\u001b[?25h Created wheel for pyperclip: filename=pyperclip-1.8.2-py3-none-any.whl size=11123 sha256=a6734b9b91c358d2e5d4e4c3c8e8d0a02f2aab94ecca213c41935d81630367e8\n",
|
272 |
+
" Stored in directory: /home/ubuntu/.cache/pip/wheels/0c/09/9e/49e21a6840ef7955b06d47394afef0058f0378c0914e48b8b8\n",
|
273 |
+
"Successfully built antlr4-python3-runtime docopt julius hyperpyyaml pyperclip\n",
|
274 |
+
"Installing collected packages: singledispatchmethod, pyperclip, primePy, einops, docopt, commonmark, antlr4-python3-runtime, typer, torch, stevedore, simplejson, shellingham, semver, scipy, ruamel.yaml.clib, rich, pyDeprecate, PrettyTable, omegaconf, networkx, Mako, kiwisolver, greenlet, fonttools, cycler, contourpy, cmd2, cmaes, backports.cached-property, autopage, torchvision, torchmetrics, torchaudio, sqlalchemy, ruamel.yaml, pyannote.core, matplotlib, julius, huggingface-hub, cliff, asteroid-filterbanks, torch-pitch-shift, pytorch-metric-learning, pyannote.database, hyperpyyaml, hmmlearn, alembic, torch-audiomentations, speechbrain, pyannote.metrics, optuna, pytorch-lightning, pyannote.pipeline, pyannote.audio\n",
|
275 |
+
" Attempting uninstall: torch\n",
|
276 |
+
" Found existing installation: torch 1.11.0+cu113\n",
|
277 |
+
" Uninstalling torch-1.11.0+cu113:\n",
|
278 |
+
" Successfully uninstalled torch-1.11.0+cu113\n",
|
279 |
+
" Attempting uninstall: scipy\n",
|
280 |
+
" Found existing installation: scipy 1.9.0\n",
|
281 |
+
" Uninstalling scipy-1.9.0:\n",
|
282 |
+
" Successfully uninstalled scipy-1.9.0\n",
|
283 |
+
" Attempting uninstall: torchvision\n",
|
284 |
+
" Found existing installation: torchvision 0.12.0+cu113\n",
|
285 |
+
" Uninstalling torchvision-0.12.0+cu113:\n",
|
286 |
+
" Successfully uninstalled torchvision-0.12.0+cu113\n",
|
287 |
+
" Attempting uninstall: huggingface-hub\n",
|
288 |
+
" Found existing installation: huggingface-hub 0.9.0\n",
|
289 |
+
" Uninstalling huggingface-hub-0.9.0:\n",
|
290 |
+
" Successfully uninstalled huggingface-hub-0.9.0\n",
|
291 |
+
"\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
|
292 |
+
"huggingface-inference-toolkit 0.1.0 requires torchvision<=0.12.0, but you have torchvision 0.13.1 which is incompatible.\u001b[0m\u001b[31m\n",
|
293 |
+
"\u001b[0mSuccessfully installed Mako-1.2.3 PrettyTable-3.4.1 alembic-1.8.1 antlr4-python3-runtime-4.9.3 asteroid-filterbanks-0.4.0 autopage-0.5.1 backports.cached-property-1.0.2 cliff-4.0.0 cmaes-0.8.2 cmd2-2.4.2 commonmark-0.9.1 contourpy-1.0.5 cycler-0.11.0 docopt-0.6.2 einops-0.3.2 fonttools-4.37.4 greenlet-1.1.3 hmmlearn-0.2.8 huggingface-hub-0.8.1 hyperpyyaml-1.0.1 julius-0.2.7 kiwisolver-1.4.4 matplotlib-3.6.0 networkx-2.8.7 omegaconf-2.2.3 optuna-3.0.2 primePy-1.3 pyDeprecate-0.3.2 pyannote.audio-2.0.1 pyannote.core-4.5 pyannote.database-4.1.3 pyannote.metrics-3.2.1 pyannote.pipeline-2.3 pyperclip-1.8.2 pytorch-lightning-1.6.5 pytorch-metric-learning-1.6.2 rich-12.6.0 ruamel.yaml-0.17.21 ruamel.yaml.clib-0.2.6 scipy-1.8.1 semver-2.13.0 shellingham-1.5.0 simplejson-3.17.6 singledispatchmethod-1.0 speechbrain-0.5.13 sqlalchemy-1.4.41 stevedore-4.0.0 torch-1.12.1 torch-audiomentations-0.11.0 torch-pitch-shift-1.2.2 torchaudio-0.12.1 torchmetrics-0.10.0 torchvision-0.13.1 typer-0.6.1\n"
|
294 |
+
]
|
295 |
+
}
|
296 |
+
],
|
297 |
+
"source": [
|
298 |
+
"!pip install -r requirements.txt --upgrade"
|
299 |
+
]
|
300 |
+
},
|
301 |
+
{
|
302 |
+
"cell_type": "code",
|
303 |
+
"execution_count": 3,
|
304 |
+
"metadata": {},
|
305 |
+
"outputs": [
|
306 |
+
{
|
307 |
+
"data": {
|
308 |
+
"application/vnd.jupyter.widget-view+json": {
|
309 |
+
"model_id": "9caf5b409e794ecea978b87f399cf3f1",
|
310 |
+
"version_major": 2,
|
311 |
+
"version_minor": 0
|
312 |
+
},
|
313 |
+
"text/plain": [
|
314 |
+
"Downloading: 0%| | 0.00/598 [00:00<?, ?B/s]"
|
315 |
+
]
|
316 |
+
},
|
317 |
+
"metadata": {},
|
318 |
+
"output_type": "display_data"
|
319 |
+
},
|
320 |
+
{
|
321 |
+
"data": {
|
322 |
+
"application/vnd.jupyter.widget-view+json": {
|
323 |
+
"model_id": "0072f6911e7d402ea0fd0437c7841ddb",
|
324 |
+
"version_major": 2,
|
325 |
+
"version_minor": 0
|
326 |
+
},
|
327 |
+
"text/plain": [
|
328 |
+
"Downloading: 0%| | 0.00/17.7M [00:00<?, ?B/s]"
|
329 |
+
]
|
330 |
+
},
|
331 |
+
"metadata": {},
|
332 |
+
"output_type": "display_data"
|
333 |
+
},
|
334 |
+
{
|
335 |
+
"data": {
|
336 |
+
"application/vnd.jupyter.widget-view+json": {
|
337 |
+
"model_id": "2fff59eb41574f1aa5e159ced85b98a4",
|
338 |
+
"version_major": 2,
|
339 |
+
"version_minor": 0
|
340 |
+
},
|
341 |
+
"text/plain": [
|
342 |
+
"Downloading: 0%| | 0.00/318 [00:00<?, ?B/s]"
|
343 |
+
]
|
344 |
+
},
|
345 |
+
"metadata": {},
|
346 |
+
"output_type": "display_data"
|
347 |
+
},
|
348 |
+
{
|
349 |
+
"data": {
|
350 |
+
"application/vnd.jupyter.widget-view+json": {
|
351 |
+
"model_id": "a880484a957642faa87db557521f3cee",
|
352 |
+
"version_major": 2,
|
353 |
+
"version_minor": 0
|
354 |
+
},
|
355 |
+
"text/plain": [
|
356 |
+
"Downloading: 0%| | 0.00/1.92k [00:00<?, ?B/s]"
|
357 |
+
]
|
358 |
+
},
|
359 |
+
"metadata": {},
|
360 |
+
"output_type": "display_data"
|
361 |
+
},
|
362 |
+
{
|
363 |
+
"data": {
|
364 |
+
"application/vnd.jupyter.widget-view+json": {
|
365 |
+
"model_id": "c655e7a82a354464aa0a82dee1eaf35f",
|
366 |
+
"version_major": 2,
|
367 |
+
"version_minor": 0
|
368 |
+
},
|
369 |
+
"text/plain": [
|
370 |
+
"Downloading: 0%| | 0.00/83.3M [00:00<?, ?B/s]"
|
371 |
+
]
|
372 |
+
},
|
373 |
+
"metadata": {},
|
374 |
+
"output_type": "display_data"
|
375 |
+
},
|
376 |
+
{
|
377 |
+
"data": {
|
378 |
+
"application/vnd.jupyter.widget-view+json": {
|
379 |
+
"model_id": "b3b18c63fb344e9986502276819a1aab",
|
380 |
+
"version_major": 2,
|
381 |
+
"version_minor": 0
|
382 |
+
},
|
383 |
+
"text/plain": [
|
384 |
+
"Downloading: 0%| | 0.00/1.92k [00:00<?, ?B/s]"
|
385 |
+
]
|
386 |
+
},
|
387 |
+
"metadata": {},
|
388 |
+
"output_type": "display_data"
|
389 |
+
},
|
390 |
+
{
|
391 |
+
"data": {
|
392 |
+
"application/vnd.jupyter.widget-view+json": {
|
393 |
+
"model_id": "92af59a51c314e6cb1915cadd2ab9a03",
|
394 |
+
"version_major": 2,
|
395 |
+
"version_minor": 0
|
396 |
+
},
|
397 |
+
"text/plain": [
|
398 |
+
"Downloading: 0%| | 0.00/5.53M [00:00<?, ?B/s]"
|
399 |
+
]
|
400 |
+
},
|
401 |
+
"metadata": {},
|
402 |
+
"output_type": "display_data"
|
403 |
+
},
|
404 |
+
{
|
405 |
+
"data": {
|
406 |
+
"application/vnd.jupyter.widget-view+json": {
|
407 |
+
"model_id": "63adf3749baa487096fc6f281f635d85",
|
408 |
+
"version_major": 2,
|
409 |
+
"version_minor": 0
|
410 |
+
},
|
411 |
+
"text/plain": [
|
412 |
+
"Downloading: 0%| | 0.00/129k [00:00<?, ?B/s]"
|
413 |
+
]
|
414 |
+
},
|
415 |
+
"metadata": {},
|
416 |
+
"output_type": "display_data"
|
417 |
+
},
|
418 |
+
{
|
419 |
+
"name": "stdout",
|
420 |
+
"output_type": "stream",
|
421 |
+
"text": [
|
422 |
+
"start=0.5s stop=1.4s speaker_SPEAKER_01\n",
|
423 |
+
"start=1.9s stop=2.8s speaker_SPEAKER_01\n",
|
424 |
+
"start=3.0s stop=3.5s speaker_SPEAKER_02\n",
|
425 |
+
"start=3.6s stop=4.3s speaker_SPEAKER_01\n",
|
426 |
+
"start=4.6s stop=6.8s speaker_SPEAKER_02\n",
|
427 |
+
"start=7.1s stop=7.6s speaker_SPEAKER_00\n",
|
428 |
+
"start=7.6s stop=9.5s speaker_SPEAKER_02\n",
|
429 |
+
"start=9.8s stop=10.6s speaker_SPEAKER_02\n",
|
430 |
+
"start=9.9s stop=10.4s speaker_SPEAKER_00\n",
|
431 |
+
"start=12.4s stop=15.6s speaker_SPEAKER_03\n",
|
432 |
+
"start=15.8s stop=16.1s speaker_SPEAKER_00\n",
|
433 |
+
"start=16.1s stop=16.2s speaker_SPEAKER_01\n",
|
434 |
+
"start=17.2s stop=17.4s speaker_SPEAKER_00\n",
|
435 |
+
"start=17.7s stop=20.4s speaker_SPEAKER_01\n",
|
436 |
+
"start=20.6s stop=20.7s speaker_SPEAKER_01\n",
|
437 |
+
"start=20.7s stop=20.8s speaker_SPEAKER_00\n",
|
438 |
+
"start=20.8s stop=20.9s speaker_SPEAKER_01\n",
|
439 |
+
"start=21.1s stop=22.1s speaker_SPEAKER_01\n",
|
440 |
+
"start=22.5s stop=22.7s speaker_SPEAKER_02\n",
|
441 |
+
"start=23.2s stop=23.5s speaker_SPEAKER_02\n",
|
442 |
+
"start=23.5s stop=24.0s speaker_SPEAKER_01\n",
|
443 |
+
"start=24.3s stop=25.5s speaker_SPEAKER_02\n",
|
444 |
+
"start=25.8s stop=27.3s speaker_SPEAKER_01\n",
|
445 |
+
"start=27.3s stop=27.5s speaker_SPEAKER_02\n",
|
446 |
+
"start=29.7s stop=30.0s speaker_SPEAKER_01\n"
|
447 |
+
]
|
448 |
+
}
|
449 |
+
],
|
450 |
+
"source": [
|
451 |
+
"from pyannote.audio import Pipeline\n",
|
452 |
+
"pipeline = Pipeline.from_pretrained(\"pyannote/speaker-diarization\")\n",
|
453 |
+
"\n"
|
454 |
+
]
|
455 |
+
},
|
456 |
+
{
|
457 |
+
"cell_type": "code",
|
458 |
+
"execution_count": 7,
|
459 |
+
"metadata": {},
|
460 |
+
"outputs": [],
|
461 |
+
"source": [
|
462 |
+
"from transformers.pipelines.audio_utils import ffmpeg_read\n",
|
463 |
+
"import torch\n",
|
464 |
+
"\n",
|
465 |
+
"\n",
|
466 |
+
"\n",
|
467 |
+
"\n",
|
468 |
+
"audio_nparray = ffmpeg_read(request[\"inputs\"], 16000)\n",
|
469 |
+
"audio_tensor= torch.from_numpy(audio_nparray).unsqueeze(0)\n",
|
470 |
+
"f = {\"waveform\": audio_tensor, \"sample_rate\": 16000}"
|
471 |
+
]
|
472 |
+
},
|
473 |
+
{
|
474 |
+
"cell_type": "markdown",
|
475 |
+
"metadata": {},
|
476 |
+
"source": [
|
477 |
+
"## 2. Create Custom Handler for Inference Endpoints\n"
|
478 |
+
]
|
479 |
+
},
|
480 |
+
{
|
481 |
+
"cell_type": "code",
|
482 |
+
"execution_count": 8,
|
483 |
+
"metadata": {},
|
484 |
+
"outputs": [
|
485 |
+
{
|
486 |
+
"name": "stdout",
|
487 |
+
"output_type": "stream",
|
488 |
+
"text": [
|
489 |
+
"Overwriting handler.py\n"
|
490 |
+
]
|
491 |
+
}
|
492 |
+
],
|
493 |
+
"source": [
|
494 |
+
"%%writefile handler.py\n",
|
495 |
+
"from typing import Dict\n",
|
496 |
+
"from pyannote.audio import Pipeline\n",
|
497 |
+
"from transformers.pipelines.audio_utils import ffmpeg_read\n",
|
498 |
+
"import torch \n",
|
499 |
+
"\n",
|
500 |
+
"SAMPLE_RATE = 16000\n",
|
501 |
+
"\n",
|
502 |
+
"\n",
|
503 |
+
"\n",
|
504 |
+
"class EndpointHandler():\n",
|
505 |
+
" def __init__(self, path=\"\"):\n",
|
506 |
+
" # load the model\n",
|
507 |
+
" self.pipeline = Pipeline.from_pretrained(\"pyannote/speaker-diarization\")\n",
|
508 |
+
"\n",
|
509 |
+
"\n",
|
510 |
+
" def __call__(self, data: Dict[str, bytes]) -> Dict[str, str]:\n",
|
511 |
+
" \"\"\"\n",
|
512 |
+
" Args:\n",
|
513 |
+
" data (:obj:):\n",
|
514 |
+
" includes the deserialized audio file as bytes\n",
|
515 |
+
" Return:\n",
|
516 |
+
" A :obj:`dict`:. base64 encoded image\n",
|
517 |
+
" \"\"\"\n",
|
518 |
+
" # process input\n",
|
519 |
+
" inputs = data.pop(\"inputs\", data)\n",
|
520 |
+
" parameters = data.pop(\"parameters\", None) # min_speakers=2, max_speakers=5\n",
|
521 |
+
"\n",
|
522 |
+
" \n",
|
523 |
+
" # prepare pynannote input\n",
|
524 |
+
" audio_nparray = ffmpeg_read(inputs, SAMPLE_RATE)\n",
|
525 |
+
" audio_tensor= torch.from_numpy(audio_nparray).unsqueeze(0)\n",
|
526 |
+
" pyannote_input = {\"waveform\": audio_tensor, \"sample_rate\": SAMPLE_RATE}\n",
|
527 |
+
" \n",
|
528 |
+
" # apply pretrained pipeline\n",
|
529 |
+
" # pass inputs with all kwargs in data\n",
|
530 |
+
" if parameters is not None:\n",
|
531 |
+
" diarization = self.pipeline(pyannote_input, **parameters)\n",
|
532 |
+
" else:\n",
|
533 |
+
" diarization = self.pipeline(pyannote_input)\n",
|
534 |
+
"\n",
|
535 |
+
" # postprocess the prediction\n",
|
536 |
+
" processed_diarization = [\n",
|
537 |
+
" {\"label\": str(label), \"start\": str(segment.start), \"stop\": str(segment.end)}\n",
|
538 |
+
" for segment, _, label in diarization.itertracks(yield_label=True)\n",
|
539 |
+
" ]\n",
|
540 |
+
" \n",
|
541 |
+
" return {\"diarization\": processed_diarization}"
|
542 |
+
]
|
543 |
+
},
|
544 |
+
{
|
545 |
+
"cell_type": "markdown",
|
546 |
+
"metadata": {},
|
547 |
+
"source": [
|
548 |
+
"test custom pipeline"
|
549 |
+
]
|
550 |
+
},
|
551 |
+
{
|
552 |
+
"cell_type": "code",
|
553 |
+
"execution_count": 1,
|
554 |
+
"metadata": {},
|
555 |
+
"outputs": [],
|
556 |
+
"source": [
|
557 |
+
"from handler import EndpointHandler\n",
|
558 |
+
"\n",
|
559 |
+
"# init handler\n",
|
560 |
+
"my_handler = EndpointHandler(path=\".\")"
|
561 |
+
]
|
562 |
+
},
|
563 |
+
{
|
564 |
+
"cell_type": "code",
|
565 |
+
"execution_count": 2,
|
566 |
+
"metadata": {},
|
567 |
+
"outputs": [],
|
568 |
+
"source": [
|
569 |
+
"import base64\n",
|
570 |
+
"from PIL import Image\n",
|
571 |
+
"from io import BytesIO\n",
|
572 |
+
"import json\n",
|
573 |
+
"\n",
|
574 |
+
"# file reader\n",
|
575 |
+
"with open(\"sample.wav\", \"rb\") as f:\n",
|
576 |
+
" request = {\"inputs\": f.read()}\n",
|
577 |
+
"\n",
|
578 |
+
"# test the handler\n",
|
579 |
+
"pred = my_handler(request)"
|
580 |
+
]
|
581 |
+
},
|
582 |
+
{
|
583 |
+
"cell_type": "code",
|
584 |
+
"execution_count": 3,
|
585 |
+
"metadata": {},
|
586 |
+
"outputs": [
|
587 |
+
{
|
588 |
+
"data": {
|
589 |
+
"text/plain": [
|
590 |
+
"{'diarization': [{'label': 'SPEAKER_01',\n",
|
591 |
+
" 'start': '0.4978125',\n",
|
592 |
+
" 'stop': '1.3921875'},\n",
|
593 |
+
" {'label': 'SPEAKER_01', 'start': '1.8984375', 'stop': '2.7590624999999998'},\n",
|
594 |
+
" {'label': 'SPEAKER_02', 'start': '2.9953125', 'stop': '3.5015625000000004'},\n",
|
595 |
+
" {'label': 'SPEAKER_01',\n",
|
596 |
+
" 'start': '3.5690625000000002',\n",
|
597 |
+
" 'stop': '4.311562500000001'},\n",
|
598 |
+
" {'label': 'SPEAKER_02', 'start': '4.6153125', 'stop': '6.7753125'},\n",
|
599 |
+
" {'label': 'SPEAKER_00', 'start': '7.1128125', 'stop': '7.551562500000001'},\n",
|
600 |
+
" {'label': 'SPEAKER_02',\n",
|
601 |
+
" 'start': '7.551562500000001',\n",
|
602 |
+
" 'stop': '9.475312500000001'},\n",
|
603 |
+
" {'label': 'SPEAKER_02',\n",
|
604 |
+
" 'start': '9.812812500000003',\n",
|
605 |
+
" 'stop': '10.555312500000003'},\n",
|
606 |
+
" {'label': 'SPEAKER_00',\n",
|
607 |
+
" 'start': '9.863437500000003',\n",
|
608 |
+
" 'stop': '10.420312500000001'},\n",
|
609 |
+
" {'label': 'SPEAKER_03', 'start': '12.411562500000002', 'stop': '15.5503125'},\n",
|
610 |
+
" {'label': 'SPEAKER_00', 'start': '15.786562500000002', 'stop': '16.1409375'},\n",
|
611 |
+
" {'label': 'SPEAKER_01', 'start': '16.1409375', 'stop': '16.1578125'},\n",
|
612 |
+
" {'label': 'SPEAKER_00', 'start': '17.1534375', 'stop': '17.4234375'},\n",
|
613 |
+
" {'label': 'SPEAKER_01', 'start': '17.7440625', 'stop': '20.3596875'},\n",
|
614 |
+
" {'label': 'SPEAKER_01', 'start': '20.6128125', 'stop': '20.6634375'},\n",
|
615 |
+
" {'label': 'SPEAKER_00', 'start': '20.6634375', 'stop': '20.8490625'},\n",
|
616 |
+
" {'label': 'SPEAKER_01', 'start': '20.8490625', 'stop': '20.8828125'},\n",
|
617 |
+
" {'label': 'SPEAKER_01', 'start': '21.1021875', 'stop': '22.1315625'},\n",
|
618 |
+
" {'label': 'SPEAKER_02', 'start': '22.4521875', 'stop': '22.7053125'},\n",
|
619 |
+
" {'label': 'SPEAKER_02', 'start': '23.2115625', 'stop': '23.4815625'},\n",
|
620 |
+
" {'label': 'SPEAKER_01', 'start': '23.4815625', 'stop': '24.0215625'},\n",
|
621 |
+
" {'label': 'SPEAKER_02', 'start': '24.3253125', 'stop': '25.5065625'},\n",
|
622 |
+
" {'label': 'SPEAKER_01', 'start': '25.8440625', 'stop': '27.3121875'},\n",
|
623 |
+
" {'label': 'SPEAKER_02', 'start': '27.3121875', 'stop': '27.4978125'},\n",
|
624 |
+
" {'label': 'SPEAKER_01', 'start': '29.7253125', 'stop': '29.9615625'}]}"
|
625 |
+
]
|
626 |
+
},
|
627 |
+
"execution_count": 3,
|
628 |
+
"metadata": {},
|
629 |
+
"output_type": "execute_result"
|
630 |
+
}
|
631 |
+
],
|
632 |
+
"source": [
|
633 |
+
"pred"
|
634 |
+
]
|
635 |
+
}
|
636 |
+
],
|
637 |
+
"metadata": {
|
638 |
+
"kernelspec": {
|
639 |
+
"display_name": "Python 3.9.13 ('dev': conda)",
|
640 |
+
"language": "python",
|
641 |
+
"name": "python3"
|
642 |
+
},
|
643 |
+
"language_info": {
|
644 |
+
"codemirror_mode": {
|
645 |
+
"name": "ipython",
|
646 |
+
"version": 3
|
647 |
+
},
|
648 |
+
"file_extension": ".py",
|
649 |
+
"mimetype": "text/x-python",
|
650 |
+
"name": "python",
|
651 |
+
"nbconvert_exporter": "python",
|
652 |
+
"pygments_lexer": "ipython3",
|
653 |
+
"version": "3.9.13"
|
654 |
+
},
|
655 |
+
"orig_nbformat": 4,
|
656 |
+
"vscode": {
|
657 |
+
"interpreter": {
|
658 |
+
"hash": "f6dd96c16031089903d5a31ec148b80aeb0d39c32affb1a1080393235fbfa2fc"
|
659 |
+
}
|
660 |
+
}
|
661 |
+
},
|
662 |
+
"nbformat": 4,
|
663 |
+
"nbformat_minor": 2
|
664 |
+
}
|
handler.py
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Dict
|
2 |
+
from pyannote.audio import Pipeline
|
3 |
+
from transformers.pipelines.audio_utils import ffmpeg_read
|
4 |
+
import torch
|
5 |
+
|
6 |
+
SAMPLE_RATE = 16000
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
class EndpointHandler():
|
11 |
+
def __init__(self, path=""):
|
12 |
+
# load the model
|
13 |
+
self.pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
|
14 |
+
|
15 |
+
|
16 |
+
def __call__(self, data: Dict[str, bytes]) -> Dict[str, str]:
|
17 |
+
"""
|
18 |
+
Args:
|
19 |
+
data (:obj:):
|
20 |
+
includes the deserialized audio file as bytes
|
21 |
+
Return:
|
22 |
+
A :obj:`dict`:. base64 encoded image
|
23 |
+
"""
|
24 |
+
# process input
|
25 |
+
inputs = data.pop("inputs", data)
|
26 |
+
parameters = data.pop("parameters", None) # min_speakers=2, max_speakers=5
|
27 |
+
|
28 |
+
|
29 |
+
# prepare pynannote input
|
30 |
+
audio_nparray = ffmpeg_read(inputs, SAMPLE_RATE)
|
31 |
+
audio_tensor= torch.from_numpy(audio_nparray).unsqueeze(0)
|
32 |
+
pyannote_input = {"waveform": audio_tensor, "sample_rate": SAMPLE_RATE}
|
33 |
+
|
34 |
+
# apply pretrained pipeline
|
35 |
+
# pass inputs with all kwargs in data
|
36 |
+
if parameters is not None:
|
37 |
+
diarization = self.pipeline(pyannote_input, **parameters)
|
38 |
+
else:
|
39 |
+
diarization = self.pipeline(pyannote_input)
|
40 |
+
|
41 |
+
# postprocess the prediction
|
42 |
+
processed_diarization = [
|
43 |
+
{"label": str(label), "start": str(segment.start), "stop": str(segment.end)}
|
44 |
+
for segment, _, label in diarization.itertracks(yield_label=True)
|
45 |
+
]
|
46 |
+
|
47 |
+
return {"diarization": processed_diarization}
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
torchaudio
|
2 |
+
pyannote.audio
|