Skip to main content

Demucs-Torchcodec

Demucs-Torchcodec is a modernized fork of the Original Demucs.

While the original repository is no longer actively maintained, this fork continues the project by replacing the deprecated torchaudio decoding backends with the high-performance torchcodec library.

Why use this fork?

  • Modern Backend: Uses torchcodec for faster and more robust audio decoding.
  • Dependency Lean: Removes reliance on older torchaudio versions that often conflict with modern PyTorch installations.
  • Future Proof: Designed to work with Python 3.10+ and the latest PyTorch ecosystems.

Installation

1. Requirements

Before installing, ensure you have FFmpeg installed on your system (required by torchcodec):

  • Ubuntu/Debian: sudo apt-get install ffmpeg
  • macOS: brew install ffmpeg
  • Windows: choco install ffmpeg (or download from ffmpeg.org)

2. Install the Package

pip install -U demucs-torchcodec

Usage

The entry point for this version is demucs-torchcodec.

# Basic separation (defaults to htdemucs)
demucs-torchcodec test.mp3

# Separate into 2 stems (vocals and accompaniment)
demucs-torchcodec --two-stems=vocals test.mp3

# Use the high-quality fine-tuned model
demucs-torchcodec -n htdemucs_ft test.mp3

Supported Models

This fork supports all standard Demucs v4 models, including:

  • htdemucs: Hybrid Transformer Demucs (Default).
  • htdemucs_ft: Fine-tuned version (Higher quality, slower).
  • hdemucs_mmi: Hybrid Demucs v3 retrained.
  • mdx_extra: Trained with extra data.

Credits & License

Original Author: Alexandre Défossez.

This project is licensed under the MIT License , exactly like the original Demucs. See the LICENSE file for details.

If you use this model in your research, please cite the original paper:

@inproceedings{rouard2022hybrid,
  title={Hybrid Transformers for Music Source Separation},
  author={Rouard, Simon and Massa, Francisco and D{\'e}fossez, Alexandre},
  booktitle={ICASSP 23},
  year={2023}
}

Metadata

Release files for demucs-torchcodec 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for demucs-torchcodec 0.2.0
File Size Uploaded
demucs_torchcodec-0.2.0.tar.gz 854.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for demucs-torchcodec 0.2.0
File Interpreter ABI Platform
demucs_torchcodec-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 920.7 kB

Release files / demucs_torchcodec-0.2.0.tar.gz

Download URL demucs_torchcodec-0.2.0.tar.gz
Size 854.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bafd2163e07fe180641b3a36a82fa9fa66d960814b10ded835e74fc3f91b280a
BLAKE2b-256 checksum
How to use checksums
f2414bd173601d57bc82fa8c11174085fe904ce149d4f275dc0bdb84fc9eb479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / demucs_torchcodec-0.2.0-py3-none-any.whl

Download URL demucs_torchcodec-0.2.0-py3-none-any.whl
Size 66.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8158835b511f8b569dcc4d643d14f02b7533ff1a8a9634bd0c4146751777b471
BLAKE2b-256 checksum
How to use checksums
4d7f31f2fe3ec9742e009ddcf7a2b4d74c508d68681dc4c6d98ff32aa6e16422
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page