Skip to content

preprocess.py could silently drop training data #2837

Description

@Idiotabtcodes

During the parameter rename (idx0output_key), the final norm_write call was dedented out of the slicer loop:

for audio in self.slicer.slice(audio):
i = 0
while 1:
start = int(self.sr * (self.per - self.overlap) * i)
i += 1
if len(audio[start:]) > self.tail * self.sr:
tmp_audio = audio[start : start + int(self.per * self.sr)]
self.norm_write(tmp_audio, output_key, idx1)
idx1 += 1
else:
tmp_audio = audio[start:]
idx1 += 1
break
self.norm_write(tmp_audio, output_key, idx1)

self.tail = self.per + self.overlap

The tail chunk is a full-length training sample. And since the slicer's min_length is 1500 ms, any sliced utterance shorter than 4 s consists entirely of that tail chunk, so it's dropped whole.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions