CPJKU / madmom

Python audio and music signal processing library
https://madmom.readthedocs.io
Other
1.31k stars 199 forks source link

IndexError in self.correct branch of DBNDownBeatTrackingProcessor process function. #488

Open omareldeeb opened 2 years ago

omareldeeb commented 2 years ago

Expected behaviour

If no valid path could be decoded using the Viterbi algorithm, an empty array should be returned.

Actual behaviour

If self.correct == True, an IndexError is thrown in line 301 of downbeats.py, due to beat_range being empty.

Steps needed to reproduce the behaviour

import madmom
import numpy as np
import scipy

beat_tracker = madmom.features.downbeats.DBNDownBeatTrackingProcessor(fps=100.0, correct=True, beats_per_bar=4)
beat_activation = np.random.uniform(0, 1, 100)
downbeat_activation = np.random.uniform(0, 1, 100)

beat_decoder.process(np.dstack((beat_activation, downbeat_activation))[0])

Information about installed software

Please provide some information about installed software.

madmom.version == '0.16.1' np.version == '1.19.5' scipy.version == '1.7.2'

superbock commented 2 years ago

Thanks for pointing this out, will release a fix soon. I can't merge yours, since it actually has undesired side-effects.