# HG changeset patch # User Xavier Glorot # Date 1265771782 18000 # Node ID ee6a788557b69732343b57275ca56fd9eec4b623 # Parent 5e448ea129b324bb7c7a430bb56c3a5080c39791 Change in add_background_image to load a pickled list of file, not to do a listdir diff -r 5e448ea129b3 -r ee6a788557b6 transformations/add_background_image.py --- a/transformations/add_background_image.py Tue Feb 09 21:33:57 2010 -0500 +++ b/transformations/add_background_image.py Tue Feb 09 22:16:22 2010 -0500 @@ -7,7 +7,8 @@ Author: Guillaume Sicard ''' -import sys, os, random, fnmatch +import sys, os, random +import cPickle import Image, numpy class AddBackground(): @@ -15,9 +16,9 @@ self.h = 32 self.w = 32 self.threshold = threshold; - self.bg_image_dir = '/data/lisa/data/ift6266h10/image_net/' - self.pattern = '*.JPEG' - self.image_files = fnmatch.filter(os.listdir(self.bg_image_dir),self.pattern) + self.bg_image_file = '/data/lisa/data/ift6266h10/image_net/filelist.pkl' + f=open(self.bg_image_file) + self.image_files = cPickle.load(f) # get threshold value def get_settings_names(self):