Skip to content

Commit

Permalink
sample: Fix samples
Browse files Browse the repository at this point in the history
  • Loading branch information
revsic committed Nov 23, 2021
1 parent 474ffd7 commit ed94d69
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@


# construct data reader
lj = speechset.datasets.LJSpeech()
lj = speechset.datasets.LJSpeech('D:\\dataset\\LJSpeech-1.1')

# construct configuration
config = speechset.Config()

# construct acoustic model
acoustic = speechset.AcousticDataset(lj, config)

# unpack
text, mel, textlen, mellen = acoustic[0]
print(text.shape, mel.shape, textlen.shape, mellen.shape)
# indexing
text, mel = acoustic[0]
print(text.shape, mel.shape)

# split sample
testset = acoustic.split(1000)
# unpack
text, mel, textlen, mellen = acoustic.collate(acoustic[0:3])
print(text.shape, mel.shape, textlen.shape, mellen.shape)

text, mel, textlen, mellen = next(iter(testset))
# back pack
text, mel, textlen, mellen = acoustic[0:3]
print(text.shape, mel.shape, textlen.shape, mellen.shape)
# iteration
text, mel = next(iter(testset))
print(text.shape, mel.shape)

# construct vocoder model
vocoder = speechset.VocoderDataset(lj, config)

# unpack
mel, audio, mellen, audiolen = next(iter(vocoder))
mel, audio, mellen, audiolen = vocoder[0:3]
print(mel.shape, audio.shape, mellen.shape, audiolen.shape)

0 comments on commit ed94d69

Please sign in to comment.