diff options
| -rw-r--r-- | Code/utils.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Code/utils.py b/Code/utils.py index 3a33d3f..6c9f891 100644 --- a/Code/utils.py +++ b/Code/utils.py @@ -25,7 +25,6 @@ def normalize_frames(frames): return new_frames - def denormalize_frames(frames): """ Performs the inverse operation of normalize_frames. @@ -74,11 +73,11 @@ def get_full_clips(data_dir, num_clips, num_rec_out=1): (3 * (c.HIST_LEN + num_rec_out))]) # get num_clips random episodes - ep_dirs = np.random.choice(glob(data_dir + '*'), num_clips) + ep_dirs = np.random.choice(glob(os.path.join(data_dir, '*')), num_clips) # get a random clip of length HIST_LEN + num_rec_out from each episode for clip_num, ep_dir in enumerate(ep_dirs): - ep_frame_paths = glob(os.path.join(ep_dir, '*')) + ep_frame_paths = sorted(glob(os.path.join(ep_dir, '*'))) start_index = np.random.choice(len(ep_frame_paths) - (c.HIST_LEN + num_rec_out - 1)) clip_frame_paths = ep_frame_paths[start_index:start_index + (c.HIST_LEN + num_rec_out)] |
