Skip to content

Commit

Permalink
fix noise aug (NVIDIA#8057)
Browse files Browse the repository at this point in the history
Signed-off-by: stevehuang52 <[email protected]>
Signed-off-by: Piotr Żelasko <[email protected]>
  • Loading branch information
stevehuang52 authored and pzelasko committed Jan 3, 2024
1 parent d62c623 commit 9e85dd1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
1 change: 1 addition & 0 deletions requirements/requirements_asr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ packaging
pyannote.core
pyannote.metrics
pydub
resampy
ruamel.yaml
scipy>=0.14
soundfile
Expand Down
42 changes: 39 additions & 3 deletions tutorials/asr/Online_Noise_Augmentation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"2. Import this notebook from GitHub (File -> Upload Notebook -> \"GITHUB\" tab -> copy/paste GitHub URL)\n",
"3. Connect to an instance with a GPU (Runtime -> Change runtime type -> select \"GPU\" for hardware accelerator)\n",
"4. Run this cell to set up dependencies.\n",
"\n\nNOTE: User is responsible for checking the content of datasets and the applicable licenses and determining if suitable for the intended use.\n",
"\n",
"\n",
"NOTE: User is responsible for checking the content of datasets and the applicable licenses and determining if suitable for the intended use.\n",
"\"\"\"\n",
"# If you're using Google Colab and not running locally, run this cell.\n",
"\n",
Expand All @@ -43,6 +45,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -65,6 +68,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -84,6 +88,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -157,6 +162,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -229,6 +235,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -255,6 +262,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -284,6 +292,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -315,6 +324,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -353,6 +363,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -379,6 +390,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -446,6 +458,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -483,6 +496,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -519,6 +533,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -531,6 +546,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -559,8 +575,7 @@
" with open(os.path.join(data_dir, manifest_name + '.json'), 'w') as fout:\n",
" \n",
" try:\n",
" x, _sr = librosa.load(filepath)\n",
" duration = librosa.get_duration(x, sr=_sr)\n",
" duration = librosa.get_duration(filename=filepath)\n",
"\n",
" except Exception:\n",
" print(f\"\\n>>>>>>>>> WARNING: Librosa failed to load file {filepath}. Skipping this file !\\n\")\n",
Expand Down Expand Up @@ -667,6 +682,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -709,6 +725,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -720,6 +737,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -741,6 +759,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -766,6 +785,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -784,6 +804,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -818,6 +839,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -831,6 +853,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -866,6 +889,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -880,6 +904,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -890,6 +915,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -918,6 +944,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -941,6 +968,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -967,6 +995,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -992,6 +1021,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1035,6 +1065,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -1053,6 +1084,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1117,6 +1149,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1159,6 +1192,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1227,6 +1261,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1268,6 +1303,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down

0 comments on commit 9e85dd1

Please sign in to comment.