File size: 49,641 Bytes
9063905
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. Setup & Installation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting requirements.txt\n"
     ]
    }
   ],
   "source": [
    "%%writefile requirements.txt\n",
    "torchaudio\n",
    "pyannote.audio"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting torchaudio\n",
      "  Downloading torchaudio-0.12.1-cp39-cp39-manylinux1_x86_64.whl (3.7 MB)\n",
      "\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",
      "\u001b[?25hCollecting pyannote.audio\n",
      "  Downloading pyannote.audio-2.0.1-py2.py3-none-any.whl (385 kB)\n",
      "\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",
      "\u001b[?25hCollecting torch==1.12.1\n",
      "  Using cached torch-1.12.1-cp39-cp39-manylinux1_x86_64.whl (776.4 MB)\n",
      "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",
      "Collecting pytorch-lightning<1.7,>=1.5.4\n",
      "  Downloading pytorch_lightning-1.6.5-py3-none-any.whl (585 kB)\n",
      "\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",
      "\u001b[?25hCollecting hmmlearn<0.3,>=0.2.7\n",
      "  Downloading hmmlearn-0.2.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (217 kB)\n",
      "\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",
      "\u001b[?25hCollecting torch-audiomentations>=0.11.0\n",
      "  Downloading torch_audiomentations-0.11.0-py3-none-any.whl (47 kB)\n",
      "\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",
      "\u001b[?25hCollecting speechbrain<0.6,>=0.5.12\n",
      "  Downloading speechbrain-0.5.13-py3-none-any.whl (498 kB)\n",
      "\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",
      "\u001b[?25hCollecting singledispatchmethod\n",
      "  Downloading singledispatchmethod-1.0-py2.py3-none-any.whl (4.7 kB)\n",
      "Collecting torchmetrics<1.0,>=0.6\n",
      "  Downloading torchmetrics-0.10.0-py3-none-any.whl (529 kB)\n",
      "\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",
      "\u001b[?25hCollecting pyannote.pipeline<3.0,>=2.3\n",
      "  Downloading pyannote.pipeline-2.3-py3-none-any.whl (30 kB)\n",
      "Collecting pyannote.metrics<4.0,>=3.2\n",
      "  Downloading pyannote.metrics-3.2.1-py3-none-any.whl (51 kB)\n",
      "\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",
      "\u001b[?25hCollecting backports.cached-property\n",
      "  Downloading backports.cached_property-1.0.2-py3-none-any.whl (6.1 kB)\n",
      "Collecting pytorch-metric-learning<2.0,>=1.0.0\n",
      "  Downloading pytorch_metric_learning-1.6.2-py3-none-any.whl (111 kB)\n",
      "\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",
      "\u001b[?25hCollecting networkx<3.0,>=2.6\n",
      "  Downloading networkx-2.8.7-py3-none-any.whl (2.0 MB)\n",
      "\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",
      "\u001b[?25hCollecting omegaconf<3.0,>=2.1\n",
      "  Downloading omegaconf-2.2.3-py3-none-any.whl (79 kB)\n",
      "\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",
      "\u001b[?25hCollecting asteroid-filterbanks<0.5,>=0.4\n",
      "  Downloading asteroid_filterbanks-0.4.0-py3-none-any.whl (29 kB)\n",
      "Collecting huggingface-hub<0.9,>=0.7\n",
      "  Using cached huggingface_hub-0.8.1-py3-none-any.whl (101 kB)\n",
      "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",
      "Collecting einops<0.4.0,>=0.3\n",
      "  Downloading einops-0.3.2-py3-none-any.whl (25 kB)\n",
      "Collecting pyannote.core<5.0,>=4.4\n",
      "  Downloading pyannote.core-4.5-py3-none-any.whl (60 kB)\n",
      "\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",
      "\u001b[?25hCollecting pyannote.database<5.0,>=4.1.1\n",
      "  Downloading pyannote.database-4.1.3-py3-none-any.whl (41 kB)\n",
      "\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",
      "\u001b[?25hCollecting semver<3.0,>=2.10.2\n",
      "  Downloading semver-2.13.0-py2.py3-none-any.whl (12 kB)\n",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "Collecting antlr4-python3-runtime==4.9.*\n",
      "  Downloading antlr4-python3-runtime-4.9.3.tar.gz (117 kB)\n",
      "\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",
      "\u001b[?25h  Preparing metadata (setup.py) ... \u001b[?25ldone\n",
      "\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",
      "Collecting simplejson>=3.8.1\n",
      "  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",
      "\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",
      "\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",
      "Collecting typer[all]>=0.2.1\n",
      "  Downloading typer-0.6.1-py3-none-any.whl (38 kB)\n",
      "Collecting matplotlib>=2.0.0\n",
      "  Downloading matplotlib-3.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.8 MB)\n",
      "\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",
      "\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",
      "Collecting docopt>=0.6.2\n",
      "  Downloading docopt-0.6.2.tar.gz (25 kB)\n",
      "  Preparing metadata (setup.py) ... \u001b[?25ldone\n",
      "\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",
      "Collecting optuna>=1.4\n",
      "  Downloading optuna-3.0.2-py3-none-any.whl (348 kB)\n",
      "\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",
      "\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",
      "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",
      "Collecting pyDeprecate>=0.3.1\n",
      "  Downloading pyDeprecate-0.3.2-py3-none-any.whl (10 kB)\n",
      "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",
      "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",
      "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",
      "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",
      "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",
      "Collecting hyperpyyaml\n",
      "  Downloading HyperPyYAML-1.0.1.tar.gz (14 kB)\n",
      "  Preparing metadata (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25hCollecting torch-pitch-shift>=1.2.2\n",
      "  Downloading torch_pitch_shift-1.2.2-py3-none-any.whl (5.0 kB)\n",
      "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",
      "Collecting julius<0.3,>=0.2.3\n",
      "  Downloading julius-0.2.7.tar.gz (59 kB)\n",
      "\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",
      "\u001b[?25h  Preparing metadata (setup.py) ... \u001b[?25ldone\n",
      "\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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "Collecting cycler>=0.10\n",
      "  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)\n",
      "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",
      "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",
      "Collecting kiwisolver>=1.0.1\n",
      "  Downloading kiwisolver-1.4.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.6 MB)\n",
      "\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",
      "\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",
      "Collecting contourpy>=1.0.1\n",
      "  Downloading contourpy-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (296 kB)\n",
      "\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",
      "\u001b[?25hCollecting fonttools>=4.22.0\n",
      "  Downloading fonttools-4.37.4-py3-none-any.whl (960 kB)\n",
      "\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",
      "\u001b[?25hCollecting cmaes>=0.8.2\n",
      "  Downloading cmaes-0.8.2-py3-none-any.whl (15 kB)\n",
      "Collecting sqlalchemy>=1.3.0\n",
      "  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",
      "\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",
      "\u001b[?25hCollecting alembic>=1.5.0\n",
      "  Downloading alembic-1.8.1-py3-none-any.whl (209 kB)\n",
      "\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",
      "\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",
      "Collecting cliff\n",
      "  Downloading cliff-4.0.0-py3-none-any.whl (80 kB)\n",
      "\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",
      "\u001b[?25hCollecting scipy>=0.19\n",
      "  Downloading scipy-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.2 MB)\n",
      "\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",
      "\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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "Collecting primePy>=1.3\n",
      "  Downloading primePy-1.3-py3-none-any.whl (4.0 kB)\n",
      "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",
      "Collecting rich<13.0.0,>=10.11.0\n",
      "  Downloading rich-12.6.0-py3-none-any.whl (237 kB)\n",
      "\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",
      "\u001b[?25hCollecting shellingham<2.0.0,>=1.3.0\n",
      "  Downloading shellingham-1.5.0-py2.py3-none-any.whl (9.3 kB)\n",
      "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",
      "Collecting ruamel.yaml>=0.17.8\n",
      "  Downloading ruamel.yaml-0.17.21-py3-none-any.whl (109 kB)\n",
      "\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",
      "\u001b[?25hCollecting torchvision\n",
      "  Using cached torchvision-0.13.1-cp39-cp39-manylinux1_x86_64.whl (19.1 MB)\n",
      "Collecting Mako\n",
      "  Downloading Mako-1.2.3-py3-none-any.whl (78 kB)\n",
      "\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",
      "\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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "Collecting commonmark<0.10.0,>=0.9.0\n",
      "  Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)\n",
      "\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",
      "\u001b[?25hCollecting ruamel.yaml.clib>=0.2.6\n",
      "  Downloading ruamel.yaml.clib-0.2.6-cp39-cp39-manylinux1_x86_64.whl (539 kB)\n",
      "\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",
      "\u001b[?25hCollecting greenlet!=0.4.17\n",
      "  Downloading greenlet-1.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (154 kB)\n",
      "\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",
      "\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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "Collecting autopage>=0.4.0\n",
      "  Downloading autopage-0.5.1-py3-none-any.whl (29 kB)\n",
      "Collecting cmd2>=1.0.0\n",
      "  Downloading cmd2-2.4.2-py3-none-any.whl (147 kB)\n",
      "\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",
      "\u001b[?25hCollecting stevedore>=2.0.1\n",
      "  Downloading stevedore-4.0.0-py3-none-any.whl (49 kB)\n",
      "\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",
      "\u001b[?25hCollecting PrettyTable>=0.7.2\n",
      "  Downloading prettytable-3.4.1-py3-none-any.whl (26 kB)\n",
      "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",
      "Collecting pyperclip>=1.6\n",
      "  Downloading pyperclip-1.8.2.tar.gz (20 kB)\n",
      "  Preparing metadata (setup.py) ... \u001b[?25ldone\n",
      "\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",
      "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",
      "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",
      "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",
      "Building wheels for collected packages: antlr4-python3-runtime, docopt, julius, hyperpyyaml, pyperclip\n",
      "  Building wheel for antlr4-python3-runtime (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144554 sha256=66a81504d29d763868c1dfe04d45cca872f78e97b7b92112e556731e2cab617d\n",
      "  Stored in directory: /home/ubuntu/.cache/pip/wheels/23/cf/80/f3efa822e6ab23277902ee9165fe772eeb1dfb8014f359020a\n",
      "  Building wheel for docopt (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=13706 sha256=3805c1a127c79f3a81ed6be5ddee9d3313fd0aa7107216896e89e5cecf2bbe27\n",
      "  Stored in directory: /home/ubuntu/.cache/pip/wheels/70/4a/46/1309fc853b8d395e60bafaf1b6df7845bdd82c95fd59dd8d2b\n",
      "  Building wheel for julius (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for julius: filename=julius-0.2.7-py3-none-any.whl size=21878 sha256=bf68d9142aaa911aa76fec8e020953044482054bd72a37b2f7c4a18e77edb1b0\n",
      "  Stored in directory: /home/ubuntu/.cache/pip/wheels/53/0a/a7/fc08f97438f4969d86afa7904336c2eb7eb422101359f3ad11\n",
      "  Building wheel for hyperpyyaml (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for hyperpyyaml: filename=HyperPyYAML-1.0.1-py3-none-any.whl size=15174 sha256=4c1e243d17ff4f7740e60bbe69d33602ef80a0011868ac15fc5b1dbc63ad5c70\n",
      "  Stored in directory: /home/ubuntu/.cache/pip/wheels/c2/bb/de/befc66499e9c2b4b8b163e018abcace61c80220e6a28950a65\n",
      "  Building wheel for pyperclip (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for pyperclip: filename=pyperclip-1.8.2-py3-none-any.whl size=11123 sha256=a6734b9b91c358d2e5d4e4c3c8e8d0a02f2aab94ecca213c41935d81630367e8\n",
      "  Stored in directory: /home/ubuntu/.cache/pip/wheels/0c/09/9e/49e21a6840ef7955b06d47394afef0058f0378c0914e48b8b8\n",
      "Successfully built antlr4-python3-runtime docopt julius hyperpyyaml pyperclip\n",
      "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",
      "  Attempting uninstall: torch\n",
      "    Found existing installation: torch 1.11.0+cu113\n",
      "    Uninstalling torch-1.11.0+cu113:\n",
      "      Successfully uninstalled torch-1.11.0+cu113\n",
      "  Attempting uninstall: scipy\n",
      "    Found existing installation: scipy 1.9.0\n",
      "    Uninstalling scipy-1.9.0:\n",
      "      Successfully uninstalled scipy-1.9.0\n",
      "  Attempting uninstall: torchvision\n",
      "    Found existing installation: torchvision 0.12.0+cu113\n",
      "    Uninstalling torchvision-0.12.0+cu113:\n",
      "      Successfully uninstalled torchvision-0.12.0+cu113\n",
      "  Attempting uninstall: huggingface-hub\n",
      "    Found existing installation: huggingface-hub 0.9.0\n",
      "    Uninstalling huggingface-hub-0.9.0:\n",
      "      Successfully uninstalled huggingface-hub-0.9.0\n",
      "\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",
      "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",
      "\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"
     ]
    }
   ],
   "source": [
    "!pip install -r requirements.txt --upgrade"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9caf5b409e794ecea978b87f399cf3f1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/598 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0072f6911e7d402ea0fd0437c7841ddb",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/17.7M [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2fff59eb41574f1aa5e159ced85b98a4",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/318 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a880484a957642faa87db557521f3cee",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/1.92k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c655e7a82a354464aa0a82dee1eaf35f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/83.3M [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b3b18c63fb344e9986502276819a1aab",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/1.92k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "92af59a51c314e6cb1915cadd2ab9a03",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/5.53M [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "63adf3749baa487096fc6f281f635d85",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/129k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "start=0.5s stop=1.4s speaker_SPEAKER_01\n",
      "start=1.9s stop=2.8s speaker_SPEAKER_01\n",
      "start=3.0s stop=3.5s speaker_SPEAKER_02\n",
      "start=3.6s stop=4.3s speaker_SPEAKER_01\n",
      "start=4.6s stop=6.8s speaker_SPEAKER_02\n",
      "start=7.1s stop=7.6s speaker_SPEAKER_00\n",
      "start=7.6s stop=9.5s speaker_SPEAKER_02\n",
      "start=9.8s stop=10.6s speaker_SPEAKER_02\n",
      "start=9.9s stop=10.4s speaker_SPEAKER_00\n",
      "start=12.4s stop=15.6s speaker_SPEAKER_03\n",
      "start=15.8s stop=16.1s speaker_SPEAKER_00\n",
      "start=16.1s stop=16.2s speaker_SPEAKER_01\n",
      "start=17.2s stop=17.4s speaker_SPEAKER_00\n",
      "start=17.7s stop=20.4s speaker_SPEAKER_01\n",
      "start=20.6s stop=20.7s speaker_SPEAKER_01\n",
      "start=20.7s stop=20.8s speaker_SPEAKER_00\n",
      "start=20.8s stop=20.9s speaker_SPEAKER_01\n",
      "start=21.1s stop=22.1s speaker_SPEAKER_01\n",
      "start=22.5s stop=22.7s speaker_SPEAKER_02\n",
      "start=23.2s stop=23.5s speaker_SPEAKER_02\n",
      "start=23.5s stop=24.0s speaker_SPEAKER_01\n",
      "start=24.3s stop=25.5s speaker_SPEAKER_02\n",
      "start=25.8s stop=27.3s speaker_SPEAKER_01\n",
      "start=27.3s stop=27.5s speaker_SPEAKER_02\n",
      "start=29.7s stop=30.0s speaker_SPEAKER_01\n"
     ]
    }
   ],
   "source": [
    "from pyannote.audio import Pipeline\n",
    "pipeline = Pipeline.from_pretrained(\"pyannote/speaker-diarization\")\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "from transformers.pipelines.audio_utils import ffmpeg_read\n",
    "import torch\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "audio_nparray = ffmpeg_read(request[\"inputs\"], 16000)\n",
    "audio_tensor= torch.from_numpy(audio_nparray).unsqueeze(0)\n",
    "f = {\"waveform\": audio_tensor, \"sample_rate\": 16000}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. Create Custom Handler for Inference Endpoints\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting handler.py\n"
     ]
    }
   ],
   "source": [
    "%%writefile handler.py\n",
    "from typing import  Dict\n",
    "from pyannote.audio import Pipeline\n",
    "from transformers.pipelines.audio_utils import ffmpeg_read\n",
    "import torch \n",
    "\n",
    "SAMPLE_RATE = 16000\n",
    "\n",
    "\n",
    "\n",
    "class EndpointHandler():\n",
    "    def __init__(self, path=\"\"):\n",
    "        # load the model\n",
    "        self.pipeline = Pipeline.from_pretrained(\"pyannote/speaker-diarization\")\n",
    "\n",
    "\n",
    "    def __call__(self, data: Dict[str, bytes]) -> Dict[str, str]:\n",
    "        \"\"\"\n",
    "        Args:\n",
    "            data (:obj:):\n",
    "                includes the deserialized audio file as bytes\n",
    "        Return:\n",
    "            A :obj:`dict`:. base64 encoded image\n",
    "        \"\"\"\n",
    "        # process input\n",
    "        inputs = data.pop(\"inputs\", data)\n",
    "        parameters = data.pop(\"parameters\", None) #  min_speakers=2, max_speakers=5\n",
    "\n",
    "        \n",
    "        # prepare pynannote input\n",
    "        audio_nparray = ffmpeg_read(inputs, SAMPLE_RATE)\n",
    "        audio_tensor= torch.from_numpy(audio_nparray).unsqueeze(0)\n",
    "        pyannote_input = {\"waveform\": audio_tensor, \"sample_rate\": SAMPLE_RATE}\n",
    "        \n",
    "        # apply pretrained pipeline\n",
    "        # pass inputs with all kwargs in data\n",
    "        if parameters is not None:\n",
    "            diarization = self.pipeline(pyannote_input, **parameters)\n",
    "        else:\n",
    "            diarization = self.pipeline(pyannote_input)\n",
    "\n",
    "        # postprocess the prediction\n",
    "        processed_diarization = [\n",
    "            {\"label\": str(label), \"start\": str(segment.start), \"stop\": str(segment.end)}\n",
    "            for segment, _, label in diarization.itertracks(yield_label=True)\n",
    "        ]\n",
    "        \n",
    "        return {\"diarization\": processed_diarization}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "test custom pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from handler import EndpointHandler\n",
    "\n",
    "# init handler\n",
    "my_handler = EndpointHandler(path=\".\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import base64\n",
    "from PIL import Image\n",
    "from io import BytesIO\n",
    "import json\n",
    "\n",
    "# file reader\n",
    "with open(\"sample.wav\", \"rb\") as f:\n",
    "  request = {\"inputs\": f.read()}\n",
    "\n",
    "# test the handler\n",
    "pred = my_handler(request)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'diarization': [{'label': 'SPEAKER_01',\n",
       "   'start': '0.4978125',\n",
       "   'stop': '1.3921875'},\n",
       "  {'label': 'SPEAKER_01', 'start': '1.8984375', 'stop': '2.7590624999999998'},\n",
       "  {'label': 'SPEAKER_02', 'start': '2.9953125', 'stop': '3.5015625000000004'},\n",
       "  {'label': 'SPEAKER_01',\n",
       "   'start': '3.5690625000000002',\n",
       "   'stop': '4.311562500000001'},\n",
       "  {'label': 'SPEAKER_02', 'start': '4.6153125', 'stop': '6.7753125'},\n",
       "  {'label': 'SPEAKER_00', 'start': '7.1128125', 'stop': '7.551562500000001'},\n",
       "  {'label': 'SPEAKER_02',\n",
       "   'start': '7.551562500000001',\n",
       "   'stop': '9.475312500000001'},\n",
       "  {'label': 'SPEAKER_02',\n",
       "   'start': '9.812812500000003',\n",
       "   'stop': '10.555312500000003'},\n",
       "  {'label': 'SPEAKER_00',\n",
       "   'start': '9.863437500000003',\n",
       "   'stop': '10.420312500000001'},\n",
       "  {'label': 'SPEAKER_03', 'start': '12.411562500000002', 'stop': '15.5503125'},\n",
       "  {'label': 'SPEAKER_00', 'start': '15.786562500000002', 'stop': '16.1409375'},\n",
       "  {'label': 'SPEAKER_01', 'start': '16.1409375', 'stop': '16.1578125'},\n",
       "  {'label': 'SPEAKER_00', 'start': '17.1534375', 'stop': '17.4234375'},\n",
       "  {'label': 'SPEAKER_01', 'start': '17.7440625', 'stop': '20.3596875'},\n",
       "  {'label': 'SPEAKER_01', 'start': '20.6128125', 'stop': '20.6634375'},\n",
       "  {'label': 'SPEAKER_00', 'start': '20.6634375', 'stop': '20.8490625'},\n",
       "  {'label': 'SPEAKER_01', 'start': '20.8490625', 'stop': '20.8828125'},\n",
       "  {'label': 'SPEAKER_01', 'start': '21.1021875', 'stop': '22.1315625'},\n",
       "  {'label': 'SPEAKER_02', 'start': '22.4521875', 'stop': '22.7053125'},\n",
       "  {'label': 'SPEAKER_02', 'start': '23.2115625', 'stop': '23.4815625'},\n",
       "  {'label': 'SPEAKER_01', 'start': '23.4815625', 'stop': '24.0215625'},\n",
       "  {'label': 'SPEAKER_02', 'start': '24.3253125', 'stop': '25.5065625'},\n",
       "  {'label': 'SPEAKER_01', 'start': '25.8440625', 'stop': '27.3121875'},\n",
       "  {'label': 'SPEAKER_02', 'start': '27.3121875', 'stop': '27.4978125'},\n",
       "  {'label': 'SPEAKER_01', 'start': '29.7253125', 'stop': '29.9615625'}]}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pred"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.13 ('dev': conda)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "f6dd96c16031089903d5a31ec148b80aeb0d39c32affb1a1080393235fbfa2fc"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}