更新 function.py
Gitea Actions Experiment Test / Experiment-Actions (push) Successful in 32s

This commit is contained in:
cy
2024-10-15 19:43:03 +08:00
parent 4b4a872637
commit 9954e4ff53
+4 -1
View File
@@ -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__":