Numbering of isolated foreground events should start at 0 regardless bg events
justinsalamon opened this issue · 1 comments
justinsalamon commented
When saving isolated events, the desired behavior is that:
- Background events are numbered starting at 0 (e.g. background0_park.wav, background1_schoo.wav, ...)
- Foreground events are also numbered starting at 0 (e.g. foreground0_siren.wav, foreground1_dog.wav, ...).
- The numbering of FG and BG events is independent.
As noted by @epicycles, this is not what happens now, and basically the numbering for the FG events starts where the numbering for the BG events left off.
I had a look and I believe the problem is here:
https://github.com/justinsalamon/scaper/blob/master/scaper/core.py#L1691
and here:
https://github.com/justinsalamon/scaper/blob/master/scaper/core.py#L1830-L1833
So fix is to replace the enumeration with two counters (one for FG and BG respectively) and use the counter values to set the filenames.
@pseeth wanna take a stab at this?
pseeth commented
Sounds reasonable, I'll take a swing at it and PR!