File: up_workaround_buggy_pil

package info (click to toggle)
scikit-learn 0.18-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 71,040 kB
  • ctags: 91,142
  • sloc: python: 97,257; ansic: 8,360; cpp: 5,649; makefile: 242; sh: 238
file content (15 lines) | stat: -rw-r--r-- 662 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
From: Yaroslav Halchenko <debian@onerussian.com>
Subject: provide direct size instead of scale since then PIL tries to compare array to a tuple
Last-Update: 2014-10-07

--- a/sklearn/datasets/lfw.py
+++ b/sklearn/datasets/lfw.py
@@ -168,7 +168,7 @@ def _load_imgs(file_paths, slice_, color
         face = np.asarray(img[slice_], dtype=np.float32)
         face /= 255.0  # scale uint8 coded colors to the [0.0, 1.0] floats
         if resize is not None:
-            face = imresize(face, resize)
+            face = imresize(face, (h, w))
         if not color:
             # average the color channels to compute a gray levels
             # representation