|
|
|
|
|
|
|
|
|
|
|
$SOFAPython = "$env:CONDA_PREFIX\python.exe" |
|
$BuildScript = "D:\DiffSingerDatasets\MakeDiffSinger\acoustic_forced_alignment\build_dataset.py" |
|
$AddScript = "D:\DiffSingerDatasets\MakeDiffSinger\variance-temp-solution\add_ph_num.py" |
|
$InferScript = "D:\DiffSingerDatasets\MakeDiffSinger\SOME\batch_infer.py" |
|
$Dictionary = "D:\DiffSingerDatasets\SOFA\dictionary\opencpop-extension.txt" |
|
$ModelCheckpoint = "D:\DiffSingerDatasets\MakeDiffSinger\SOME\pretrained\0119_continuous256_5spk\model_ckpt_steps_100000_simplified.ckpt" |
|
|
|
$SourceDataDir = "D:\DiffSingerDatasets\255_step2_man" |
|
$OutputDatasetDir = "D:\DiffSingerDatasets\255_built_man" |
|
$SourceWavDir = Join-Path $SourceDataDir "wav" |
|
$SourceTgDir = Join-Path $SourceDataDir "TextGrid" |
|
$OutputCsvPath = Join-Path $OutputDatasetDir "transcriptions.csv" |
|
|
|
Write-Host "--- 开始处理数据集: $($SourceDataDir) ---" |
|
|
|
|
|
Write-Host "`n--- 运行 build_dataset.py ---" |
|
|
|
mkdir $OutputDatasetDir -Force |
|
|
|
& $SOFAPython $BuildScript --wavs $SourceWavDir --tg $SourceTgDir --dataset $OutputDatasetDir |
|
|
|
|
|
if (-not (Test-Path $OutputCsvPath)) { |
|
Write-Host "!!! 错误: build_dataset.py 未能生成 $OutputCsvPath 文件。请检查上一步的输出。终止后续步骤。" -ForegroundColor Red |
|
exit 1 |
|
} |
|
|
|
|
|
Write-Host "`n--- 运行 add_ph_num.py ---" |
|
|
|
& $SOFAPython $AddScript $OutputCsvPath --dictionary $Dictionary |
|
|
|
|
|
|
|
|
|
|
|
Write-Host "`n--- 运行 batch_infer.py (音高推断) ---" |
|
|
|
if (-not (Test-Path $ModelCheckpoint)) { |
|
Write-Host "!!! 错误: 模型文件未找到: $($ModelCheckpoint)。跳过音高推断步骤。" -ForegroundColor Red |
|
} else { |
|
& $SOFAPython $InferScript --model $ModelCheckpoint --dataset $OutputDatasetDir --overwrite |
|
} |
|
|
|
Write-Host "`n--- 数据集处理完成: $($OutputDatasetDir) ---" |