Skip to content

Commit

Permalink
Pad with sample instead of zeros in inference
Browse files Browse the repository at this point in the history
  • Loading branch information
israelg99 committed Mar 2, 2017
1 parent d7bd881 commit 353e151
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions audio_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
from eva.util.mutil import sparse_labels
from eva.util.autil import to_pcm8

#%% Data.
RATE, DATA = scipy.io.wavfile.read('./data/undertale/undertale_001_once_upon_a_time.comp.wav')

#%% Generation Config.
print('Preparing generation.')
RATE = 4000
UNITS = 356415

#%% Model Config.
Expand Down Expand Up @@ -64,8 +66,14 @@ def save_gracefully(signal, frame):

BATCH_SIZE = 1

samples = np.zeros(shape=(BATCH_SIZE, UNITS, BINS))
audio = np.zeros(shape=(BATCH_SIZE, UNITS))
samples = np.zeros(shape=(1, UNITS, BINS))
samples[0, list(range(LENGTH-1)), DATA[:LENGTH-1].astype(int)]
samples = np.repeat(samples, BATCH_SIZE, axis=0)

audio = np.zeros(shape=(1, UNITS))
audio[0, :LENGTH-1] = DATA[:LENGTH-1]
audio = np.repeat(audio, BATCH_SIZE, axis=0)

for i in tqdm(range(UNITS+LENGTH-1)):
if i >= UNITS-1:
break
Expand Down

0 comments on commit 353e151

Please sign in to comment.