changeset 68:ee6a788557b6

Change in add_background_image to load a pickled list of file, not to do a listdir
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Tue, 09 Feb 2010 22:16:22 -0500
parents 5e448ea129b3
children 6d87c0df2b0e
files transformations/add_background_image.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):