{
  "id": 177926,
  "title": "Audio Albumentations",
  "url": "/competitions/birdsong-recognition/discussion/177926",
  "author_name": "",
  "post_date": "2020-08-27T22:08:18.517982200Z",
  "votes": 9,
  "comment_count": 4,
  "views": 0,
  "content": "<p>As discussed time and again in previous threads that augmentations are going to play a major role in this competition , also people have reported significant boosts using augmentations .</p>\n<p>But for a newbie who is getting started with audio data , writing custom augmentations can be overwhelming, while for experienced people also it can be time-taking . What if we had something like albumentations for audio data then we can just do </p>\n<blockquote>\n  <p>albumentations.compose</p>\n</blockquote>\n<p>add our augs and then use it. Well I have tried to create just that , now anyone can add audio augmentations with the following code</p>\n<p>`<br>\ndef get_train_transforms():</p>\n<pre><code>return albumentations.Compose([\n    TimeShifting(p=0.9),  # here not p=1.0 because your nets should get some difficulties\n    albumentations.OneOf([\n        AddCustomNoise(file_dir='../input/freesound-audio-tagging/audio_train', p=0.8),\n        SpeedTuning(p=0.8),\n    ]),\n    AddGaussianNoise(p=0.8),\n    PitchShift(p=0.5,n_steps=4),\n    Gain(p=0.9),\n    PolarityInversion(p=0.9),\n    StretchAudio(p=0.1),\n])`\n</code></pre>\n<p>Below is my kernel where I show how to custom built augs just as we do with computer vision tasks with albumentations </p>\n<p>Note that I have written the transforms on top of albumentations library and thus it can be directly used with pytorch</p>\n<p><a href=\"https://www.kaggle.com/tanulsingh077/audio-albumentations-transform-your-audio\" target=\"_blank\">https://www.kaggle.com/tanulsingh077/audio-albumentations-transform-your-audio</a></p>\n<p>I have also shown general usage for each transform separately</p>",
  "messages": [
    {
      "id": "988214",
      "postDate": "08/27/2020 22:08:18",
      "content": "<p>As discussed time and again in previous threads that augmentations are going to play a major role in this competition , also people have reported significant boosts using augmentations .</p>\n<p>But for a newbie who is getting started with audio data , writing custom augmentations can be overwhelming, while for experienced people also it can be time-taking . What if we had something like albumentations for audio data then we can just do </p>\n<blockquote>\n  <p>albumentations.compose</p>\n</blockquote>\n<p>add our augs and then use it. Well I have tried to create just that , now anyone can add audio augmentations with the following code</p>\n<p>`<br>\ndef get_train_transforms():</p>\n<pre><code>return albumentations.Compose([\n    TimeShifting(p=0.9),  # here not p=1.0 because your nets should get some difficulties\n    albumentations.OneOf([\n        AddCustomNoise(file_dir='../input/freesound-audio-tagging/audio_train', p=0.8),\n        SpeedTuning(p=0.8),\n    ]),\n    AddGaussianNoise(p=0.8),\n    PitchShift(p=0.5,n_steps=4),\n    Gain(p=0.9),\n    PolarityInversion(p=0.9),\n    StretchAudio(p=0.1),\n])`\n</code></pre>\n<p>Below is my kernel where I show how to custom built augs just as we do with computer vision tasks with albumentations </p>\n<p>Note that I have written the transforms on top of albumentations library and thus it can be directly used with pytorch</p>\n<p><a href=\"https://www.kaggle.com/tanulsingh077/audio-albumentations-transform-your-audio\" target=\"_blank\">https://www.kaggle.com/tanulsingh077/audio-albumentations-transform-your-audio</a></p>\n<p>I have also shown general usage for each transform separately</p>",
      "rawMarkdown": "As discussed time and again in previous threads that augmentations are going to play a major role in this competition , also people have reported significant boosts using augmentations .\n\nBut for a newbie who is getting started with audio data , writing custom augmentations can be overwhelming, while for experienced people also it can be time-taking . What if we had something like albumentations for audio data then we can just do \n> albumentations.compose\n\nadd our augs and then use it. Well I have tried to create just that , now anyone can add audio augmentations with the following code\n\n`\ndef get_train_transforms():\n\n    return albumentations.Compose([\n        TimeShifting(p=0.9),  # here not p=1.0 because your nets should get some difficulties\n        albumentations.OneOf([\n            AddCustomNoise(file_dir='../input/freesound-audio-tagging/audio_train', p=0.8),\n            SpeedTuning(p=0.8),\n        ]),\n        AddGaussianNoise(p=0.8),\n        PitchShift(p=0.5,n_steps=4),\n        Gain(p=0.9),\n        PolarityInversion(p=0.9),\n        StretchAudio(p=0.1),\n    ])`\n\nBelow is my kernel where I show how to custom built augs just as we do with computer vision tasks with albumentations \n\nNote that I have written the transforms on top of albumentations library and thus it can be directly used with pytorch\n\nhttps://www.kaggle.com/tanulsingh077/audio-albumentations-transform-your-audio\n\nI have also shown general usage for each transform separately",
      "votes": null
    },
    {
      "id": "988622",
      "postDate": "08/28/2020 06:54:43",
      "content": "<p>Next time google first instead of trying to invent a bicycle, it'll save you some time.<br>\n<a href=\"https://github.com/iver56/audiomentations\" target=\"_blank\">https://github.com/iver56/audiomentations</a></p>\n<p>Nice notebook!</p>",
      "rawMarkdown": "Next time google first instead of trying to invent a bicycle, it'll save you some time.\nhttps://github.com/iver56/audiomentations\n\nNice notebook!",
      "votes": null
    },
    {
      "id": "989144",
      "postDate": "08/28/2020 15:18:29",
      "content": "<p>Haha , I didn't know about that , but I really learned a lot in the process and now anyone can add any transform they and are not limited to a library . I will add mixup and cutmix which is not present in the resource mentioned above , So I guess it's not a complete waste 😬</p>",
      "rawMarkdown": "Haha , I didn't know about that , but I really learned a lot in the process and now anyone can add any transform they and are not limited to a library . I will add mixup and cutmix which is not present in the resource mentioned above , So I guess it's not a complete waste 😬",
      "votes": null
    },
    {
      "id": "989428",
      "postDate": "08/28/2020 19:17:57",
      "content": "<p>Just ignore the hater, follow your passion and if you learn something new, it's not a waste of time ;)</p>",
      "rawMarkdown": "Just ignore the hater, follow your passion and if you learn something new, it's not a waste of time ;)",
      "votes": null
    },
    {
      "id": "989877",
      "postDate": "08/29/2020 07:05:35",
      "content": "<p>Yes <a href=\"https://www.kaggle.com/tanulsingh077\" target=\"_blank\">@tanulsingh077</a> while searching for existing work is good<br>\nit is good to learn from scratch and gives a lot of confidence! thanks for sharing… good work! nice to see you start from beginning and learn!</p>",
      "rawMarkdown": "Yes @tanulsingh077 while searching for existing work is good\nit is good to learn from scratch and gives a lot of confidence! thanks for sharing... good work! nice to see you start from beginning and learn!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 988622,
      "author_name": "stanislavblinov",
      "author_url": "",
      "post_date": "08/28/2020 06:54:43",
      "content": "<p>Next time google first instead of trying to invent a bicycle, it'll save you some time.<br>\n<a href=\"https://github.com/iver56/audiomentations\" target=\"_blank\">https://github.com/iver56/audiomentations</a></p>\n<p>Nice notebook!</p>",
      "votes": null,
      "replies": [
        {
          "id": 989144,
          "author_name": "tanulsingh077",
          "author_url": "",
          "post_date": "08/28/2020 15:18:29",
          "content": "<p>Haha , I didn't know about that , but I really learned a lot in the process and now anyone can add any transform they and are not limited to a library . I will add mixup and cutmix which is not present in the resource mentioned above , So I guess it's not a complete waste 😬</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 989428,
          "author_name": "alincijov",
          "author_url": "",
          "post_date": "08/28/2020 19:17:57",
          "content": "<p>Just ignore the hater, follow your passion and if you learn something new, it's not a waste of time ;)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 989877,
          "author_name": "kmldas",
          "author_url": "",
          "post_date": "08/29/2020 07:05:35",
          "content": "<p>Yes <a href=\"https://www.kaggle.com/tanulsingh077\" target=\"_blank\">@tanulsingh077</a> while searching for existing work is good<br>\nit is good to learn from scratch and gives a lot of confidence! thanks for sharing… good work! nice to see you start from beginning and learn!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "988214": "As discussed time and again in previous threads that augmentations are going to play a major role in this competition , also people have reported significant boosts using augmentations .\n\nBut for a newbie who is getting started with audio data , writing custom augmentations can be overwhelming, while for experienced people also it can be time-taking . What if we had something like albumentations for audio data then we can just do \n> albumentations.compose\n\nadd our augs and then use it. Well I have tried to create just that , now anyone can add audio augmentations with the following code\n\n`\ndef get_train_transforms():\n\n    return albumentations.Compose([\n        TimeShifting(p=0.9),  # here not p=1.0 because your nets should get some difficulties\n        albumentations.OneOf([\n            AddCustomNoise(file_dir='../input/freesound-audio-tagging/audio_train', p=0.8),\n            SpeedTuning(p=0.8),\n        ]),\n        AddGaussianNoise(p=0.8),\n        PitchShift(p=0.5,n_steps=4),\n        Gain(p=0.9),\n        PolarityInversion(p=0.9),\n        StretchAudio(p=0.1),\n    ])`\n\nBelow is my kernel where I show how to custom built augs just as we do with computer vision tasks with albumentations \n\nNote that I have written the transforms on top of albumentations library and thus it can be directly used with pytorch\n\nhttps://www.kaggle.com/tanulsingh077/audio-albumentations-transform-your-audio\n\nI have also shown general usage for each transform separately",
    "988622": "Next time google first instead of trying to invent a bicycle, it'll save you some time.\nhttps://github.com/iver56/audiomentations\n\nNice notebook!",
    "989144": "Haha , I didn't know about that , but I really learned a lot in the process and now anyone can add any transform they and are not limited to a library . I will add mixup and cutmix which is not present in the resource mentioned above , So I guess it's not a complete waste 😬",
    "989428": "Just ignore the hater, follow your passion and if you learn something new, it's not a waste of time ;)",
    "989877": "Yes @tanulsingh077 while searching for existing work is good\nit is good to learn from scratch and gives a lot of confidence! thanks for sharing... good work! nice to see you start from beginning and learn!"
  },
  "source": "meta"
}