Code for the paper Hybrid Spectrogram and Waveform Source Separation

Related tags

Deep Learning demucs
Overview

Demucs Music Source Separation

tests badge linter badge

This is the 3rd release of Demucs (v3), featuring hybrid source separation. For the waveform only Demucs (v2): Go this commit. If you are experiencing issues and want the old Demucs back, please fill an issue, and then you can get back to the v2 with git checkout v2.

We provide an implementation of Hybrid Demucs for music source separation, trained both on the MusDB HQ dataset, and with internal extra training data. They can separate drums, bass and vocals from the rest and achieved the first rank at the 2021 Sony Music DemiXing Challenge (MDX)

Demucs is based on U-Net convolutional architecture inspired by Wave-U-Net. The most recent version features hybrid spectrogram/waveform separation, along with compressed residual branches, local attention and singular value regularization. Checkout our paper Hybrid Spectrogram and Waveform Source Separation for more details. As far as we know, Demucs is currently the only model supporting true end-to-end hybrid model training with shared information between the domains, as opposed to post-training model blending.

When trained only on MusDB HQ, Hybrid Demucs achieved a SDR of 7.33 on the MDX test set, and 8.11 dB with 200 extra training tracks. It is particularly efficient for drums and bass extraction, although KUIELAB-MDX-Net performs better for vocals and other accompaniments.

Schema representing the structure of Demucs,
    with a dual U-Net structure with a shared core, one branch for the temporal domain,
    and one branch for the spectral domain.

Important news if you are already using Demucs

See the release notes for more details.

  • 12/11/2021: Releasing Demucs v3 with hybrid domain separation. Strong improvements on all sources. This is the model that won Sony MDX challenge.
  • 11/05/2021: Adding support for MusDB-HQ and arbitrary wav set, for the MDX challenge. For more information on joining the challenge with Demucs see the Demucs MDX instructions
  • 28/04/2021: Demucs v2, with extra augmentation and DiffQ based quantization. EVERYTHING WILL BREAK, please restart from scratch following the instructions hereafter. This version also adds overlap between prediction frames, with linear transition from one to the next, which should prevent sudden changes at frame boundaries. Also, Demucs is now on PyPI, so for separation only, installation is as easy as pip install demucs :)
  • 13/04/2020: Demucs released under MIT: We are happy to release Demucs under the MIT licence. We hope that this will broaden the impact of this research to new applications.

Comparison with other models

We provide hereafter a summary of the different metrics presented in the paper. You can also compare Hybrid Demucs (v3), KUIELAB-MDX-Net, Spleeter, Open-Unmix, Demucs (v1), and Conv-Tasnet on one of my favorite songs on my soundcloud playlist.

Comparison of accuracy

Overall SDR is the mean of the SDR for each of the 4 sources, MOS Quality is a rating from 1 to 5 of the naturalness and absence of artifacts given by human listeners (5 = no artifacts), MOS Contamination is a rating from 1 to 5 with 5 being zero contamination by other sources. We refer the reader to our paper, for more details.

Model Domain Extra data? Overall SDR MOS Quality MOS Contamination
Wave-U-Net waveform no 3.2 - -
Open-Unmix spectrogram no 5.3 - -
D3Net spectrogram no 6.0 - -
Conv-Tasnet waveform no 5.7 -
Demucs (v2) waveform no 6.3 2.37 2.36
ResUNetDecouple+ spectrogram no 6.7 - -
KUIELAB-MDX-Net hybrid no 7.5 2.86 2.55
Hybrid Demucs (v3) hybrid no 7.7 2.83 3.04
MMDenseLSTM spectrogram 804 songs 6.0 - -
D3Net spectrogram 1.5k songs 6.7 - -
Spleeter spectrogram 25k songs 5.9 - -

Requirements

You will need at least Python 3.7. See requirements_minimal.txt for requirements for separation only, and environment-[cpu|cuda].yml (or requirements.txt) if you want to train a new model.

For Windows users

Everytime you see python3, replace it with python.exe. You should always run commands from the Anaconda console.

For musicians

If you just want to use Demucs to separate tracks, you can install it with

python3 -m pip -U install demucs

Advanced OS support are provided on the following page, you must read the page for your OS before posting an issues:

For machine learning scientists

If you have anaconda installed, you can run from the root of this repository:

conda env update -f environment-cpu.yml  # if you don't have GPUs
conda env update -f environment-cuda.yml # if you have GPUs
conda activate demucs
pip install -e .

This will create a demucs environment with all the dependencies installed.

You will also need to install soundstretch/soundtouch: on Mac OSX you can do brew install sound-touch, and on Ubuntu sudo apt-get install soundstretch. This is used for the pitch/tempo augmentation.

Running in Docker

Thanks to @xserrat, there is now a Docker image definition ready for using Demucs. This can ensure all libraries are correctly installed without interfering with the host OS. See his repo Docker Facebook Demucs for more information.

Running from Colab

I made a Colab to easily separate track with Demucs. Note that transfer speeds with Colab are a bit slow for large media files, but it will allow you to use Demucs without installing anything.

Demucs on Google Colab

Web Demo

(Possibly broken with the update, need to investigate) Integrated to Huggingface Spaces with Gradio. See demo: Hugging Face Spaces

