facebookresearch/demucs: Code for the paper Hybrid Spectrogram and Waveform Source Separation
オーディオファイルからドラム、ベース、ボーカルとそれ以外を分離するツール
以前試したときよりもかなり精度が高くなっている印象。音質劣化も少ない。 GPUを使用すると4〜5分程度の楽曲の処理が10秒以下で終わる。CPUだと数分はかかる。
# インストールされているCudaバージョンの確認 nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0 # すでにインストールされているpytorchを削除 # conda/pipが定まっていなかったため念のため両方 conda remove pytorch torchvision torchaudio pip uninstall pytorch torchvision torchaudio # 今後はcondaで統一する。11.8対応のものがなかったので11.7を指定した conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia Cuda版のPytorchが入ったか確認するPythonスクリプト
import torch print(torch.__version__) print(f"cuda, {torch.cuda.is_available()}") print(f"compute_{''.join(map(str,(torch.cuda.get_device_capability())))}") device_num:int = torch.cuda.device_count() print(f"find gpu devices, {device_num}") for idx in range(device_num): print(f"cuda:{idx}, {torch.cuda.get_device_name(idx)}") 実行結果
(base) PS C:\Users\takeu\Downloads> python .\gpu.py 1.13.0 cuda, True compute_86 find gpu devices, 1 cuda:0, NVIDIA GeForce RTX 3070 Ti