Footprints

Preliminaries

!pip install git+https://github.com/ws-choi/LASAFT-Net-v2.git/ --quiet
import soundfile as sf
import lasaft
from IPython.display import display, Audio
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning) 

Sample 9: Footprints - Woosung Choi

1. Download the original

!wget https://github.com/lasaft/lasaft.github.io/raw/master/audios/footprint.mp3 --quiet
import torchaudio
mixture, _ = torchaudio.load('footprint.mp3')
mixture = mixture.cpu().numpy().T

# use only 30sec samles:
# else: sample9.ipynb is 158.63 MB, this exceeds GitHub's file size limit of 100.00 MB

mixture = mixture[:44100*30]

2. Compare the results

from IPython.display import Audio, display
from lasaft.pretrained import get_v2_large_709

model = get_v2_large_709()
result = model.separate_tracks(mixture, ['vocals', 'drums', 'bass', 'other'], batch_size=4)

v1_url="https://github.com/lasaft/lasaft.github.io/raw/master/audios"
track="footprint"

print('original')
display(Audio(url="{}/{}.mp3".format(v1_url, track)))


for source in ["vocals", "drums", "bass", "other"]:
    print('{} (v1)'.format(source))
    print('[GitHub file size limit] please check the sample from: {}/{}-{}.wav'.format(v1_url, track, source))
    print('{} (v2)'.format(source))
    display(Audio(result[source].T, rate=44100))
checkpoint is loaded 
/home/wschoi/exit/envs/tutorial-environment/lib/python3.9/site-packages/torch/functional.py:545: UserWarning: istft will require a complex-valued input tensor in a future PyTorch release. Matching the output from stft with return_complex=True.  (Triggered internally at  /pytorch/aten/src/ATen/native/SpectralOps.cpp:817.)
  return _VF.istft(input, n_fft, hop_length, win_length, window, center,  # type: ignore[attr-defined]
original
vocals (v1)
[GitHub file size limit] please check the sample from: https://github.com/lasaft/lasaft.github.io/raw/master/audios/footprint-vocals.wav
vocals (v2)
drums (v1)
[GitHub file size limit] please check the sample from: https://github.com/lasaft/lasaft.github.io/raw/master/audios/footprint-drums.wav
drums (v2)
bass (v1)
[GitHub file size limit] please check the sample from: https://github.com/lasaft/lasaft.github.io/raw/master/audios/footprint-bass.wav
bass (v2)
other (v1)
[GitHub file size limit] please check the sample from: https://github.com/lasaft/lasaft.github.io/raw/master/audios/footprint-other.wav
other (v2)