From c6df15c609288bb6eea6e25c482a02e21c276cbf Mon Sep 17 00:00:00 2001 From: secret_dude Date: Wed, 2 Jun 2021 01:32:48 +0200 Subject: [PATCH] minor changes --- createNeuralNetworkDatabase.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/createNeuralNetworkDatabase.py b/createNeuralNetworkDatabase.py index 4a36f49..24fcf92 100644 --- a/createNeuralNetworkDatabase.py +++ b/createNeuralNetworkDatabase.py @@ -16,6 +16,7 @@ for img in os.listdir(path_potatoes): pic = cv2.resize(pic,(size,size)) training_data_potatoes.append([pic]) + np.save(os.path.join('neural_network','potatoes-dataset'),np.array(training_data_potatoes)) saved_potatoes = np.load(os.path.join('neural_network','potatoes-dataset.npy')) @@ -32,6 +33,10 @@ np.save(os.path.join('neural_network','beetroot-dataset'),np.array(training_data saved_potatoes = np.load(os.path.join('neural_network','beetroot-dataset.npy')) -# for i in range(5): -# plt.imshow(np.array(training_data_potatoes[i]).reshape(size,size,3)) -# plt.show() \ No newline at end of file +dict = { + 'beetroots': training_data_beetroot, + 'potatoes': training_data_potatoes +} + +print(dict) +np.save(os.path.join('neural_network','dataset'), np.array(dict)) \ No newline at end of file