comparison transformations/add_background_image.py @ 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 be24db3a4d6e
children f75f5acad4eb
comparison
equal deleted inserted replaced
73:859ebd7f8754 79:53ee1097c02c
14 class AddBackground(): 14 class AddBackground():
15 def __init__(self, threshold = 128): 15 def __init__(self, threshold = 128):
16 self.h = 32 16 self.h = 32
17 self.w = 32 17 self.w = 32
18 self.threshold = threshold; 18 self.threshold = threshold;
19 self.bg_image_file = '/data/lisa/data/ift6266h10/image_net/' 19 try: #in order to load locally if it is available
20 f=open(self.bg_image_file+'filelist.pkl') 20 self.bg_image_file = '/Tmp/image_net/'
21 f=open(self.bg_image_file+'filelist.pkl')
22 except:
23 self.bg_image_file = '/data/lisa/data/ift6266h10/image_net/'
24 f=open(self.bg_image_file+'filelist.pkl')
21 self.image_files = cPickle.load(f) 25 self.image_files = cPickle.load(f)
22 f.close() 26 f.close()
23 27
24 # get threshold value 28 # get threshold value
25 def get_settings_names(self): 29 def get_settings_names(self):