changeset 79:53ee1097c02c

added a local data load if available (on maggie it will) for background images
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Wed, 10 Feb 2010 14:52:13 -0500
parents 859ebd7f8754
children 4407ab3f7805
files transformations/add_background_image.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/transformations/add_background_image.py	Wed Feb 10 13:02:05 2010 -0500
+++ b/transformations/add_background_image.py	Wed Feb 10 14:52:13 2010 -0500
@@ -16,8 +16,12 @@
         self.h = 32
         self.w = 32
         self.threshold = threshold;
-        self.bg_image_file = '/data/lisa/data/ift6266h10/image_net/'
-        f=open(self.bg_image_file+'filelist.pkl')
+        try: #in order to load locally if it is available
+            self.bg_image_file = '/Tmp/image_net/'
+            f=open(self.bg_image_file+'filelist.pkl')
+        except:
+            self.bg_image_file = '/data/lisa/data/ift6266h10/image_net/'
+            f=open(self.bg_image_file+'filelist.pkl')
         self.image_files = cPickle.load(f)
         f.close()