-
Notifications
You must be signed in to change notification settings - Fork 1
/
tutorial.html
638 lines (444 loc) · 20.7 KB
/
tutorial.html
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
<!DOCTYPE html>
<html >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1"><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>Tutorial</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme.css " type="text/css" />
<link rel="stylesheet" href="_static/css/custom.css" type="text/css" />
<link rel="stylesheet" href="_static/css/waveform-list.css" type="text/css" />
<!-- sphinx script_files -->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<!-- bundled in js (rollup iife) -->
<!-- <script src="_static/theme-vendors.js"></script> -->
<script src="_static/theme.js" defer></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Demonstration" href="demo.html" />
<link rel="prev" title="Quick Start" href="quick-start.html" />
</head>
<body>
<div id="app">
<div class="theme-container" :class="pageClasses"><navbar @toggle-sidebar="toggleSidebar">
<router-link to="index.html" class="home-link">
<span class="site-name">omnizart</span>
</router-link>
<div class="links">
<navlinks class="can-hide">
<div class="nav-item">
<a href="index.html#sound-samples"
class="nav-link router-link-active">
Contents
</a>
</div>
<div class="nav-item">
<a href="index.html#sound-samples"
class="nav-link ">
Command Line Interface
</a>
</div>
<div class="nav-item">
<a href="index.html#sound-samples"
class="nav-link ">
API Reference
</a>
</div>
</navlinks>
</div>
</navbar>
<div class="sidebar-mask" @click="toggleSidebar(false)">
</div>
<sidebar @toggle-sidebar="toggleSidebar">
<navlinks>
<div class="nav-item">
<a href="index.html#sound-samples"
class="nav-link router-link-active">
Contents
</a>
</div>
<div class="nav-item">
<a href="index.html#sound-samples"
class="nav-link ">
Command Line Interface
</a>
</div>
<div class="nav-item">
<a href="index.html#sound-samples"
class="nav-link ">
API Reference
</a>
</div>
</navlinks><div id="searchbox" class="searchbox" role="search">
<div class="caption"><span class="caption-text">Quick search</span>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div><div class="sidebar-links" role="navigation" aria-label="main navigation">
<div class="sidebar-group">
<p class="caption">
<span class="caption-text"><a href="index.html#sound-samples">Contents</a></span>
</p>
<ul class="current">
<li class="toctree-l1 ">
<a href="quick-start.html" class="reference internal ">Quick Start</a>
</li>
<li class="toctree-l1 current">
<a href="#" class="reference internal current">Tutorial</a>
<ul>
<li class="toctree-l2"><a href="#core" class="reference internal">Core</a></li>
<li class="toctree-l2"><a href="#utility" class="reference internal">Utility</a></li>
</ul>
</li>
<li class="toctree-l1 ">
<a href="demo.html" class="reference internal ">Demonstration</a>
</li>
</ul>
</div>
<div class="sidebar-group">
<p class="caption">
<span class="caption-text"><a href="index.html#sound-samples">Command Line Interface</a></span>
</p>
<ul class="">
<li class="toctree-l1 ">
<a href="music/cli.html" class="reference internal ">omnizart music</a>
</li>
<li class="toctree-l1 ">
<a href="drum/cli.html" class="reference internal ">omnizart drum</a>
</li>
<li class="toctree-l1 ">
<a href="chord/cli.html" class="reference internal ">omnizart chord</a>
</li>
<li class="toctree-l1 ">
<a href="vocal/cli.html" class="reference internal ">omnizart vocal</a>
</li>
<li class="toctree-l1 ">
<a href="vocal-contour/cli.html" class="reference internal ">omnizart vocal-contour</a>
</li>
<li class="toctree-l1 ">
<a href="beat/cli.html" class="reference internal ">omnizart beat</a>
</li>
<li class="toctree-l1 ">
<a href="patch-cnn/cli.html" class="reference internal ">omnizart patch-cnn</a>
</li>
</ul>
</div>
<div class="sidebar-group">
<p class="caption">
<span class="caption-text"><a href="index.html#sound-samples">API Reference</a></span>
</p>
<ul class="">
<li class="toctree-l1 ">
<a href="music/api.html" class="reference internal ">Music Transcription</a>
</li>
<li class="toctree-l1 ">
<a href="drum/api.html" class="reference internal ">Drum Transcription</a>
</li>
<li class="toctree-l1 ">
<a href="chord/api.html" class="reference internal ">Chord Transcription</a>
</li>
<li class="toctree-l1 ">
<a href="vocal/api.html" class="reference internal ">Vocal Transcription</a>
</li>
<li class="toctree-l1 ">
<a href="vocal-contour/api.html" class="reference internal ">Vocal-Contour Transcription</a>
</li>
<li class="toctree-l1 ">
<a href="patch-cnn/api.html" class="reference internal ">Patch-CNN Transcription</a>
</li>
<li class="toctree-l1 ">
<a href="beat/api.html" class="reference internal ">Beat Transcription</a>
</li>
<li class="toctree-l1 ">
<a href="feature.html" class="reference internal ">Feature</a>
</li>
<li class="toctree-l1 ">
<a href="models.html" class="reference internal ">Models</a>
</li>
<li class="toctree-l1 ">
<a href="training.html" class="reference internal ">Training</a>
</li>
<li class="toctree-l1 ">
<a href="base.html" class="reference internal ">Base Classes</a>
</li>
<li class="toctree-l1 ">
<a href="constants.html" class="reference internal ">Constants</a>
</li>
<li class="toctree-l1 ">
<a href="utils.html" class="reference internal ">Utilities</a>
</li>
</ul>
</div>
</div>
</sidebar>
<page>
<div class="body-header" role="navigation" aria-label="navigation">
<ul class="breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Tutorial</li>
</ul>
<ul class="page-nav">
<li class="prev">
<a href="quick-start.html"
title="previous chapter">← Quick Start</a>
</li>
<li class="next">
<a href="demo.html"
title="next chapter">Demonstration →</a>
</li>
</ul>
</div>
<hr>
<div class="content" role="main" v-pre>
<section id="tutorial">
<h1>Tutorial<a class="headerlink" href="#tutorial" title="Permalink to this headline">¶</a></h1>
<p>This page describes the workflow and usage of <code class="docutils literal notranslate"><span class="pre">omnizart</span></code> command-line interface,
covering core and utility.</p>
<p>The root entry is <code class="docutils literal notranslate"><span class="pre">omnizart</span></code> followed by sub-commands.
The available sub-commands can be found by typing <code class="docutils literal notranslate"><span class="pre">omnizart</span> <span class="pre">--help</span></code>.</p>
<section id="core">
<h2>Core<a class="headerlink" href="#core" title="Permalink to this headline">¶</a></h2>
<p>In general, the core sub-commands follow a pipeline of <code class="docutils literal notranslate"><span class="pre">application</span></code>-<code class="docutils literal notranslate"><span class="pre">action</span></code>-<code class="docutils literal notranslate"><span class="pre">arguments</span></code>:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>omnizart application action --arguments
</pre></div>
</div>
<p>where we apply an <code class="docutils literal notranslate"><span class="pre">action</span></code> to the <code class="docutils literal notranslate"><span class="pre">application</span></code> of interest, with corresponding <code class="docutils literal notranslate"><span class="pre">arguments</span></code>.
Detailed descriptions for the usage of each sub-command can be found in the dedicated pages for each <code class="docutils literal notranslate"><span class="pre">application</span></code>:</p>
<ul class="simple">
<li><p><a class="reference internal" href="music/cli.html"><span class="doc">omnizart music</span></a></p></li>
<li><p><a class="reference internal" href="drum/cli.html"><span class="doc">omnizart drum</span></a></p></li>
<li><p><a class="reference internal" href="chord/cli.html"><span class="doc">omnizart chord</span></a></p></li>
<li><p><a class="reference internal" href="vocal-contour/cli.html"><span class="doc">omnizart vocal-contour</span></a></p></li>
<li><p><a class="reference internal" href="vocal/cli.html"><span class="doc">omnizart vocal</span></a></p></li>
<li><p><a class="reference internal" href="beat/cli.html"><span class="doc">omnizart beat</span></a></p></li>
</ul>
<p>All the applications share a same set of actions: <strong>transcribe</strong>, <strong>generate-feature</strong>, and <strong>train-model</strong>.
Let’s have a walkthrough of each <code class="docutils literal notranslate"><span class="pre">action</span></code>.</p>
<section id="transcribe">
<h3>Transcribe<a class="headerlink" href="#transcribe" title="Permalink to this headline">¶</a></h3>
<p>As the name suggests, this action transcribes a given input.
The supported applications are as follows:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">music</span></code> - Transcribe musical notes of pitched instruments in MIDI.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">drum</span></code> - Transcribe events of percussive instruments in MIDI.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">chord</span></code> - Transcribe chord progressions in MIDI and CSV.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">vocal</span></code> - Transcribe note-level vocal melody in MIDI.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">vocal-contour</span></code> - Transcribe frame-level vocal melody (F0) in text.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">beat</span></code> - Transcribe beat position.</p></li>
</ul>
<p>Note that all the applications receive polyphonic music in WAV, except <code class="docutils literal notranslate"><span class="pre">beat</span></code> receives inputs in MIDI.</p>
<p>Example usage:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># Transcribe percussive events given pop.wav, with specified model path and output directory</span>
omnizart drum transcribe pop.wav --model-path ./my-model --output ./trans_pop.mid
</pre></div>
</div>
<p>Note: <code class="docutils literal notranslate"><span class="pre">--model-path</span></code> can be left unspecified, and the default will be the downloaded checkpoints.
Execute <code class="docutils literal notranslate"><span class="pre">omnizart</span> <span class="pre">download-checkpoints</span></code> if you have not done in the installation from <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
</section>
<section id="generate-feature">
<h3>Generate Feature<a class="headerlink" href="#generate-feature" title="Permalink to this headline">¶</a></h3>
<p>This action generates the features that are necessary for training and testing.
You can definitely skip this if you are only into transcribing with the given checkpoints.
The processed features will be stored in <em><path/to/dataset>/train_feature</em> and <em><path/to/dataset>/test_feature</em>.</p>
<p>The supported datasets for feature processing are application-dependent, summarized as follows:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 19%" />
<col style="width: 10%" />
<col style="width: 9%" />
<col style="width: 10%" />
<col style="width: 9%" />
<col style="width: 10%" />
<col style="width: 22%" />
<col style="width: 9%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Module</p></th>
<th class="head"><p>music</p></th>
<th class="head"><p>drum</p></th>
<th class="head"><p>chord</p></th>
<th class="head"><p>beat</p></th>
<th class="head"><p>vocal</p></th>
<th class="head"><p>vocal-contour</p></th>
<th class="head"><p>beat</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>Maestro</p></td>
<td><p>O</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Maps</p></td>
<td><p>O</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>MusicNet</p></td>
<td><p>O</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><p>O</p></td>
</tr>
<tr class="row-odd"><td><p>Pop</p></td>
<td><p>O</p></td>
<td><p>O</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Ext-Su</p></td>
<td><p>O</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>BillBoard</p></td>
<td></td>
<td></td>
<td><p>O</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>BPS-FH</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>MIR-1K</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><p>O</p></td>
<td><p>O</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>MedleyDB</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><p>O</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Tonas</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><p>O</p></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Before running the commands below, make sure to download the corresponding datasets first.
This can be easily done in <a class="reference internal" href="#download-datasets"><span class="std std-ref">Download Datasets</span></a>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># Generate features for the music application</span>
omnizart music generate-feature --dataset-path <path/to/dataset>
<span class="c1"># Generate features for the drum application</span>
omnizart drum generate-feature --dataset-path <path/to/dataset>
</pre></div>
</div>
</section>
<section id="train-model">
<h3>Train Model<a class="headerlink" href="#train-model" title="Permalink to this headline">¶</a></h3>
<p>This action trains a model from scratch given the generated features from <a class="reference internal" href="#generate-feature"><span class="std std-ref">Generate Feature</span></a>.
Once again, you can skip this if you are only up to transcribing music, and use the provided checkpoints.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>omnizart music train-model -d <path/to/feature/folder> --model-name My-Music
omnizart drum train-model -d <path/to/feature/folder> --model-name My-Drum
omnizart chord train-model -d <path/to/feature/folder> --model-name My-Chord
</pre></div>
</div>
</section>
</section>
<section id="utility">
<h2>Utility<a class="headerlink" href="#utility" title="Permalink to this headline">¶</a></h2>
<section id="download-datasets">
<h3>Download Datasets<a class="headerlink" href="#download-datasets" title="Permalink to this headline">¶</a></h3>
<p>This sub-command belongs to the utility, used to download the datasets for training and testing the models.
Current supported datasets are:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://magenta.tensorflow.org/datasets/maestro">Maestro</a> - MIDI and Audio Edited for Synchronous TRacks and Organization dataset.</p></li>
<li><p><a class="reference external" href="https://homes.cs.washington.edu/~thickstn/musicnet.html">MusicNet</a> - MusicNet dataset with a collection of 330 freely-licensed classical music recordings.</p></li>
<li><p><a class="reference external" href="https://ddmal.music.mcgill.ca/research/The_McGill_Billboard_Project_(Chord_Analysis_Dataset)/">McGill</a> - McGill BillBoard dataset.</p></li>
<li><p><a class="reference external" href="https://github.com/Tsung-Ping/functional-harmony">BPS-FH</a> - Beethoven Piano Sonata with Function Harmony dataset.</p></li>
<li><p>Ext-Su - Extended Su dataset.</p></li>
<li><p><a class="reference external" href="https://sites.google.com/site/unvoicedsoundseparation/mir-1k">MIR-1K</a> - 1000 short clips of Mandarin pop songs.</p></li>
<li><p><a class="reference external" href="http://medleydb.weebly.com/">MedleyDB</a> - 122 multitracks.</p></li>
</ul>
<p>Example usage:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># Download the MAESTRO dataset and output to the */data* folder.</span>
omnizart download-dataset Maestro --output /data
<span class="c1"># Download the MusicNet dataset and unzip the dataset after download.</span>
omnizart download-dataset MusicNet --unzip
<span class="c1"># To see a complete list of available datasets, execute the following command</span>
omnizart download-dataset --help
</pre></div>
</div>
</section>
<section id="download-checkpoints">
<h3>Download Checkpoints<a class="headerlink" href="#download-checkpoints" title="Permalink to this headline">¶</a></h3>
<p>This is the other sub-command for the utility, used to download the archived checkpoints of pre-trained models.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># Simply run the following command, and no other options are needed to be specified.</span>
omnizart download-checkpoints
</pre></div>
</div>
</section>
</section>
</section>
</div>
<div class="page-nav">
<div class="inner"><ul class="page-nav">
<li class="prev">
<a href="quick-start.html"
title="previous chapter">← Quick Start</a>
</li>
<li class="next">
<a href="demo.html"
title="next chapter">Demonstration →</a>
</li>
</ul><div class="footer" role="contentinfo">
© Copyright 2020, MCTLab.
<br>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 4.3.1 with <a href="https://github.com/schettino72/sphinx_press_theme">Press Theme</a> 0.8.0.
</div>
</div>
</div>
</page>
</div></div>
</body>
</html>