provide direct size instead of scale since then PIL tries to compare array to a tuple
authorYaroslav Halchenko <debian@onerussian.com>
Tue, 25 Oct 2016 12:24:18 +0000 (12:24 +0000)
committerYaroslav Halchenko <debian@onerussian.com>
Tue, 25 Oct 2016 12:24:18 +0000 (12:24 +0000)
Gbp-Pq: Name up_workaround_buggy_pil

sklearn/datasets/lfw.py

index a8298cb52a06f05e3355a7d863c6ab78c3c92bae..21cb9076b0055d36c51bec22194516c1276b31ad 100644 (file)
@@ -168,7 +168,7 @@ def _load_imgs(file_paths, slice_, color, resize):
         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