feat(pipeline): implement stage runner, cache, cli, and doctor command
This commit is contained in:
30
src/songsplit/pipeline/s4_pitch.py
Normal file
30
src/songsplit/pipeline/s4_pitch.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""Stage 4: Pitch tracking with CREPE -> median MIDI pitch per syllable."""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, Stage
|
||||
|
||||
|
||||
class PitchStage(Stage):
|
||||
name = "s4_pitch"
|
||||
version = "1.0.0"
|
||||
model_name = "torchcrepe-full"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["s3_lyrics"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [
|
||||
ctx.stems_dir / "vocals.wav",
|
||||
ctx.output_dir / ".cache" / "lyrics_raw.json",
|
||||
]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "vocals.json"]
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
return {"hop_length_ms": 10, "viterbi": True}
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
# Implementation in M2
|
||||
raise NotImplementedError("Stage s4_pitch will be implemented in M2.")
|
||||
Reference in New Issue
Block a user