{"id":45693441,"url":"https://github.com/santi-pdp/segan_pytorch","last_synced_at":"2026-02-24T18:48:37.675Z","repository":{"id":33387009,"uuid":"121408418","full_name":"santi-pdp/segan_pytorch","owner":"santi-pdp","description":"Speech Enhancement Generative Adversarial Network in PyTorch ","archived":false,"fork":false,"pushed_at":"2023-08-16T00:14:13.000Z","size":566,"stargazers_count":359,"open_issues_count":29,"forks_count":110,"subscribers_count":12,"default_branch":"master","last_synced_at":"2023-12-04T09:20:25.853Z","etag":null,"topics":["deeplearning","gans","neural-network","pytorch","segan"],"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/santi-pdp.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":"2018-02-13T16:46:36.000Z","updated_at":"2023-11-26T13:00:00.000Z","dependencies_parsed_at":"2022-07-14T23:16:57.951Z","dependency_job_id":null,"html_url":"https://github.com/santi-pdp/segan_pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/santi-pdp/segan_pytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santi-pdp%2Fsegan_pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santi-pdp%2Fsegan_pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santi-pdp%2Fsegan_pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santi-pdp%2Fsegan_pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santi-pdp","download_url":"https://codeload.github.com/santi-pdp/segan_pytorch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santi-pdp%2Fsegan_pytorch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29795511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T16:37:37.581Z","status":"ssl_error","status_checked_at":"2026-02-24T16:37:37.074Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["deeplearning","gans","neural-network","pytorch","segan"],"created_at":"2026-02-24T18:48:33.831Z","updated_at":"2026-02-24T18:48:37.666Z","avatar_url":"https://github.com/santi-pdp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Speech Enhancement Generative Adversarial Network in PyTorch\n\n### Requirements\n\n```\nSoundFile==0.10.2\nscipy==1.1.0\nlibrosa==0.6.1\nh5py==2.8.0\nnumba==0.38.0\ntorch==0.4.1\nmatplotlib==2.2.2\nnumpy==1.14.3\npyfftw==0.10.4\ntensorboardX==1.4\ntorchvision==0.2.1\n```\nAhoprocessing tools (`ahoproc_tools`) is also needed, and the public repo is found [here](git@github.com:santi-pdp/ahoproc_tools.git).\n\n### Audio Samples\n\nLatest denoising audio samples with baselines can be found in the [segan+ samples website](http://veu.talp.cat/seganp/). SEGAN is the vanilla SEGAN version (like the one in TensorFlow repo), whereas SEGAN+ is the shallower improved version included as default parameters of this repo.\n\nThe voicing/dewhispering audio samples can be found in the [whispersegan samples website](http://veu.talp.cat/whispersegan). Artifacts can now be palliated a bit more with `--interf_pair` fake signals, more data than the one we had available (just 20 mins with 1 speaker per model) and longer training session by iterating more than `100 epoch`.\n\n### Pretrained Models\n\nSEGAN+ generator weights are released and can be downloaded in [this link](http://veu.talp.cat/seganp/release_weights/segan+_generator.ckpt). Make sure you place this file into the `ckpt_segan+` directory to make it work with the proper `train.opts` config file within that folder. The script `run_segan+_clean.sh` will properly read the ckpt in that directory as it is configured to be used with this referenced file.\n\n### Introduction to scripts\n\nTwo models are ready to train and use to make wav2wav speech enhancement conversions. SEGAN+ is an\nimproved version of SEGAN [1], denoising utterances with its generator network (G). \n\n![SEGAN+_G](assets/segan+.png)\n\nTo train this model, the following command should be ran:\n\n```\npython train.py --save_path ckpt_segan+ --batch_size 300 \\\n\t\t--clean_trainset data/clean_trainset \\\n\t\t--noisy_trainset data/noisy_trainset \\\n\t\t--cache_dir data/cache\n```\n\nRead `run_segan+_train.sh` for more guidance. This will use the default parameters to structure both G and D, but they can be tunned with many options. For example, one can play with `--d_pretrained_ckpt` and/or `--g_pretrained_ckpt` to specify a departure pre-train checkpoint to fine-tune some characteristics of our enhancement system, like language, as in [2].\n\nCleaning files is done by specifying the generator weights checkpoint, its config file from training and appropriate paths for input and output files (Use `soundfile` wav writer backend (recommended) specifying the `--soundfile` flag):\n\n```\npython clean.py --g_pretrained_ckpt ckpt_segan+/\u003cweights_ckpt_for_G\u003e \\\n\t\t--cfg_file ckpt_segan+/train.opts --synthesis_path enhanced_results \\\n\t\t--test_files data/noisy_testset --soundfile\n```\n\nRead `run_segan+_clean.sh` for more guidance.\n\nThere is a WSEGAN, which stands for the dewhispering SEGAN [3]. This system is activated (rather than vanilla SEGAN) by specifying the `--wsegan` flag. Additionally, the `--misalign_pair` flag will add another fake pair to the adversarial loss indicating that content changes between input and output of G is bad, something that improved our results for [3].\n\n### References:\n\n1. [SEGAN: Speech Enhancement Generative Adversarial Network (Pascual et al. 2017)](https://arxiv.org/abs/1703.09452)\n2. [Language and Noise Transfer in Speech Enhancement GAN (Pascual et al. 2018)](https://arxiv.org/abs/1712.06340)\n3. [Whispered-to-voiced Alaryngeal Speech Conversion with GANs (Pascual et al. 2018)](https://arxiv.org/abs/1808.10687)\n\n### Cite\n\n```\n@article{pascual2017segan,\n  title={SEGAN: Speech Enhancement Generative Adversarial Network},\n  author={Pascual, Santiago and Bonafonte, Antonio and Serr{\\`a}, Joan},\n  journal={arXiv preprint arXiv:1703.09452},\n  year={2017}\n}\n```\n\n### Notes\n\n* Multi-GPU is not supported yet in this framework.\n* Virtual Batch Norm is not included as in the very first SEGAN code, as similar results to those of original paper can be obtained with regular BatchNorm in D (ONLY D).\n* If using this code, parts of it, or developments from it, please cite the above reference.\n* We do not provide any support or assistance for the supplied code nor we offer any other compilation/variant of it.\n* We assume no responsibility regarding the provided code.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanti-pdp%2Fsegan_pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanti-pdp%2Fsegan_pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanti-pdp%2Fsegan_pytorch/lists"}