File: up_workaround_buggy_pil

package info (click to toggle)
scikit-learn 0.20.2%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 51,036 kB
  • sloc: python: 108,171; ansic: 8,722; cpp: 5,651; makefile: 192; sh: 40
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
@@ -184,7 +184,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