{"id":13935767,"url":"https://github.com/DemisEom/SpecAugment","last_synced_at":"2025-07-19T21:30:33.773Z","repository":{"id":37334994,"uuid":"183140817","full_name":"DemisEom/SpecAugment","owner":"DemisEom","description":"A Implementation of SpecAugment with Tensorflow \u0026 Pytorch, introduced by Google Brain","archived":false,"fork":false,"pushed_at":"2022-04-05T00:46:37.000Z","size":438,"stargazers_count":650,"open_issues_count":25,"forks_count":135,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-08T23:43:51.954Z","etag":null,"topics":["data-augmentation","python","pytorch","specaugment","speech","speech-recognition","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DemisEom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-24T03:29:51.000Z","updated_at":"2025-07-03T06:21:39.000Z","dependencies_parsed_at":"2022-08-18T03:45:48.796Z","dependency_job_id":null,"html_url":"https://github.com/DemisEom/SpecAugment","commit_stats":null,"previous_names":["shelling203/specaugment"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DemisEom/SpecAugment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DemisEom%2FSpecAugment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DemisEom%2FSpecAugment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DemisEom%2FSpecAugment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DemisEom%2FSpecAugment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DemisEom","download_url":"https://codeload.github.com/DemisEom/SpecAugment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DemisEom%2FSpecAugment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266019657,"owners_count":23864916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-augmentation","python","pytorch","specaugment","speech","speech-recognition","tensorflow"],"created_at":"2024-08-07T23:02:04.820Z","updated_at":"2025-07-19T21:30:33.768Z","avatar_url":"https://github.com/DemisEom.png","language":"Python","readme":"# SpecAugment [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\nThis is a implementation of SpecAugment that speech data augmentation method which directly process the spectrogram with Tensorflow \u0026 Pytorch, introduced by Google Brain[1]. This is currently under the Apache 2.0, Please feel free to use for your project. Enjoy!\n\n## How to use\n\nFirst, you need to have python 3 installed along with [Tensorflow](https://www.tensorflow.org/install/).\n\nNext, you need to install some audio libraries work properly. To install the requirement packages. Run the following command:\n\n```bash\npip3 install SpecAugment\n```\n\nAnd then, run the specAugment.py program. It modifies the spectrogram by warping it in the time direction, masking blocks of consecutive frequency channels, and masking blocks of utterances in time.\n\n#### *Try your audio file SpecAugment*\n\n```shell\n$ python3\n```\n\n```python\n\u003e\u003e\u003e import librosa\n\u003e\u003e\u003e from specAugment import spec_augment_tensorflow\n# If you are Pytorch, then import spec_augment_pytorch instead of spec_augment_tensorflow\n\u003e\u003e\u003e audio, sampling_rate = librosa.load(audio_path)\n\u003e\u003e\u003e mel_spectrogram = librosa.feature.melspectrogram(y=audio,\n                                                     sr=sampling_rate,\n                                                     n_mels=256,\n                                                     hop_length=128,\n                                                     fmax=8000)\n\u003e\u003e\u003e warped_masked_spectrogram = spec_augment_tensorflow.spec_augment(mel_spectrogram=mel_spectrogram)\n\u003e\u003e\u003e print(warped_masked_spectrogram)\n'\n[[1.54055389e-01 7.51822486e-01 7.29588015e-01 ... 1.03616300e-01\n  1.04682689e-01 1.05411769e-01]\n [2.21608739e-01 1.38559084e-01 1.01564167e-01 ... 4.19907116e-02\n  4.86430404e-02 5.27331798e-02]\n [3.62784019e-01 2.09934399e-01 1.79158230e-01 ... 2.42307431e-01\n  3.18662338e-01 3.67405599e-01]\n ...\n [6.36117335e-07 8.06897948e-07 8.55346431e-07 ... 2.84445018e-07\n  4.02975952e-07 5.57131738e-07]\n [6.27753429e-07 7.53681318e-07 8.13035033e-07 ... 1.35111146e-07\n  2.74058225e-07 4.56901031e-07]\n [0.00000000e+00 7.48416680e-07 5.51771037e-07 ... 1.13901361e-07\n  2.56365068e-07 4.43868592e-07]]\n'\n```\nLearn more examples about how to do specific tasks in SpecAugment at the test code.\n\n```bash\npython spec_augment_test.py\n```\nIn test code, we using one of the [LibriSpeech dataset](http://www.openslr.org/12/).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shelling203/SpecAugment/blob/master/images/Figure_1.png\" alt=\"Example result of base spectrogram\"/ width=600\u003e\n  \u003cimg src=\"https://github.com/shelling203/SpecAugment/blob/master/images/Figure_2.png\" alt=\"Example result of base spectrogram\"/ width=600\u003e\n\u003c/p\u003e\n\n\n# Reference\n\n1. https://arxiv.org/pdf/1904.08779.pdf\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDemisEom%2FSpecAugment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDemisEom%2FSpecAugment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDemisEom%2FSpecAugment/lists"}