File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import numpy as np
2
2
import os
3
- from scipy .misc import imread ,imresize
3
+ from imageio import imread # as advised https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imread.html
4
+ from PIL import Image
4
5
import pandas as pd
5
6
7
+ # as advised https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imresize.html?highlight=imresize#scipy.misc.imresize
8
+ def imresize (arr , size ):
9
+ return np .array (Image .fromarray (arr ).resize (size = size ))
10
+
6
11
def fetch_lfw_dataset (attrs_name = "lfw_attributes.txt" ,
7
12
images_name = "lfw-deepfunneled" ,
8
13
raw_images_name = "lfw" ,
@@ -68,4 +73,3 @@ def fetch_lfw_dataset(attrs_name = "lfw_attributes.txt",
68
73
all_attrs = df .drop (["photo_path" ,"person" ,"imagenum" ],axis = 1 )
69
74
70
75
return all_photos ,all_attrs
71
-
You can’t perform that action at this time.
0 commit comments