Skip to content
Snippets Groups Projects
Commit db084196 authored by Luc Giffon's avatar Luc Giffon
Browse files

test resize avec check des nouvelles tailles

parent a85b4c79
No related branches found
No related tags found
No related merge requests found
...@@ -79,6 +79,7 @@ class ImageDataset(Dataset): ...@@ -79,6 +79,7 @@ class ImageDataset(Dataset):
length_by_chanel = int(length_by_chanel) length_by_chanel = int(length_by_chanel)
images_mat = np.reshape(images_vec, (images_vec.shape[0], length_by_chanel, self.DEPTH), order='F') images_mat = np.reshape(images_vec, (images_vec.shape[0], length_by_chanel, self.DEPTH), order='F')
images = np.reshape(images_mat, (images_mat.shape[0], self.HEIGHT, self.WIDTH, self.DEPTH), order='C') images = np.reshape(images_mat, (images_mat.shape[0], self.HEIGHT, self.WIDTH, self.DEPTH), order='C')
logger.debug("Images mat shape: {}".format(images.shape))
setattr(self, kw, LabeledData(images, labels)) setattr(self, kw, LabeledData(images, labels))
def flatten(self): def flatten(self):
......
...@@ -33,6 +33,9 @@ class TestResizeTransformer(unittest.TestCase): ...@@ -33,6 +33,9 @@ class TestResizeTransformer(unittest.TestCase):
d.to_image() d.to_image()
trans = ResizeTransformer(data_name=data_name, output_shape=size) trans = ResizeTransformer(data_name=data_name, output_shape=size)
d.apply_transformer(transformer=trans) d.apply_transformer(transformer=trans)
new_size = d.train.data[0].shape[:-1]
self.assertEqual(new_size[0], size[0])
self.assertEqual(new_size[1], size[1])
del trans del trans
def test_init(self): def test_init(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment