Possible problem with implementation of group_detections
In the current implementation of the group_detections, the duration of a grouped detection event can be shorter than the length of a single spectrogram sample if the samples are overlapping in time. For example, if a spectrogram with start=5.0s and duration=3.0s triggers a detection, but the subsequent spectrogram starting at start=5.5s does not trigger a detection, the grouped detection event is assumed to begin at start=5.0s and have a duration of only 0.5s. This is reflected in this unit test:
However, as far as I can tell this constraining effect is only implemented for later samples, not earlier ones. In the above unit test, for example, the spectrogram sample starting at 4.5s and ending at 7.5s does not trigger a detection, yet the grouped detection event returned by the group_detection function still starts at 5.0s. Isn't this an inconsistent treatment of future and past, so to speak?
Infact, if we were to treat earlier negatives on par with later ones, the grouped detection event in the unit test would be have to be discarded altogether.
@fsfrazao , your thoughts?