From f94b6a3b44e99a181fec060e29bf8827a9aa846b Mon Sep 17 00:00:00 2001 From: s452726 Date: Tue, 22 Jun 2021 19:15:39 +0200 Subject: [PATCH] =?UTF-8?q?Poprawienie=20=C5=9Bcie=C5=BCek=20z=20bezwzgl?= =?UTF-8?q?=C4=99dnych=20na=20wzgl=C4=99dne.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- .idea/smieciara.iml | 2 +- .idea/workspace.xml | 41 +++++++++++++++++++++++++++++++++++++---- neural_network.py | 2 +- neural_network2.py | 2 +- neural_network_vers2.py | 8 ++++---- 6 files changed, 45 insertions(+), 12 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index ea01f0b..8d93904 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/.idea/smieciara.iml b/.idea/smieciara.iml index c67b363..d9e6024 100644 --- a/.idea/smieciara.iml +++ b/.idea/smieciara.iml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 686b5de..bfcb7f8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,12 @@ - + + + + + + - + + + + + + + - @@ -138,6 +148,29 @@ + + + + + + \ No newline at end of file diff --git a/neural_network.py b/neural_network.py index 83f7379..de2ce5a 100644 --- a/neural_network.py +++ b/neural_network.py @@ -48,6 +48,6 @@ history = model.fit(x=X_train, y=y_train, validation_split=0.1, epochs=100, batc #model.evaluate(X_test, y_test) -model.save('C:/Users/Natalia/Desktop/lsm04/smieciara/saved_model') +model.save('./saved_model') diff --git a/neural_network2.py b/neural_network2.py index eb80cba..67db075 100644 --- a/neural_network2.py +++ b/neural_network2.py @@ -14,7 +14,7 @@ def b(): a = dff.sample() pred(a) -model = tf.keras.models.load_model('C:/Users/Natalia/Desktop/lsm04/smieciara/saved_model') +model = tf.keras.models.load_model('./saved_model') def pred(a): diff --git a/neural_network_vers2.py b/neural_network_vers2.py index 1541381..65ae25d 100644 --- a/neural_network_vers2.py +++ b/neural_network_vers2.py @@ -8,15 +8,15 @@ from PIL import Image img_height = 180 img_width = 180 class_names=['glass','metal','paper','plastic'] -model = tf.keras.models.load_model('C:/Users/Natalia/Desktop/lsm04/smieciara/saved_model_vers2') +model = tf.keras.models.load_model('./saved_model_vers2') def predict(): - path="C:/Users/Natalia/Documents/dane_testowe" + path="./dane_testowe" files=os.listdir(path) d=random.choice(files) - im = Image.open("C:/Users/Natalia/Documents/dane_testowe/" + d) + im = Image.open("./dane_testowe/" + d) im.show() img = keras.preprocessing.image.load_img( - "C:/Users/Natalia/Documents/dane_testowe/" + d, target_size=(img_height, img_width) + "./dane_testowe/" + d, target_size=(img_height, img_width) ) img_array = keras.preprocessing.image.img_to_array(img) img_array = tf.expand_dims(img_array, 0) # Create a batch