Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenWizard2015 committed Jun 28, 2024
1 parent a3ed9c0 commit 439a92d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/preprocess-remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,26 @@ def processFolder(
if 0 < testPadding:
testing = dropPadding(testing, testPadding)

def saveSubset(filename, idx):
print('%s: %d frames' % (filename, len(idx)))
subset = {k: v[idx] for k, v in dataset.items()}
time = subset['time']
diff = np.diff(time)
assert np.all(diff >= 0), 'Time is not monotonically increasing!'
np.savez(os.path.join(folder, filename), **subset)
return

# remove the npz files
files = os.listdir(folder)
for fn in files:
os.remove(os.path.join(folder, fn))
print('Removed', len(files), 'files')

totalFrames = len(testing) + len(training)
if minFrames < totalFrames:
if totalFrames < minFrames:
print('Not enough frames: %d < %d' % (totalFrames, minFrames))
return 0, 0
# save training and testing sets
def saveSubset(filename, idx):
print('%s: %d frames' % (filename, len(idx)))
subset = {k: v[idx] for k, v in dataset.items()}
time = subset['time']
diff = np.diff(time)
assert np.all(diff >= 0), 'Time is not monotonically increasing!'
np.savez(os.path.join(folder, filename), **subset)
return

saveSubset('train.npz', training)
saveSubset('test.npz', testing)

Expand Down

0 comments on commit 439a92d

Please sign in to comment.