{
  "id": 198048,
  "title": "[Starter Datasets] Pre-computed Spectrograms for Faster Training & Inference",
  "url": "/competitions/rfcx-species-audio-detection/discussion/198048",
  "author_name": "Theo Viel",
  "post_date": "2020-11-19T14:14:39.282000",
  "votes": 59,
  "comment_count": 8,
  "views": 0,
  "content": "<p>If you want to save time during training and inference, it is a good thing to precompute the spectrograms and save them in your disk. You can easily get a huge (x1000) speed-up on your loading times by doing so.</p>\n<p>I've made public a script that precomputes spectrograms. Generation is done with multi-processing and takes about 1h30 for the train data and 45min for the test data  with <code>n_mels=128</code>: </p>\n<blockquote>\n  <p><a href=\"https://www.kaggle.com/theoviel/spectrogram-generation\" target=\"_blank\">https://www.kaggle.com/theoviel/spectrogram-generation</a></p>\n</blockquote>\n<p>You can change the parameters and re-generate the data if you feel like it.</p>\n<p>Here are the associated datasets :</p>\n<ul>\n<li>16 kHz, 128 mels  (as mentioned by <a href=\"https://www.kaggle.com/cpmpml\" target=\"_blank\">@cpmpml</a> 16 kHz is not a great choice, using 32 kHz should be better)</li>\n</ul>\n<blockquote>\n  <p>Test data  : <a href=\"https://www.kaggle.com/theoviel/rcfx-test-spectrograms\" target=\"_blank\">https://www.kaggle.com/theoviel/rcfx-test-spectrograms</a><br>\n  Train data : <a href=\"https://www.kaggle.com/theoviel/rcfx-train-spectrograms\" target=\"_blank\">https://www.kaggle.com/theoviel/rcfx-train-spectrograms</a></p>\n</blockquote>\n<ul>\n<li>32 kHz, 128 mels</li>\n</ul>\n<blockquote>\n  <p>Test + Train data : <a href=\"https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz\" target=\"_blank\">https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz</a></p>\n</blockquote>\n<ul>\n<li>32 kHz, 64 mels</li>\n</ul>\n<blockquote>\n  <p>Test + Train data : <a href=\"https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz-64-mels\" target=\"_blank\">https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz-64-mels</a></p>\n</blockquote>\n<p>Please let me know if there are any issues with the code.</p>",
  "messages": [
    {
      "id": 1083903,
      "postDate": "2020-11-19T14:14:39.283Z",
      "content": "<p>If you want to save time during training and inference, it is a good thing to precompute the spectrograms and save them in your disk. You can easily get a huge (x1000) speed-up on your loading times by doing so.</p>\n<p>I've made public a script that precomputes spectrograms. Generation is done with multi-processing and takes about 1h30 for the train data and 45min for the test data  with <code>n_mels=128</code>: </p>\n<blockquote>\n  <p><a href=\"https://www.kaggle.com/theoviel/spectrogram-generation\" target=\"_blank\">https://www.kaggle.com/theoviel/spectrogram-generation</a></p>\n</blockquote>\n<p>You can change the parameters and re-generate the data if you feel like it.</p>\n<p>Here are the associated datasets :</p>\n<ul>\n<li>16 kHz, 128 mels  (as mentioned by <a href=\"https://www.kaggle.com/cpmpml\" target=\"_blank\">@cpmpml</a> 16 kHz is not a great choice, using 32 kHz should be better)</li>\n</ul>\n<blockquote>\n  <p>Test data  : <a href=\"https://www.kaggle.com/theoviel/rcfx-test-spectrograms\" target=\"_blank\">https://www.kaggle.com/theoviel/rcfx-test-spectrograms</a><br>\n  Train data : <a href=\"https://www.kaggle.com/theoviel/rcfx-train-spectrograms\" target=\"_blank\">https://www.kaggle.com/theoviel/rcfx-train-spectrograms</a></p>\n</blockquote>\n<ul>\n<li>32 kHz, 128 mels</li>\n</ul>\n<blockquote>\n  <p>Test + Train data : <a href=\"https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz\" target=\"_blank\">https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz</a></p>\n</blockquote>\n<ul>\n<li>32 kHz, 64 mels</li>\n</ul>\n<blockquote>\n  <p>Test + Train data : <a href=\"https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz-64-mels\" target=\"_blank\">https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz-64-mels</a></p>\n</blockquote>\n<p>Please let me know if there are any issues with the code.</p>",
      "rawMarkdown": "If you want to save time during training and inference, it is a good thing to precompute the spectrograms and save them in your disk. You can easily get a huge (x1000) speed-up on your loading times by doing so.\n\n\nI've made public a script that precomputes spectrograms. Generation is done with multi-processing and takes about 1h30 for the train data and 45min for the test data  with `n_mels=128`: \n> https://www.kaggle.com/theoviel/spectrogram-generation\n\nYou can change the parameters and re-generate the data if you feel like it.\n\nHere are the associated datasets :\n\n- 16 kHz, 128 mels  (as mentioned by @cpmpml 16 kHz is not a great choice, using 32 kHz should be better)\n> Test data  : https://www.kaggle.com/theoviel/rcfx-test-spectrograms\n> Train data : https://www.kaggle.com/theoviel/rcfx-train-spectrograms\n\n- 32 kHz, 128 mels\n> Test + Train data : https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz\n\n- 32 kHz, 64 mels\n> Test + Train data : https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz-64-mels\n\n\nPlease let me know if there are any issues with the code.",
      "votes": 57
    },
    {
      "id": 1167563,
      "postDate": "2021-01-24T11:04:44.660Z",
      "content": "<p>You know that sampling at 16kHz removes frequencies above 8kHz right?  This means that some species are much harder to detect.</p>",
      "rawMarkdown": "You know that sampling at 16kHz removes frequencies above 8kHz right?  This means that some species are much harder to detect.",
      "votes": 4,
      "replies": [
        {
          "id": 1167884,
          "postDate": "2021-01-24T14:46:31.880Z",
          "content": "<p>Yup, it doesn't really make sense to use a sampling rate of 16kHz but for some reason that's the one I used originally.</p>",
          "rawMarkdown": "Yup, it doesn't really make sense to use a sampling rate of 16kHz but for some reason that's the one I used originally.",
          "votes": 2
        },
        {
          "id": 1167954,
          "postDate": "2021-01-24T15:52:27.557Z",
          "content": "<p>Good for you, but not for all those who read your post ;)  I preferred to warn them.</p>",
          "rawMarkdown": "Good for you, but not for all those who read your post ;)  I preferred to warn them.",
          "votes": 4
        },
        {
          "id": 1167976,
          "postDate": "2021-01-24T16:10:06.083Z",
          "content": "<p>True, I'll update the post</p>",
          "rawMarkdown": "True, I'll update the post",
          "votes": 3
        }
      ]
    },
    {
      "id": 1165768,
      "postDate": "2021-01-23T08:21:04.027Z",
      "content": "<p>I was looking for such a script and datasets. Thanks for sharing!</p>",
      "rawMarkdown": "I was looking for such a script and datasets. Thanks for sharing!"
    },
    {
      "id": 1093334,
      "postDate": "2020-11-27T16:11:15.903Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 1084216,
      "postDate": "2020-11-19T20:48:43.420Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 1102034,
      "postDate": "2020-12-04T13:56:01.620Z",
      "content": "<p>Thanks for this tip :)</p>",
      "rawMarkdown": "Thanks for this tip :)",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 1167563,
      "author_name": "CPMP",
      "author_url": "",
      "post_date": "2021-01-24T11:04:44.660000",
      "content": "<p>You know that sampling at 16kHz removes frequencies above 8kHz right?  This means that some species are much harder to detect.</p>",
      "votes": 4,
      "replies": [
        {
          "id": 1167884,
          "author_name": "Theo Viel",
          "author_url": "",
          "post_date": "2021-01-24T14:46:31.880000",
          "content": "<p>Yup, it doesn't really make sense to use a sampling rate of 16kHz but for some reason that's the one I used originally.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1167954,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2021-01-24T15:52:27.557000",
          "content": "<p>Good for you, but not for all those who read your post ;)  I preferred to warn them.</p>",
          "votes": 4,
          "replies": []
        },
        {
          "id": 1167976,
          "author_name": "Theo Viel",
          "author_url": "",
          "post_date": "2021-01-24T16:10:06.083000",
          "content": "<p>True, I'll update the post</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 1165768,
      "author_name": "Yassine Alouini",
      "author_url": "",
      "post_date": "2021-01-23T08:21:04.027000",
      "content": "<p>I was looking for such a script and datasets. Thanks for sharing!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1093334,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-11-27T16:11:15.903000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1084216,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-11-19T20:48:43.420000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1102034,
      "author_name": "Buffalo Spdwy",
      "author_url": "",
      "post_date": "2020-12-04T13:56:01.620000",
      "content": "<p>Thanks for this tip :)</p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1083903": "If you want to save time during training and inference, it is a good thing to precompute the spectrograms and save them in your disk. You can easily get a huge (x1000) speed-up on your loading times by doing so.\n\n\nI've made public a script that precomputes spectrograms. Generation is done with multi-processing and takes about 1h30 for the train data and 45min for the test data  with `n_mels=128`: \n> https://www.kaggle.com/theoviel/spectrogram-generation\n\nYou can change the parameters and re-generate the data if you feel like it.\n\nHere are the associated datasets :\n\n- 16 kHz, 128 mels  (as mentioned by @cpmpml 16 kHz is not a great choice, using 32 kHz should be better)\n> Test data  : https://www.kaggle.com/theoviel/rcfx-test-spectrograms\n> Train data : https://www.kaggle.com/theoviel/rcfx-train-spectrograms\n\n- 32 kHz, 128 mels\n> Test + Train data : https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz\n\n- 32 kHz, 64 mels\n> Test + Train data : https://www.kaggle.com/theoviel/rcfx-spectrograms-32-khz-64-mels\n\n\nPlease let me know if there are any issues with the code.",
    "1167563": "You know that sampling at 16kHz removes frequencies above 8kHz right?  This means that some species are much harder to detect.",
    "1165768": "I was looking for such a script and datasets. Thanks for sharing!",
    "1093334": "",
    "1084216": "",
    "1102034": "Thanks for this tip :)"
  }
}