Skip to content

Commit

Permalink
Update automix.py
Browse files Browse the repository at this point in the history
compatiblity with new librosa API
facebookresearch#470
  • Loading branch information
adefossez committed Apr 24, 2023
1 parent 14f5032 commit 8b48c27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/automix.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def analyse_track(dset, index):
if cached is None:
drums = track[0].mean(0)
if drums.std() > 1e-2 * ref:
tempo, events = beat_track(drums.numpy(), units='time', sr=SR)
tempo, events = beat_track(y=drums.numpy(), units='time', sr=SR)
else:
print("failed drums", drums.std(), ref)
return None, track
Expand All @@ -89,7 +89,7 @@ def analyse_track(dset, index):
mask = r >= 0.05 * peak
bass = bass[mask]
if bass.std() > 1e-2 * ref:
kr = torch.from_numpy(chroma_cqt(bass.numpy(), sr=SR))
kr = torch.from_numpy(chroma_cqt(y=bass.numpy(), sr=SR))
hist_kr = (kr.max(dim=0, keepdim=True)[0] == kr).float().mean(1)
else:
print("failed bass", bass.std(), ref)
Expand Down

0 comments on commit 8b48c27

Please sign in to comment.