diff --git a/function.py b/function.py index e64cd0e..b9b2d3b 100644 --- a/function.py +++ b/function.py @@ -96,7 +96,10 @@ def load_dataset(directory): label = int(file.split('_')[0]) labels.append(label) data_set.append(img_to_vector(os.path.join(root, file))) - return np.array(data_set).reshape(len(data_set), -1), np.array(labels) + data_set = np.array(data_set).reshape(len(data_set), -1) + scaler = StandardScaler() + data_set = scaler.fit_transform(data_set) + return data_set, np.array(labels) if __name__ == "__main__":