def read_img_sample(self, filename): imgtmp = scipy.misc.imread(filename) ds = imgtmp.shape if self.is_crop: img = scipy.misc.imresize(imgtmp,(self.sh,self.sw,3)) img = np.array(img).astype(np.float32) return img