SEMGAN is a Speech Enhancement Multi-Discriminator Generative Adversarial Network implemented in Python. This project was developed as part of my B.Eng. thesis.
- Python 3.11 or higher
-
Clone the repository:
git clone git@github.com:Kabanosk/SEMGAN.git
-
Navigate to the project directory:
cd semgan
-
Install the dependencies using Poetry:
poetry install
To train the SEMGAN model, run the following command:
PYTHONPATH="." poetry run python3 src/train.py -c src/config/config.yaml
Make sure to update the configuration file src/config/config.yaml
with the desired settings before running the training script.
To enhance audio files using a trained SEMGAN model, use the following command:
PYTHONPATH="." poetry run python3 src/infer.py \
--model semgan \
--input path/to/input/audio \
--output path/to/output/directory \
--checkpoint path/to/model/checkpoint
Parameters:
-m
,--model
: Model architecture (segan or semgan)-i
,--input
: Path to input audio file or directory containing WAV files-o
,--output
: Path to output directory for enhanced audio--checkpoint
: Path to trained model checkpoint--sample_rate
: Target sample rate (default: 16000)--segment_length
: Audio segment length for processing (default: 16384)
The script will process all WAV files in the input directory and save the enhanced versions in the output directory.
This project is licensed under the MIT License. See the LICENSE file for more information.
For any questions or inquiries, please contact Wojciech Fiołka at fiolkawojciech@gmail.com.