def copy_episodes(indir, outdir, n):
episode_paths = frame.episode_paths(indir)
np.random.shuffle(episode_paths)
episode_paths = episode_paths[:n]
start = len(indir)
for p in tqdm.tqdm(episode_paths):
assert p.startswith(indir), p
outfile = outdir + p[start:]
os.makedirs(os.path.dirname(outfile), exist_ok=True)
shutil.copyfile(p, outfile)
评论列表
文章目录