Sfoglia il codice sorgente

Update of reconstruction transformation

Jérôme BUISINE 4 anni fa
parent
commit
f217f9b872
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  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(',')))