浏览代码

Update of reconstruction transformation

Jérôme BUISINE 5 年之前
父节点
当前提交
f217f9b872
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      classes/Transformation.py

+ 3 - 3
classes/Transformation.py

@@ -24,20 +24,20 @@ class Transformation():
         if self.transformation == 'svd_reconstruction':
             begin, end = list(map(int, self.param.split(',')))
             h, w = list(map(int, self.size.split(',')))
-            img.thumbnail((h, w))
             data = reconstruction.svd(img, [begin, end])
+            data = np.array(Image.fromarray(data).thumbnail((h, w)))
 
         if self.transformation == 'ipca_reconstruction':
             n_components, batch_size = list(map(int, self.param.split(',')))
             h, w = list(map(int, self.size.split(',')))
-            img.thumbnail((h, w))
             data = reconstruction.ipca(img, n_components, batch_size)
+            data = np.array(Image.fromarray(data).thumbnail((h, w)))
 
         if self.transformation == 'fast_ica_reconstruction':
             n_components = self.param
             h, w = list(map(int, self.size.split(',')))
-            img.thumbnail((h, w))
             data = reconstruction.fast_ica(img, n_components)
+            data = np.array(Image.fromarray(data).thumbnail((h, w)))
 
         if self.transformation == 'min_diff_filter':
             w_size, h_size = list(map(int, self.param.split(',')))