{"id":22111751,"url":"https://github.com/agentmaker/paddle-librosa","last_synced_at":"2025-03-24T04:34:33.800Z","repository":{"id":112830444,"uuid":"413942417","full_name":"AgentMaker/Paddle-Librosa","owner":"AgentMaker","description":"Paddle-Librosa provides Paddle implementation of some librosa functions","archived":false,"fork":false,"pushed_at":"2021-11-20T11:06:07.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T10:34:05.221Z","etag":null,"topics":["librosa","paddlepaddle"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AgentMaker.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-05T18:52:30.000Z","updated_at":"2021-12-02T09:40:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"96cd7766-f352-4176-9e8a-9ddf335aadeb","html_url":"https://github.com/AgentMaker/Paddle-Librosa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentMaker%2FPaddle-Librosa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentMaker%2FPaddle-Librosa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentMaker%2FPaddle-Librosa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentMaker%2FPaddle-Librosa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgentMaker","download_url":"https://codeload.github.com/AgentMaker/Paddle-Librosa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245211925,"owners_count":20578437,"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":["librosa","paddlepaddle"],"created_at":"2024-12-01T10:51:58.114Z","updated_at":"2025-03-24T04:34:33.780Z","avatar_url":"https://github.com/AgentMaker.png","language":"Python","readme":"# Paddle-Librosa: Paddle implementation of Librosa\n\nThis codebase provides Paddle implementation of some librosa functions. If users previously used for training cpu-extracted features from librosa, but want to add GPU acceleration during training and evaluation, Paddle-Librosa will provide almost identical features to standard paddlelibrosa functions (numerical difference less than 1e-5).\n\n## Install\n### From PyPI\n```bash\npip install paddlelibrosa\n```\n### From GitHub\n```bash\n$ git clone https://github.com/AgentMaker/Paddle-Librosa.git\n$ pip install Paddle-Librosa/\n```\n\n## Examples 1\n\nExtract Log mel spectrogram with Paddle-Librosa.\n\n```python\nimport paddle\nimport paddlelibrosa as pl\n\nbatch_size = 16\nsample_rate = 22050\nwin_length = 2048\nhop_length = 512\nn_mels = 128\n\nbatch_audio = paddle.uniform((batch_size, sample_rate))  # (batch_size, sample_rate)\n\n# Paddle-Librosa feature extractor the same as librosa.feature.melspectrogram()\nfeature_extractor = paddle.nn.Sequential(\n    pl.Spectrogram(\n        hop_length=hop_length,\n        win_length=win_length,\n    ), pl.LogmelFilterBank(\n        sr=sample_rate,\n        n_mels=n_mels,\n        is_log=False, # Default is true\n    ))\nbatch_feature = feature_extractor(batch_audio) # (batch_size, 1, time_steps, mel_bins)\n```\n\n## Examples 2\n\nExtracting spectrogram, then log mel spectrogram, STFT and ISTFT with Paddle-Librosa.\n\n```python\nimport paddle\nimport paddlelibrosa as pl\n\nbatch_size = 16\nsample_rate = 22050\nwin_length = 2048\nhop_length = 512\nn_mels = 128\n\nbatch_audio = paddle.empty(batch_size, sample_rate).uniform_(-1, 1)  # (batch_size, sample_rate)\n\n# Spectrogram\nspectrogram_extractor = pl.Spectrogram(n_fft=win_length, hop_length=hop_length)\nsp = spectrogram_extractor.forward(batch_audio)   # (batch_size, 1, time_steps, freq_bins)\n\n# Log mel spectrogram\nlogmel_extractor = pl.LogmelFilterBank(sr=sample_rate, n_fft=win_length, n_mels=n_mels)\nlogmel = logmel_extractor.forward(sp)   # (batch_size, 1, time_steps, mel_bins)\n\n# STFT\nstft_extractor = pl.STFT(n_fft=win_length, hop_length=hop_length)\n(real, imag) = stft_extractor.forward(batch_audio)\n# real: (batch_size, 1, time_steps, freq_bins), imag: (batch_size, 1, time_steps, freq_bins) #\n\n# ISTFT\nistft_extractor = pl.ISTFT(n_fft=win_length, hop_length=hop_length)\ny = istft_extractor.forward(real, imag, length=batch_audio.shape[-1])    # (batch_size, samples_num)\n```\n\n## External links\nOther related repos include:\n\ntorchlibrosa: https://github.com/qiuqiangkong/torchlibrosa\n\n## Contact us\nEmail : [agentmaker@163.com]()\u003cbr\u003e\nQQ Group : 1005109853\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentmaker%2Fpaddle-librosa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentmaker%2Fpaddle-librosa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentmaker%2Fpaddle-librosa/lists"}