From 14ad89afcfe776d6ca290856bd24256a6e9bdc89 Mon Sep 17 00:00:00 2001 From: Matt Cooper Date: Wed, 17 Aug 2016 19:51:18 -0400 Subject: safe path joining with os.path.join --- Code/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Code/utils.py') diff --git a/Code/utils.py b/Code/utils.py index 2b97bdb..c2bf856 100644 --- a/Code/utils.py +++ b/Code/utils.py @@ -2,6 +2,7 @@ import tensorflow as tf import numpy as np from scipy.ndimage import imread from glob import glob +import os import constants as c from tfutils import log10 @@ -77,7 +78,7 @@ def get_full_clips(data_dir, num_clips, num_rec_out=1): # get a random clip of length HIST_LEN + 1 from each episode for clip_num, ep_dir in enumerate(ep_dirs): - ep_frame_paths = glob(ep_dir + '/*') + ep_frame_paths = 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)] -- cgit v1.2.3-70-g09d2