Skip to content

Commit

Permalink
Deploying to docs from @ 58ef1c5 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
satra committed Oct 2, 2024
1 parent db0d480 commit 96c1962
Show file tree
Hide file tree
Showing 7 changed files with 1,145 additions and 224 deletions.
2 changes: 1 addition & 1 deletion search.js

Large diffs are not rendered by default.

228 changes: 138 additions & 90 deletions senselab/audio/data_structures/audio.html

Large diffs are not rendered by default.

48 changes: 44 additions & 4 deletions senselab/audio/tasks/data_augmentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,20 @@
<input type="search" placeholder="Search..." role="searchbox" aria-label="search"
pattern=".+" required>

<h2>Contents</h2>
<ul>
<li><a href="#audio-data-augmentation">Audio data augmentation</a>
<ul>
<li><a href="#task-overview">Task Overview</a></li>
</ul></li>
</ul>


<h2>Submodules</h2>
<ul>
<li><a href="data_augmentation/data_augmentation.html">data_augmentation</a></li>
<li><a href="data_augmentation/api.html">api</a></li>
<li><a href="data_augmentation/audiomentations.html">audiomentations</a></li>
<li><a href="data_augmentation/torch_audiomentations.html">torch_audiomentations</a></li>
</ul>


Expand All @@ -47,16 +57,46 @@ <h2>Submodules</h2>
<h1 class="modulename">
<a href="./../../../senselab.html">senselab</a><wbr>.<a href="./../../audio.html">audio</a><wbr>.<a href="./../tasks.html">tasks</a><wbr>.data_augmentation </h1>

<div class="docstring"><p>This module provides the API of the senselab audio data augmentation.</p>
<div class="docstring"><h1 id="audio-data-augmentation">Audio data augmentation</h1>

<p><button class="tutorial-button" onclick="window.location.href='https://github.com/sensein/senselab/blob/main/tutorials/audio/audio_data_augmentation.ipynb'">Tutorial</button></p>

<h2 id="task-overview">Task Overview</h2>

<p>Data augmentation involves creating synthetic audio samples by adding some perturbations to the original data. This technique helps mimic real-world variations, making the audio data more robust and versatile for different contexts, whether for creative, practical, or analytical purposes. Importantly, in the machine learning space, these perturbations must maintain the same label as the original training sample.</p>

<h3 id="common-techniques">Common Techniques</h3>

<p>Here are some commonly used audio data augmentation techniques:</p>

<ul>
<li><strong>Noise Injection</strong>: Adds background noise to simulate real-world environments, such as crowds, traffic, or machinery.</li>
<li><strong>Pitch Shifting</strong>: Changes the pitch by altering the sound frequency without affecting its speed, often used to modify the tonal quality or mood.</li>
<li><strong>Time Stretching</strong>: Speeds up or slows down the audio without changing its pitch, useful for adjusting the timing of audio to meet specific requirements.</li>
<li><strong>Volume Adjustment</strong>: Increases or decreases loudness to simulate different recording conditions or adjust audio levels.</li>
<li><strong>Reverb</strong>: Applies echo or reverberation effects to simulate different acoustic environments, adding depth and space to the audio.</li>
</ul>

<h3 id="libraries-audiomentations-and-torch-audiomentations">Libraries: <code>audiomentations</code> and <code>torch-audiomentations</code></h3>

<ul>
<li><p><a href="https://github.com/iver56/audiomentations">audiomentations</a>: A CPU-based Python library offering a wide variety of audio augmentation transforms. It's inspired by albumentations and optimized for deep learning tasks, such as speech processing and noise-robustness testing. It supports both mono and multichannel audio, with an easy-to-use interface.</p></li>
<li><p><a href="https://github.com/asteroid-team/torch-audiomentations">torch-audiomentations</a>: A GPU-accelerated augmentation library for PyTorch, allowing for efficient real-time augmentation. This is ideal for speeding up model training and reducing data loading times. It supports a subset of the techniques from audiomentations but is optimized for high-speed processing.
Compared to <code>audiomentations</code>, <code>torch-audiomentations</code> offers a more limited set of augmentation types.</p></li>
</ul>

<p>In <code><a href="../../../senselab.html">senselab</a></code>, when these libraries run on a CPU, they utilize concurrent futures through <code>Pydra</code> for optimization.</p>

<p>For more information on CPU vs GPU audio data augmentation, including the pros and cons, see <a href="https://iver56.github.io/audiomentations/guides/cpu_vs_gpu/">this guide</a>.</p>
</div>

<input id="mod-data_augmentation-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">

<label class="view-source-button" for="mod-data_augmentation-view-source"><span>View Source</span></label>

<div class="pdoc-code codehilite"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos">1</span></a><span class="sd">&quot;&quot;&quot;This module provides the API of the senselab audio data augmentation.&quot;&quot;&quot;</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos">1</span></a><span class="sd">&quot;&quot;&quot;.. include:: ./doc.md&quot;&quot;&quot;</span> <span class="c1"># noqa: D415</span>
</span><span id="L-2"><a href="#L-2"><span class="linenos">2</span></a>
</span><span id="L-3"><a href="#L-3"><span class="linenos">3</span></a><span class="kn">from</span> <span class="nn">.data_augmentation</span> <span class="kn">import</span> <span class="n">augment_audios</span> <span class="c1"># noqa: F401</span>
</span><span id="L-3"><a href="#L-3"><span class="linenos">3</span></a><span class="kn">from</span> <span class="nn">.api</span> <span class="kn">import</span> <span class="n">augment_audios</span> <span class="c1"># noqa: F401</span>
</span></pre></div>


Expand Down
Loading

0 comments on commit 96c1962

Please sign in to comment.