{"id":13861586,"url":"https://github.com/f90/Wave-U-Net-Pytorch","last_synced_at":"2025-07-14T09:32:45.129Z","repository":{"id":39428963,"uuid":"204523418","full_name":"f90/Wave-U-Net-Pytorch","owner":"f90","description":"Improved Wave-U-Net implemented in Pytorch","archived":false,"fork":false,"pushed_at":"2024-07-25T10:58:25.000Z","size":21095,"stargazers_count":294,"open_issues_count":10,"forks_count":62,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-05T06:03:27.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/f90.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":"2019-08-26T17:08:49.000Z","updated_at":"2024-08-05T06:03:31.263Z","dependencies_parsed_at":"2024-08-05T06:13:36.941Z","dependency_job_id":null,"html_url":"https://github.com/f90/Wave-U-Net-Pytorch","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/f90%2FWave-U-Net-Pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f90%2FWave-U-Net-Pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f90%2FWave-U-Net-Pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f90%2FWave-U-Net-Pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f90","download_url":"https://codeload.github.com/f90/Wave-U-Net-Pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225968843,"owners_count":17553146,"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":[],"created_at":"2024-08-05T06:01:25.644Z","updated_at":"2024-11-22T21:30:54.678Z","avatar_url":"https://github.com/f90.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Wave-U-Net (Pytorch)\n\u003ca href=\"https://replicate.ai/f90/wave-u-net-pytorch\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Replicate\u0026message=Demo and Docker Image\u0026color=darkgreen\" height=20\u003e\u003c/a\u003e\n\nImproved version of the [Wave-U-Net](https://arxiv.org/abs/1806.03185) for audio source separation, implemented in Pytorch.\n\nClick [here](www.github.com/f90/Wave-U-Net) for the original Wave-U-Net implementation in Tensorflow.\nYou can find more information about the model and results there as well.\n\n# Improvements\n\n* Multi-instrument separation by default, using a separate standard Wave-U-Net for each source (can be set to one model as well)\n* More scalable to larger data: A depth parameter D can be set that employs D convolutions for each single convolution in the original Wave-U-Net  \n* More configurable: Layer type, resampling factor at each level etc. can be easily changed (different normalization, residual connections...)\n* Fast training: Preprocesses the given dataset by saving the audio into HDF files, which can be read very quickly during training, thereby avoiding slowdown due to resampling and decoding\n* Modular thanks to Pytorch: Easily replace components of the model with your own variants/layers/losses\n* Better output handling: Separate output convolution for each source estimate with linear activation so amplitudes near 1 and -1 can be easily predicted, at test time thresholding to valid amplitude range [-1,1]\n* Fixed or dynamic resampling: Either use fixed lowpass filter to avoid aliasing during resampling, or use a learnable convolution\n\n# Installation\n\nGPU strongly recommended to avoid very long training times.\n\n### Option 1: Direct install (recommended)\n\nSystem requirements:\n* Linux-based OS\n* Python 3.6\n\n* [libsndfile](http://mega-nerd.com/libsndfile/) \n\n* [ffmpeg](https://www.ffmpeg.org/)\n* CUDA 10.1 for GPU usage\n\nClone the repository:\n```\ngit clone https://github.com/f90/Wave-U-Net-Pytorch.git\n```\n\nRecommended: Create a new virtual environment to install the required Python packages into, then activate the virtual environment:\n\n```\nvirtualenv --python /usr/bin/python3.6 waveunet-env\nsource waveunet-env/bin/activate\n```\n\nInstall all the required packages listed in the ``requirements.txt``:\n\n```\npip3 install -r requirements.txt\n```\n\n### Option 2: Singularity\n\nWe also provide a Singularity container which allows you to avoid installing the correct Python, CUDA and other system libraries, however we don't provide specific advice on how to run the container and so only do this if you have to or know what you are doing (since you need to mount dataset paths to the container etc.)\n\nTo pull the container, run\n```\nsingularity pull shub://f90/Wave-U-Net-Pytorch\n```\n\nThen run the container from the directory where you cloned this repository to, using the commands listed further below in this readme.\n\n# Download datasets\n\nTo directly use the pre-trained models we provide for download to separate your own songs, now skip directly to the [last section](#test), since the datasets are not needed in that case.\n\nTo start training your own models, download the [full MUSDB18HQ dataset](https://sigsep.github.io/datasets/musdb.html) and extract it into a folder of your choice. It should have two subfolders: \"test\" and \"train\" as well as a README.md file.\n\nYou can of course use your own datasets for training, but for this you would need to modify the code manually, which will not be discussed here. However, we provide a loading function for the normal MUSDB18 dataset as well.\n\n# Training the models\n\nTo train a Wave-U-Net, the basic command to use is\n\n```\npython3.6 train.py --dataset_dir /PATH/TO/MUSDB18HQ \n```\nwhere the path to MUSDB18HQ dataset needs to be specified, which contains the ``train`` and ``test`` subfolders.\n\nAdd more command line parameters as needed:\n* ``--cuda`` to activate GPU usage\n* ``--hdf_dir PATH`` to save the preprocessed data (HDF files) to custom location PATH, instead of the default ``hdf`` subfolder in this repository\n* ``--checkpoint_dir`` and ``--log_dir`` to specify where checkpoint files and logs are saved/loaded\n* ``--load_model checkpoints/model_name/checkpoint_X`` to start training with weights given by a certain checkpoint\n\nFor more config options, see ``train.py``.\n\nTraining progress can be monitored by using Tensorboard on the respective ``log_dir``.\nAfter training, the model is evaluated on the MUSDB18HQ test set, and SDR/SIR/SAR metrics are reported for all instruments and written into both the Tensorboard, and in more detail also into a ``results.pkl`` file in the ``checkpoint_dir``\n\n# \u003ca name=\"test\"\u003e\u003c/a\u003e Test trained models on songs!\n\nWe provide the default model in a pre-trained form as download so you can separate your own songs right away.\n\n## Downloading our pretrained models\n\nDownload our pretrained model [here](https://www.dropbox.com/s/r374hce896g4xlj/models.7z?dl=1).\nExtract the archive into the ``checkpoints`` subfolder in this repository, so that you have one subfolder for each model (e.g. ``REPO/checkpoints/waveunet``)\n\n## Run pretrained model\n\nTo apply our pretrained model to any of your own songs, simply point to its audio file path using the ``input_path`` parameter:\n\n```\npython3.6 predict.py --load_model checkpoints/waveunet/model --input \"audio_examples/Cristina Vane - So Easy/mix.mp3\"\n```\n\n* Add ``--cuda `` when using a GPU, it should be much quicker\n* Point ``--input`` to the music file you want to separate\n\nBy default, output is written where the input music file is located, using the original file name plus the instrument name as output file name. Use ``--output`` to customise the output directory.\n\nTo run your own model:\n* Point ``--load_model`` to the checkpoint file of the model you are using. If you used non-default hyper-parameters to train your own model, you must specify them here again so the correct model is set up and can receive the weights!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff90%2FWave-U-Net-Pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff90%2FWave-U-Net-Pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff90%2FWave-U-Net-Pytorch/lists"}