Skip to content

Commit

Permalink
preparing release
Browse files Browse the repository at this point in the history
  • Loading branch information
adefossez committed Dec 17, 2021
1 parent f64dcca commit 8c18b7f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ width="800px"></p>

See the [release notes](./docs/release.md) for more details.

- 17/12/2021: Releasing v3.0.3: bug fixes (thanks @keunwoochoi), memory drastically
reduced on GPU (thanks @famzah) and new multi-core evaluation on CPU (`-j` flag).
- 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
Expand Down Expand Up @@ -179,6 +181,8 @@ 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.

The `-j` flag allow to specify a number of parallel jobs (e.g. `demucs -j 2 myfile.mp3`).
This will multiply by the same amount the RAM used so be careful!

### Memory requirements for GPU acceleration

Expand Down
2 changes: 1 addition & 1 deletion demucs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

__version__ = "3.0.2a2"
__version__ = "3.0.2"
10 changes: 5 additions & 5 deletions demucs/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def tensor_chunk(tensor_or_chunk):
return TensorChunk(tensor_or_chunk)



def apply_model(model, mix, shifts=1, split=True,
overlap=0.25, transition_power=1., progress=False, device=None,
num_workers=0, pool=None):
Expand All @@ -139,10 +138,11 @@ def apply_model(model, mix, shifts=1, split=True,
"""
if device is None:
device = mix.device
if pool is None and num_workers > 0:
pool = ThreadPoolExecutor(num_workers)
elif pool is None:
pool = DummyPoolExecutor()
if pool is None:
if num_workers > 0:
pool = ThreadPoolExecutor(num_workers)
else:
pool = DummyPoolExecutor()
kwargs = {
'shifts': shifts,
'split': split,
Expand Down
9 changes: 3 additions & 6 deletions demucs/separate.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,8 @@ def main():
parser.add_argument("-j", "--jobs",
default=None,
type=int,
const=-1,
nargs='?',
help="Number of jobs. This can increase memory usage but will "
"be much faster when multiple cores are available. "
"Either pass a number of parallel workers or half the nb of CPU will "
"be selected (near optimal in most cases because of SSE).")
"be much faster when multiple cores are available.")

args = parser.parse_args()

Expand Down Expand Up @@ -127,7 +123,8 @@ def main():
ref = wav.mean(0)
wav = (wav - ref.mean()) / ref.std()
sources = apply_model(model, wav[None], device=args.device, shifts=args.shifts,
split=args.split, overlap=args.overlap, progress=True, num_workers=2)[0]
split=args.split, overlap=args.overlap, progress=True,
num_workers=args.jobs)[0]
sources = sources * ref.std() + ref.mean()

track_folder = out / track.name.rsplit(".", 1)[0]
Expand Down
2 changes: 1 addition & 1 deletion demucs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __init__(self, func, *args, **kwargs):
def result(self):
return self.func(*self.args, **self.kwargs)

def __init__(self, workers):
def __init__(self, workers=0):
pass

def submit(self, func, *args, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Fix bug in weights used for different sources. Thanks @keunwoochoi for the repor

Improving drastically memory usage on GPU for long files. Thanks a lot @famzah for providing this.

Adding multithread evaluation on CPU (`-j` option).

## V3.0.1, 12th of November 2021

Release of Demucs v3, featuring hybrid domain separation and much more.
Expand Down

0 comments on commit 8c18b7f

Please sign in to comment.