Separating tracks

In order to try Demucs, you can just run from any folder (as long as you properly installed it)

demucs PATH_TO_AUDIO_FILE_1 [PATH_TO_AUDIO_FILE_2 ...]   # for Demucs
# If you used `pip install --user` you might need to replace demucs with python3 -m demucs
python3 -m demucs --mp3 --mp3-bitrate BITRATE PATH_TO_AUDIO_FILE_1  # output files saved as MP3
# If your filename contain spaces don't forget to quote it !!!
demucs "my music/my favorite track.mp3"
# You can select different models with `-n` mdx_q is the quantized model, smaller but maybe a bit less accurate.
demucs -n mdx_q myfile.mp3

If you have a GPU, but you run out of memory, please add -d cpu to the command line. See the section hereafter for more details on the memory requirements for GPU acceleration.

Separated tracks are stored in the separated/MODEL_NAME/TRACK_NAME folder. There you will find four stereo wav files sampled at 44.1 kHz: drums.wav, bass.wav, other.wav, vocals.wav (or .mp3 if you used the --mp3 option).

All audio formats supported by torchaudio can be processed (i.e. wav, mp3, flac, ogg/vorbis on Linux/Mac OS X etc.). On Windows, torchaudio has limited support, so we rely on ffmpeg, which should support pretty much anything. Audio is resampled on the fly if necessary. The output will be a wave file, either in int16 format or float32 (if --float32 is passed). You can pass --mp3 to save as mp3 instead, and set the bitrate with --mp3-bitrate (default is 320kbps).

Other pre-trained models can be selected with the -n flag. The list of pre-trained models is:

  • mdx: trained only on MusDB HQ, winning model on track A at the MDX challenge.
  • mdx_extra: trained with extra training data (including MusDB test set), ranked 2nd on the track B of the MDX challenge.
  • mdx_q, mdx_extra_q: quantized version of the previous models. Smaller download and storage but quality can be slightly worse. mdx_extra_q is the default model used.
  • SIG: where SIG is a single model from the model zoo.

The --shifts=SHIFTS performs multiple predictions with random shifts (a.k.a the shift trick) of the input and average them. This makes prediction SHIFTS times slower. Don't use it unless you have a GPU.

The --overlap option controls the amount of overlap between prediction windows (for Demucs one window is 10 seconds). Default is 0.25 (i.e. 25%) which is probably fine.

Memory requirements for GPU acceleration

If you want to use GPU acceleration, you will need at least 8GB of RAM on your GPU for demucs. Sorry, the code for demucs is not super optimized for memory! If you do not have enough memory on your GPU, simply add -d cpu to the command line to use the CPU. With Demucs, processing time should be roughly equal to 1.5 times the duration of the track.

Training Demucs

If you want to train (Hybrid) Demucs, please follow the training doc.

MDX Challenge reproduction

In order to reproduce the results from the Track A and Track B submissions, checkout the MDX Hybrid Demucs submission repo.

How to cite

