{"id":24617736,"url":"https://github.com/jacoblincool/mpsenet","last_synced_at":"2025-08-01T02:17:11.237Z","repository":{"id":259836948,"uuid":"879433313","full_name":"JacobLinCool/MPSENet","owner":"JacobLinCool","description":"Python package of MP-SENet from Explicit Estimation of Magnitude and Phase Spectra in Parallel for High-Quality Speech Enhancement.","archived":false,"fork":false,"pushed_at":"2024-11-01T08:33:54.000Z","size":383,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T20:21:43.454Z","etag":null,"topics":["speech-enhancement"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/MPSENet","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/JacobLinCool.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":"2024-10-27T22:06:32.000Z","updated_at":"2025-02-01T01:28:39.000Z","dependencies_parsed_at":"2024-10-28T09:03:46.775Z","dependency_job_id":"77edfec1-3bde-4e0c-8df8-5bf2f708b628","html_url":"https://github.com/JacobLinCool/MPSENet","commit_stats":null,"previous_names":["jacoblincool/mpsenet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FMPSENet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FMPSENet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FMPSENet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FMPSENet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JacobLinCool","download_url":"https://codeload.github.com/JacobLinCool/MPSENet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252819662,"owners_count":21809061,"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":["speech-enhancement"],"created_at":"2025-01-24T23:40:21.108Z","updated_at":"2025-05-07T05:25:01.660Z","avatar_url":"https://github.com/JacobLinCool.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MPSENet\n\nPython package of [MP-SENet](https://github.com/yxlu-0102/MP-SENet) from [Explicit Estimation of Magnitude and Phase Spectra in Parallel for High-Quality Speech Enhancement](https://arxiv.org/abs/2308.08926).\n\n\u003e This package is inference only. To train the model, please refer to the original repository.\n\n## Installation\n\n```bash\npip install MPSENet\n```\n\n## Usage\n\n```python\nimport sys\nimport librosa\nimport soundfile as sf\nfrom MPSENet import MPSENet\n\nmodel = sys.argv[1]\nfilepath = sys.argv[2]\ndevice = sys.argv[3] if len(sys.argv) \u003e 3 else \"cpu\"\n\nmodel = MPSENet.from_pretrained(model).to(device)\nprint(f\"{model=}\")\n\nx, sr = librosa.load(filepath, sr=model.sampling_rate)\nprint(f\"{x.shape=}, {sr=}\")\n\ny, sr, notation = model(x)\nprint(f\"{y.shape=}, {sr=}, {notation=}\")\n\nsf.write(\"output.wav\", y, sr)\n```\n\n\u003e The best checkpoints trained by the original author are uploaded to Hugging Face's model hub: [g_best_dns](https://huggingface.co/JacobLinCool/MP-SENet-DNS) and [g_best_vb](https://huggingface.co/JacobLinCool/MP-SENet-VB)\n\n## Memory Usage and Speed\n\nBy default, the model will chunk the input audio into 2-second segments and process them one by one. This is to prevent memory overflow and allow the model to run on almost any machine out of the box.\n\nIf you have enough memory, you can set `segment_size` to a larger value (e.g., 160,000 for 10 seconds), which may help to generate better results in some cases.\n\n![Memory Usage and Speed](images/usage.jpg)\n\n| Segment Length (sec) | Max Memory (MB) | Runtime (sec) |\n| -------------------- | --------------- | ------------- |\n| 1                    | 388.38          | 0.0248        |\n| 2                    | 759.41          | 0.0526        |\n| 3                    | 1151.13         | 0.0784        |\n| 4                    | 1563.53         | 0.1082        |\n| 5                    | 2239.46         | 0.1436        |\n| 6                    | 3180.23         | 0.1836        |\n| 7                    | 4286.47         | 0.2641        |\n| 8                    | 5558.20         | 0.3161        |\n| 9                    | 6995.40         | 0.3640        |\n| 10                   | 8598.08         | 0.4197        |\n| 11                   | 10366.24        | 0.4729        |\n| 12                   | 12299.87        | 0.5390        |\n| 13                   | 14398.99        | 0.6204        |\n| 14                   | 16663.58        | 0.6922        |\n| 15                   | 19093.66        | 0.7638        |\n| 16                   | 21689.21        | 0.8480        |\n| 17                   | 24450.23        | 0.9302        |\n| 18                   | 27376.74        | 1.0135        |\n| 19                   | 30468.73        | 1.0935        |\n| 20                   | 33726.19        | 1.2075        |\n| 21                   | 37149.13        | 1.3012        |\n| 22                   | 40737.56        | 1.4260        |\n| 23                   | 44491.46        | 1.5061        |\n| 24                   | OOM             | OOM           |\n\n\u003e Tested on A40 GPU with 48G VRAM. See [scripts/benchmark.py](scripts/benchmark.py) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fmpsenet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacoblincool%2Fmpsenet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fmpsenet/lists"}