fix(stems): optimize Demucs chunking and prevent dimension mismatch
This commit is contained in:
@ -47,7 +47,6 @@ class StemsStage(Stage):
|
||||
return {
|
||||
"stems": ctx.stems,
|
||||
"quality": ctx.quality,
|
||||
"segment": 7 if ctx.quality == "fast" else 10,
|
||||
"shifts": 0 if ctx.quality == "fast" else 1,
|
||||
}
|
||||
|
||||
@ -100,7 +99,6 @@ class StemsStage(Stage):
|
||||
wav = (wav - ref.mean()) / (ref.std() + 1e-8)
|
||||
|
||||
params = self.get_params(ctx)
|
||||
segment = params["segment"]
|
||||
shifts = params["shifts"]
|
||||
|
||||
# Add batch dimension: [1, 2, samples]
|
||||
@ -114,7 +112,6 @@ class StemsStage(Stage):
|
||||
shifts=shifts,
|
||||
split=True,
|
||||
overlap=0.25,
|
||||
segment=segment,
|
||||
device=device,
|
||||
progress=False,
|
||||
)
|
||||
|
||||
@ -69,10 +69,8 @@ def test_stems_stage_chunking_params(tmp_path: Path):
|
||||
|
||||
ctx_fast = PipelineContext(source_file=source, output_dir=out_dir, quality="fast")
|
||||
params_fast = stage.get_params(ctx_fast)
|
||||
assert params_fast["segment"] == 7
|
||||
assert params_fast["shifts"] == 0
|
||||
|
||||
ctx_best = PipelineContext(source_file=source, output_dir=out_dir, quality="best")
|
||||
params_best = stage.get_params(ctx_best)
|
||||
assert params_best["segment"] == 10
|
||||
assert params_best["shifts"] == 1
|
||||
|
||||
Reference in New Issue
Block a user