@inproceedings{defossez2021hybrid,
  title={Hybrid Spectrogram and Waveform Source Separation},
  author={D{\'e}fossez, Alexandre},
  booktitle={Proceedings of the ISMIR 2021 Workshop on Music Source Separation},
  year={2021}
}

License

Demucs is released under the MIT license as found in the LICENSE file.

Comments
  • How I use it?

    How I use it?

    I tried to install for 5 hours but I never go more far than the first step. I always got this error:

    'conda env update -f environment-cpu.yml

    EnvironmentFileNotFound: '/Users/montserratbartoky/environment-cpu.yml' file not found'

    A video tutorial is the perfect thing for help us to try demucs.

    opened by brianbar1 43
  • CUDA out of memory while processing long tracks

    CUDA out of memory while processing long tracks

    Hello,

    First of all -- thank you for this great product. It works flawlessly using CPU.

    I'm trying to process material faster by using a GPU on an AWS EC2 instance. Unfortunately, it terminates with the following error:

    $ demucs audio.mp3 -d cuda
    
    Selected model is a bag of 4 models. You will see that many progress bars per track.
    Separated tracks will be stored in /home/ec2-user/separated/mdx_extra_q
    Separating track audio.mp3
    100%|██████████████████████████████████████████████████████████████████████| 4356.0/4356.0 [01:35<00:00, 45.42seconds/s]
    
    Traceback (most recent call last):
      File "/home/ec2-user/.local/bin/demucs", line 8, in <module>
        sys.exit(main())
      File "/home/ec2-user/.local/lib/python3.7/site-packages/demucs/separate.py", line 120, in main
        overlap=args.overlap, progress=True)[0]
      File "/home/ec2-user/.local/lib/python3.7/site-packages/demucs/apply.py", line 147, in apply_model
        estimates += out
    RuntimeError: CUDA out of memory. Tried to allocate 5.71 GiB (GPU 0; 14.76 GiB total capacity; 9.12 GiB already allocated; 4.33 GiB free; 9.15 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
    

    Info about the running environment:

    • Python 3.7.10 and PyTorch 1.10.0
    • AWS EC2 instance type: g4dn.xlarge
    • Operating system and version:
    Deep Learning AMI GPU PyTorch 1.10.0 (Amazon Linux 2) 20211115
    
    • GPU Hardware:
    NVIDIA Corporation TU104GL [Tesla T4] (rev a1)
    Driver Version: 470.57.02    CUDA Version: 11.4
    15109MiB memory
    

    Do the models require a card with more than 16 GB RAM? If that's not your experience, can you share your hardware/software environment, so that I can retry. Thank you.

    bug 
    opened by famzah 30
  • ayuda, no entiendo nada

    ayuda, no entiendo nada

    hola, para empezar, nunca usé nada así, sólo vi el video de Jaime Altozano y me dio curiosidad, pero nunca pude hacer que funcione, alguien me puede explicar?

    opened by Argus520 24
  • musdb18HQ

    musdb18HQ

    Hi, I'm interested in retraining with the HQ version of musdb, and the ability to load this version of musdb would make a great addition to the project, Thanks

    opened by DerryFitz 15
  • What do I need to do to prep for training a drum loop demixer, I have a 500GB data set, 100k examples

    What do I need to do to prep for training a drum loop demixer, I have a 500GB data set, 100k examples

    I'd like to create a model that I can use to demix drum loops. I have 500 GB that contains over 100k of examples (600k WAVs), each is 13 seconds long, 16 bit, 44.1 khz stereo.

    drumloop_mixed = { bass_drum, snares_claps, tuned_drums, brass_percussion & other_sounds }

    What should I change (config file, cli parameters) to enable me to do customize for extracting the stems/tracks listed above?

    Does this model support splitting 5 stems?

    What file structure do I need to have in place or do I need to create a JSON or a CSV with the file locations?

    Do I need to have a scratch or caching disk? If so how much space should I plan for ( such as 2 x dataset size) ?

    What should I expect in regards of RAM? Will I need a very large amount of RAM or will it stream the WAV data off disk?

    Does demucs use multi-cpu's? Given I have so many wav files does it make sense to give it a large number of CPUs (64, 96) to speed up preprocessing?

    Will demucs use the GPU right away or does it start by processing the files, using the CPU and then switch to the GPU once preprocessing is done?

    Can I use multiple GPUs to speed up training? Is there any limits on what type of GPUs (I'm thinking Nvidia V100s)?

    Is there anything that I didn't ask but I should know?

    Much appreciated, can't wait to get this experiment running.. 🤓

    question 
    opened by dustyny 14
  • demucs.separate: error: the following arguments are required: tracks

    demucs.separate: error: the following arguments are required: tracks

    Después de solucionar varias faltas de módulos, me llega este error, estoy por tirar la toalla, ayuda por favor...por cierto estoy en Mac OS X

    Gracias

    opened by Nicko2679 12
  • Gradio demo gives error doesn't work anymore

    Gradio demo gives error doesn't work anymore

    🐛 Bug Report

    a few days ago Gradio demo has stopped working, the rendering freezes and gives an error Any suggestion?i don't know but probably server is too busy

    To Reproduce

    1. Upload a track on gradio demo
    2. submit for render
    3. response error

    Environment https://huggingface.co/spaces/akhaliq/demucs

    • Gradio demo for Demucs: Music Source Separation in the Waveform Domain
    bug 
    opened by vespersland 11
  • Installation fails on MacOS (conflicting dependencies)

    Installation fails on MacOS (conflicting dependencies)

    🐛 Bug Report

    python3 -m pip install --user -U demucs command fails on MacOS.

    Running:

    • BigSur v11.6 on M1 chip
    • Python 3.10.1 with pip-21.3.1

    To Reproduce

    1. Run python3 -m pip install --user -U demucs

    Expected behavior

    Returns

    Collecting demucs
      Using cached demucs-3.0.1.tar.gz (1.5 MB)
      Preparing metadata (setup.py) ... done
    Collecting dora-search
      Using cached dora_search-0.1.7.tar.gz (68 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting demucs
      Using cached demucs-3.0.0.tar.gz (1.5 MB)
      Preparing metadata (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_3d8567b52f024f7a8b8e2e3c8e5db5d6/setup.py'"'"'; __file__='"'"'/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_3d8567b52f024f7a8b8e2e3c8e5db5d6/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-pip-egg-info-92s0nt5s
           cwd: /private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_3d8567b52f024f7a8b8e2e3c8e5db5d6/
      Complete output (7 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_3d8567b52f024f7a8b8e2e3c8e5db5d6/setup.py", line 39, in <module>
          REQUIRED = load_requirements('requirements_minimal.txt')
        File "/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_3d8567b52f024f7a8b8e2e3c8e5db5d6/setup.py", line 34, in load_requirements
          required = [i.strip() for i in open(HERE / name)]
      FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_3d8567b52f024f7a8b8e2e3c8e5db5d6/requirements_minimal.txt'
      ----------------------------------------
    WARNING: Discarding https://files.pythonhosted.org/packages/5b/a5/d29ca8f45f1d6dc814d595b9874cb209d45e97c1bbfb41c48968be2e1231/demucs-3.0.0.tar.gz#sha256=d91beb476dfec0362a531a935429f429f3f8dae0d0772da3efb4fad73e9116d2 (from https://pypi.org/simple/demucs/) (requires-python:>=3.7.0). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
      Using cached demucs-2.0.3.tar.gz (51 kB)
      Preparing metadata (setup.py) ... done
    Collecting diffq>=0.1
      Using cached diffq-0.2.0.tar.gz (39 kB)
      Preparing metadata (setup.py) ... done
    Collecting demucs
      Using cached demucs-2.0.2.tar.gz (51 kB)
      Preparing metadata (setup.py) ... done
      Using cached demucs-2.0.1.tar.gz (51 kB)
      Preparing metadata (setup.py) ... done
      Using cached demucs-2.0.0.tar.gz (45 kB)
      Preparing metadata (setup.py) ... done
      Using cached demucs-0.0.2.tar.gz (45 kB)
      Preparing metadata (setup.py) ... done
      Using cached demucs-0.0.1.tar.gz (45 kB)
      Preparing metadata (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_0a29a721dbf14a6384fcc442088ce467/setup.py'"'"'; __file__='"'"'/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_0a29a721dbf14a6384fcc442088ce467/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-pip-egg-info-n7xrmiyp
           cwd: /private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_0a29a721dbf14a6384fcc442088ce467/
      Complete output (5 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_0a29a721dbf14a6384fcc442088ce467/setup.py", line 25, in <module>
          REQUIRED = [i.strip() for i in open(HERE / "requirements.txt")]
      FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_0a29a721dbf14a6384fcc442088ce467/requirements.txt'
      ----------------------------------------
    WARNING: Discarding https://files.pythonhosted.org/packages/f0/0b/ebb129e8724e8822e8f94e231118109f73b4a77ff76d47142e0fced854d7/demucs-0.0.1.tar.gz#sha256=76841228f4befedd0e94387c0a0f03e0b3ab8aacf40001a8f4b062b28160535d (from https://pypi.org/simple/demucs/) (requires-python:>=3.7.0). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
      Using cached demucs-0.0.0.tar.gz (1.5 kB)
      Preparing metadata (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_2926f03aaabc4535a74e279043def8ca/setup.py'"'"'; __file__='"'"'/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_2926f03aaabc4535a74e279043def8ca/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-pip-egg-info-tw41krwz
           cwd: /private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_2926f03aaabc4535a74e279043def8ca/
      Complete output (5 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/private/var/folders/s0/ks_8g5zn125076cpkskl_rvc0000gn/T/pip-install-e05p_m7_/demucs_2926f03aaabc4535a74e279043def8ca/setup.py", line 19, in <module>
          REQUIRED = [i.strip() for i in open("requirements.txt")]
      FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
      ----------------------------------------
    WARNING: Discarding https://files.pythonhosted.org/packages/80/04/5d0473a2e1261c3789ff6083febb5f797776a42dbbe069691b9cc73c9f10/demucs-0.0.0.tar.gz#sha256=8050de572ca5806244a28130b71b81d2542a02ebb91f37ff727becd7eb03debf (from https://pypi.org/simple/demucs/) (requires-python:>=3.7.0). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    ERROR: Cannot install demucs==0.0.2, demucs==2.0.0, demucs==2.0.1, demucs==2.0.2, demucs==2.0.3 and demucs==3.0.1 because these package versions have conflicting dependencies.
    
    The conflict is caused by:
        demucs 3.0.1 depends on diffq>=0.2.1
        demucs 2.0.3 depends on lameenc>=1.2
        demucs 2.0.2 depends on lameenc>=1.2
        demucs 2.0.1 depends on lameenc>=1.2
        demucs 2.0.0 depends on lameenc>=1.2
        demucs 0.0.2 depends on lameenc>=1.2
    
    To fix this you could try to:
    1. loosen the range of package versions you've specified
    2. remove package versions to allow pip attempt to solve the dependency conflict
    
    ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
    

    Your Environment

    • BigSur v11.6 on M1 chip, 16GB RAM
    • Python 3.10.1 with pip-21.3.1
    bug 
    opened by PierreMarieRiviere 11
  • Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll

    Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll

    (base) D:\Program>cd demucs

    (base) D:\Program\demucs>conda env update -f environment-cpu.yml Collecting package metadata (repodata.json): done Solving environment: done Ran pip subprocess with arguments: ['D:\Program\Anaconda\envs\demucs\python.exe', '-m', 'pip', 'install', '-U' , '-r', 'D:\Program\demucs\condaenv.0z3apytv.requirements.txt'] Pip subprocess output: Requirement already up-to-date: musdb==0.3.1 in d:\program\anaconda\envs\demucs
    lib\site-packages (from -r D:\Program\demucs\condaenv.0z3apytv.requirements.txt (line 1)) (0.3.1) Requirement already up-to-date: museval==0.3.0 in d:\program\anaconda\envs\demuc s\lib\site-packages (from -r D:\Program\demucs\condaenv.0z3apytv.requirements.tx t (line 2)) (0.3.0) Requirement already up-to-date: requests==2.22 in d:\program\anaconda\envs\demuc s\lib\site-packages (from -r D:\Program\demucs\condaenv.0z3apytv.requirements.tx t (line 3)) (2.22.0) Requirement already up-to-date: treetable==0.2.3 in d:\program\anaconda\envs\dem ucs\lib\site-packages (from -r D:\Program\demucs\condaenv.0z3apytv.requirements. txt (line 4)) (0.2.3) Requirement already satisfied, skipping upgrade: soundfile>=0.9.0 in d:\program
    anaconda\envs\demucs\lib\site-packages (from musdb==0.3.1->-r D:\Program\demucs
    condaenv.0z3apytv.requirements.txt (line 1)) (0.10.3.post1) Requirement already satisfied, skipping upgrade: pyaml in d:\program\anaconda\en vs\demucs\lib\site-packages (from musdb==0.3.1->-r D:\Program\demucs\condaenv.0z 3apytv.requirements.txt (line 1)) (19.12.0) Requirement already satisfied, skipping upgrade: tqdm in d:\program\anaconda\env s\demucs\lib\site-packages (from musdb==0.3.1->-r D:\Program\demucs\condaenv.0z3 apytv.requirements.txt (line 1)) (4.36.1) Requirement already satisfied, skipping upgrade: stempeg>=0.1.7 in d:\program\an aconda\envs\demucs\lib\site-packages (from musdb==0.3.1->-r D:\Program\demucs\co ndaenv.0z3apytv.requirements.txt (line 1)) (0.1.8) Requirement already satisfied, skipping upgrade: numpy>=1.7 in d:\program\anacon da\envs\demucs\lib\site-packages (from musdb==0.3.1->-r D:\Program\demucs\condae nv.0z3apytv.requirements.txt (line 1)) (1.17.3) Requirement already satisfied, skipping upgrade: simplejson in d:\program\anacon da\envs\demucs\lib\site-packages (from museval==0.3.0->-r D:\Program\demucs\cond aenv.0z3apytv.requirements.txt (line 2)) (3.17.0) Requirement already satisfied, skipping upgrade: jsonschema in d:\program\anacon da\envs\demucs\lib\site-packages (from museval==0.3.0->-r D:\Program\demucs\cond aenv.0z3apytv.requirements.txt (line 2)) (3.2.0) Requirement already satisfied, skipping upgrade: scipy in d:\program\anaconda\en vs\demucs\lib\site-packages (from museval==0.3.0->-r D:\Program\demucs\condaenv. 0z3apytv.requirements.txt (line 2)) (1.3.1) Requirement already satisfied, skipping upgrade: pandas>=0.25.0 in d:\program\an aconda\envs\demucs\lib\site-packages (from museval==0.3.0->-r D:\Program\demucs
    condaenv.0z3apytv.requirements.txt (line 2)) (0.25.3) Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,

    =1.21.1 in d:\program\anaconda\envs\demucs\lib\site-packages (from requests==2. 22->-r D:\Program\demucs\condaenv.0z3apytv.requirements.txt (line 3)) (1.25.7) Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in d:\progra m\anaconda\envs\demucs\lib\site-packages (from requests==2.22->-r D:\Program\dem ucs\condaenv.0z3apytv.requirements.txt (line 3)) (2019.11.28) Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in d:\pro gram\anaconda\envs\demucs\lib\site-packages (from requests==2.22->-r D:\Program
    demucs\condaenv.0z3apytv.requirements.txt (line 3)) (3.0.4) Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in d:\program\an aconda\envs\demucs\lib\site-packages (from requests==2.22->-r D:\Program\demucs
    condaenv.0z3apytv.requirements.txt (line 3)) (2.8) Requirement already satisfied, skipping upgrade: cffi>=1.0 in d:\program\anacond a\envs\demucs\lib\site-packages (from soundfile>=0.9.0->musdb==0.3.1->-r D:\Prog ram\demucs\condaenv.0z3apytv.requirements.txt (line 1)) (1.13.2) Requirement already satisfied, skipping upgrade: PyYAML in d:\program\anaconda\e nvs\demucs\lib\site-packages (from pyaml->musdb==0.3.1->-r D:\Program\demucs\con daenv.0z3apytv.requirements.txt (line 1)) (5.3) Requirement already satisfied, skipping upgrade: pyrsistent>=0.14.0 in d:\progra m\anaconda\envs\demucs\lib\site-packages (from jsonschema->museval==0.3.0->-r D: \Program\demucs\condaenv.0z3apytv.requirements.txt (line 2)) (0.15.7) Requirement already satisfied, skipping upgrade: attrs>=17.4.0 in d:\program\ana conda\envs\demucs\lib\site-packages (from jsonschema->museval==0.3.0->-r D:\Prog ram\demucs\condaenv.0z3apytv.requirements.txt (line 2)) (19.3.0) Requirement already satisfied, skipping upgrade: six>=1.11.0 in d:\program\anaco nda\envs\demucs\lib\site-packages (from jsonschema->museval==0.3.0->-r D:\Progra m\demucs\condaenv.0z3apytv.requirements.txt (line 2)) (1.14.0) Requirement already satisfied, skipping upgrade: importlib-metadata; python_vers ion < "3.8" in d:\program\anaconda\envs\demucs\lib\site-packages (from jsonschem a->museval==0.3.0->-r D:\Program\demucs\condaenv.0z3apytv.requirements.txt (line 2)) (1.4.0) Requirement already satisfied, skipping upgrade: setuptools in d:\program\anacon da\envs\demucs\lib\site-packages (from jsonschema->museval==0.3.0->-r D:\Program \demucs\condaenv.0z3apytv.requirements.txt (line 2)) (45.0.0.post20200113) Requirement already satisfied, skipping upgrade: pytz>=2017.2 in d:\program\anac onda\envs\demucs\lib\site-packages (from pandas>=0.25.0->museval==0.3.0->-r D:\P rogram\demucs\condaenv.0z3apytv.requirements.txt (line 2)) (2019.3) Requirement already satisfied, skipping upgrade: python-dateutil>=2.6.1 in d:\pr ogram\anaconda\envs\demucs\lib\site-packages (from pandas>=0.25.0->museval==0.3. 0->-r D:\Program\demucs\condaenv.0z3apytv.requirements.txt (line 2)) (2.8.1) Requirement already satisfied, skipping upgrade: pycparser in d:\program\anacond a\envs\demucs\lib\site-packages (from cffi>=1.0->soundfile>=0.9.0->musdb==0.3.1- -r D:\Program\demucs\condaenv.0z3apytv.requirements.txt (line 1)) (2.19) Requirement already satisfied, skipping upgrade: zipp>=0.5 in d:\program\anacond a\envs\demucs\lib\site-packages (from importlib-metadata; python_version < "3.8" ->jsonschema->museval==0.3.0->-r D:\Program\demucs\condaenv.0z3apytv.requirement s.txt (line 2)) (1.0.0) Requirement already satisfied, skipping upgrade: more-itertools in d:\program\an aconda\envs\demucs\lib\site-packages (from zipp>=0.5->importlib-metadata; python _version < "3.8"->jsonschema->museval==0.3.0->-r D:\Program\demucs\condaenv.0z3a pytv.requirements.txt (line 2)) (8.1.0)

    To activate this environment, use

    $ conda activate demucs

    To deactivate an active environment, use

    $ conda deactivate

    (base) D:\Program\demucs>conda activate demucs

    (demucs) D:\Program\demucs>python -m demucs.separate -d cpu --dl D:\Program\samp le.mp3 INTEL MKL ERROR: Operating system cannot execute %1. mkl_intel_thread.dll . Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.

    (demucs) D:\Program\demucs>set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1

    (demucs) D:\Program\demucs>python -m demucs.separate -d cpu --dl D:\Program\samp le.mp3 INTEL MKL ERROR: Operating system cannot execute %1. mkl_intel_thread.dll . Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.

    The anaconda folder is in D:/Program/Anaconda I uninstalled all, reinstalled demucs and Anaconda, restarted my PC but keeps giving me this error...

    opened by andrewdevcup 11
  • I think I installed it wrong

    I think I installed it wrong

    I've been trying for two hours and still get this error Help please :(

    (base) ecmac:demucs hectormangasafonso$ conda activate demucs
    (demucs) ecmac:demucs hectormangasafonso$ python3 -m demucs.separate --dl /Users/hectormangasafonso/Downloads/malamente.mp3 
    Traceback (most recent call last):
      File "/Users/hectormangasafonso/opt/anaconda3/envs/demucs/lib/python3.7/runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "/Users/hectormangasafonso/opt/anaconda3/envs/demucs/lib/python3.7/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/Users/hectormangasafonso/demucs/demucs/separate.py", line 143, in <module>
        main()
      File "/Users/hectormangasafonso/demucs/demucs/separate.py", line 122, in main
        model = th.load(model_path).to(args.device)
      File "/Users/hectormangasafonso/opt/anaconda3/envs/demucs/lib/python3.7/site-packages/torch/serialization.py", line 426, in load
        return _load(f, map_location, pickle_module, **pickle_load_args)
      File "/Users/hectormangasafonso/opt/anaconda3/envs/demucs/lib/python3.7/site-packages/torch/serialization.py", line 620, in _load
        deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
    RuntimeError: unexpected EOF, expected 106623639 more bytes. The file might be corrupted.
    libc++abi.dylib: terminating with uncaught exception of type c10::Error: owning_ptr == NullType::singleton() || owning_ptr->refcount_.load() > 0 INTERNAL ASSERT FAILED at /Users/distiller/project/conda/conda-bld/pytorch_1573049287641/work/c10/util/intrusive_ptr.h:348, please report a bug to PyTorch. intrusive_ptr: Can only intrusive_ptr::reclaim() owning pointers that were created using intrusive_ptr::release(). (reclaim at /Users/distiller/project/conda/conda-bld/pytorch_1573049287641/work/c10/util/intrusive_ptr.h:348)
    frame #0: c10::Error::Error(c10::SourceLocation, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 135 (0x117580517 in libc10.dylib)
    frame #1: c10::intrusive_ptr<c10::intrusive_ptr_target, c10::detail::intrusive_target_default_null_type<c10::intrusive_ptr_target> >::reclaim(c10::intrusive_ptr_target*) + 264 (0x11baa5f48 in libtorch.dylib)
    frame #2: THFloatStorage_free + 28 (0x11c34ea0c in libtorch.dylib)
    frame #3: THPFloatStorage_dealloc(THPStorage*) + 18 (0x116a72532 in libtorch_python.dylib)
    <omitting python frames>
    frame #21: start + 1 (0x7fff669dd2e5 in libdyld.dylib)
    
    Abort trap: 6
    
    
    opened by hectormangas 11
  • Unable to save audio file

    Unable to save audio file

    🐛 Bug Report

    Error while saving the audio file.

    To Reproduce

    Run command demucs out.m4a --two-stems vocals -n htdemucs_ft

    Expected behavior

    The audio file appears in output folder.

    Actual Behavior

    The program throws an error and the audio file is truncated. 20221129-230853

    Your Environment

    • Python and PyTorch version: Python 3.9.13 Pytorch 1.12.0+cu116
    • Operating system and version (desktop or mobile): Windows 10 22H2
    • Hardware (gpu or cpu, amount of RAM etc.): GTX 1660 super 16GB RAM
    bug 
    opened by haveyouwantto 10
  • Boost Inference speed

    Boost Inference speed

    ❓ Questions

    Hi I am currently using a GPU for inferencing on files, however it takes a lot of time for longer files with duration around 20minutes. GPU VRam is not an issue, but I was wondering if I could increase power or faster anyhow the inference on GPU.

    Thanks

    question 
    opened by arnavmehta7 8
  • Drum Stem - Individual Percussive Element Separation via NMFtoolbox (add feature to Demucs?)

    Drum Stem - Individual Percussive Element Separation via NMFtoolbox (add feature to Demucs?)

    @dmr-songquito notified me about an open-source tool that further separates Drum stems into individual Kick, Snare, Cymbals audio files. https://www.audiolabs-erlangen.de/content/resources/MIR/NMFtoolbox/demoDrumSoundSeparationNMF.html https://www.audiolabs-erlangen.de/resources/MIR/NMFtoolbox/

    Could this be incorporated into Demucs, open-source as it is? Maybe a "drumElementsNMF" model could be added into Demucs, of course with the intention to use on an already rendered Drum stem, probably not from a full mixdown file. Whatever works best though.

    The output files generated by this app are excellent quality. Worth investigating the possibility of incorporating this into Demucs. Frankly I'm boggled by the steps necessary to install and utilize this tool on its own, and would rather use as a Demucs model anyway.

    Thank you!

    question 
    opened by Dyslexicon 1
  • TypeError: __init__() got an unexpected keyword argument 'norm_first'

    TypeError: __init__() got an unexpected keyword argument 'norm_first'

    I get this error when trying the new htdemucs with demucs 4.0.0

    (demucs) C:\Users\Admin>demucs -n htdemucs D:\input.wav
    Traceback (most recent call last):
      File "d:\programas\anaconda\envs\demucs\lib\runpy.py", line 194, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "d:\programas\anaconda\envs\demucs\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "D:\Programas\Anaconda\envs\demucs\Scripts\demucs.exe\__main__.py", line 7, in <module>
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\separate.py", line 121, in main
        model = get_model_from_args(args)
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\pretrained.py", line 89, in get_model_from_args
        return get_model(name=args.name, repo=args.repo)
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\pretrained.py", line 74, in get_model
        model = any_repo.get_model(name)
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\repo.py", line 148, in get_model
        return self.bag_repo.get_model(name_or_sig)
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\repo.py", line 130, in get_model
        models = [self.model_repo.get_model(sig) for sig in signatures]
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\repo.py", line 130, in <listcomp>
        models = [self.model_repo.get_model(sig) for sig in signatures]
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\repo.py", line 67, in get_model
        return load_model(pkg)
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\states.py", line 62, in load_model
        model = klass(*args, **kwargs)
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\states.py", line 146, in __init__
        init(self, *args, **kwargs)
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\htdemucs.py", line 384, in __init__
        self.crosstransformer = CrossTransformerEncoder(
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\transformer.py", line 636, in __init__
        self.layers.append(MyTransformerEncoderLayer(**kwargs_classic_encoder))
      File "d:\programas\anaconda\envs\demucs\lib\site-packages\demucs\transformer.py", line 297, in __init__
        super().__init__(
    TypeError: __init__() got an unexpected keyword argument 'norm_first'
    
    bug 
    opened by AlvaroBeiro 9
  • Output files are not saved

    Output files are not saved

    🐛 Bug Report

    Output files are not saved due to unexpected keyword "argument"

    To Reproduce

    Run demucs -n htdemucs_ft "PATH"

    Expected behavior

    Output files should be saved

    Actual Behavior

    
    Traceback (most recent call last):
      File "c:\users\elbit\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "c:\users\elbit\anaconda3\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "C:\Users\elbit\anaconda3\Scripts\demucs.exe\__main__.py", line 7, in <module>
      File "c:\users\elbit\anaconda3\lib\site-packages\demucs\separate.py", line 185, in main
        save_audio(source, str(stem), **kwargs)
      File "c:\users\elbit\anaconda3\lib\site-packages\demucs\audio.py", line 254, in save_audio
        ta.save(str(path), wav, sample_rate=samplerate,
    TypeError: save() got an unexpected keyword argument 'encoding'
    

    Your Environment

    • Python and PyTorch version: Python 3.8.0 Pytorch '1.11.0+cpu'
    • Operating system and version (desktop or mobile): Windows 10 desktop
    • Hardware (gpu or cpu, amount of RAM etc.):

    Intel Core i7-4900MQ 2.80 Ghz RAM 32 GB DDR3 Nvidia Quadro K3100M

    bug 
    opened by ProgressiveProgression 8
Owner
Meta Research
Meta Research
Unofficial PyTorch Implementation of UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation

UnivNet UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation This is an unofficial PyTorch

MINDs Lab 170 Jan 4, 2023
Unofficial PyTorch Implementation of UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation

UnivNet UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation This is an unofficial PyTorch

MINDs Lab 54 Aug 30, 2021
Hybrid CenterNet - Hybrid-supervised object detection / Weakly semi-supervised object detection

Hybrid-Supervised Object Detection System Object detection system trained by hybrid-supervision/weakly semi-supervision (HSOD/WSSOD): This project is

null 5 Dec 10, 2022
Code for the Interspeech 2021 paper "AST: Audio Spectrogram Transformer".

AST: Audio Spectrogram Transformer Introduction Citing Getting Started ESC-50 Recipe Speechcommands Recipe AudioSet Recipe Pretrained Models Contact I

Yuan Gong 603 Jan 7, 2023
The official implementation of the Interspeech 2021 paper WSRGlow: A Glow-based Waveform Generative Model for Audio Super-Resolution.

WSRGlow The official implementation of the Interspeech 2021 paper WSRGlow: A Glow-based Waveform Generative Model for Audio Super-Resolution. Audio sa

Kexun Zhang 96 Jan 3, 2023
Official implementation of the paper Chunked Autoregressive GAN for Conditional Waveform Synthesis

Chunked Autoregressive GAN (CARGAN) Official implementation of the paper Chunked Autoregressive GAN for Conditional Waveform Synthesis [paper] [compan

Descript 150 Dec 6, 2022
Code for the ICASSP-2021 paper: Continuous Speech Separation with Conformer.

Continuous Speech Separation with Conformer Introduction We examine the use of the Conformer architecture for continuous speech separation. Conformer

Sanyuan Chen (陈三元) 81 Nov 28, 2022
Music Source Separation; Train & Eval & Inference piplines and pretrained models we used for 2021 ISMIR MDX Challenge.

Music Source Separation with Channel-wise Subband Phase Aware ResUnet (CWS-PResUNet) Introduction This repo contains the pretrained Music Source Separ

Lau 100 Dec 25, 2022
audioLIME: Listenable Explanations Using Source Separation

audioLIME This repository contains the Python package audioLIME, a tool for creating listenable explanations for machine learning models in music info

Institute of Computational Perception 27 Dec 1, 2022
Music source separation is a task to separate audio recordings into individual sources

Music Source Separation Music source separation is a task to separate audio recordings into individual sources. This repository is an PyTorch implmeme

Bytedance Inc. 958 Jan 3, 2023
Audio Source Separation is the process of separating a mixture into isolated sounds from individual sources

Audio Source Separation is the process of separating a mixture into isolated sounds from individual sources (e.g. just the lead vocals).

Victor Basu 14 Nov 7, 2022
efficient neural audio synthesis in the waveform domain

neural waveshaping synthesis real-time neural audio synthesis in the waveform domain paper • website • colab • audio by Ben Hayes, Charalampos Saitis,

Ben Hayes 169 Dec 23, 2022
Code for the SIGIR 2022 paper "Hybrid Transformer with Multi-level Fusion for Multimodal Knowledge Graph Completion"

MKGFormer Code for the SIGIR 2022 paper "Hybrid Transformer with Multi-level Fusion for Multimodal Knowledge Graph Completion" Model Architecture Illu

ZJUNLP 68 Dec 28, 2022
harmonic-percussive-residual separation algorithm wrapped as a VST3 plugin (iPlug2)

Harmonic-percussive-residual separation plug-in This work is a study on the plausibility of a sines-transients-noise decomposition inspired algorithm

Derp Learning 9 Sep 1, 2022
Speech Separation Using an Asynchronous Fully Recurrent Convolutional Neural Network

Speech Separation Using an Asynchronous Fully Recurrent Convolutional Neural Network This repository is the official implementation of Speech Separati

Kai Li (李凯) 116 Nov 9, 2022
Offical implementation for "Trash or Treasure? An Interactive Dual-Stream Strategy for Single Image Reflection Separation".

Trash or Treasure? An Interactive Dual-Stream Strategy for Single Image Reflection Separation (NeurIPS 2021) by Qiming Hu, Xiaojie Guo. Dependencies P

Qiming Hu 31 Dec 20, 2022
The official implementation of our CVPR 2021 paper - Hybrid Rotation Averaging: A Fast and Robust Rotation Averaging Approach

Graph Optimizer This repo contains the official implementation of our CVPR 2021 paper - Hybrid Rotation Averaging: A Fast and Robust Rotation Averagin

Chenyu 109 Dec 23, 2022
PyTorch implementation of paper: HPNet: Deep Primitive Segmentation Using Hybrid Representations.

HPNet This repository contains the PyTorch implementation of paper: HPNet: Deep Primitive Segmentation Using Hybrid Representations. Installation The

Siming Yan 42 Dec 7, 2022
This repository contains the entire code for our work "Two-Timescale End-to-End Learning for Channel Acquisition and Hybrid Precoding"

Two-Timescale-DNN Two-Timescale End-to-End Learning for Channel Acquisition and Hybrid Precoding This repository contains the entire code for our work

QiyuHu 3 Mar 7, 2022