Poprawienie ścieżek z bezwzględnych na względne.

This commit is contained in:
s452726 2021-06-22 19:15:39 +02:00
parent dfb26e7950
commit f94b6a3b44
6 changed files with 45 additions and 12 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (untitled2)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project> </project>

View File

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (untitled2)" jdkType="Python SDK" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

View File

@ -1,7 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9f88f6ee-b4a6-4771-930e-edad9600a746" name="Default Changelist" comment="" /> <list default="true" id="9f88f6ee-b4a6-4771-930e-edad9600a746" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/neural_network.py" beforeDir="false" afterPath="$PROJECT_DIR$/neural_network.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/neural_network2.py" beforeDir="false" afterPath="$PROJECT_DIR$/neural_network2.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/neural_network_vers2.py" beforeDir="false" afterPath="$PROJECT_DIR$/neural_network_vers2.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -42,7 +47,7 @@
<recent name="C:\Users\micha\Desktop\smieciara" /> <recent name="C:\Users\micha\Desktop\smieciara" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Python.genetic_algorithm (1)"> <component name="RunManager" selected="Python.main">
<configuration name="genetic_algorithm (1)" type="PythonConfigurationType" factoryName="Python" temporary="true"> <configuration name="genetic_algorithm (1)" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="smieciara" /> <module name="smieciara" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
@ -92,7 +97,7 @@
<envs> <envs>
<env name="PYTHONUNBUFFERED" value="1" /> <env name="PYTHONUNBUFFERED" value="1" />
</envs> </envs>
<option name="SDK_HOME" value="C:\Users\Natalia\PycharmProjects\untitled2\venv\Scripts\python.exe" /> <option name="SDK_HOME" value="/usr/local/bin/python3.9" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" /> <option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
@ -106,11 +111,16 @@
<option name="INPUT_FILE" value="" /> <option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<list>
<item itemvalue="Python.genetic_algorithm" />
<item itemvalue="Python.genetic_algorithm (1)" />
<item itemvalue="Python.main" />
</list>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Python.main" />
<item itemvalue="Python.genetic_algorithm (1)" /> <item itemvalue="Python.genetic_algorithm (1)" />
<item itemvalue="Python.genetic_algorithm" /> <item itemvalue="Python.genetic_algorithm" />
<item itemvalue="Python.main" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
@ -138,6 +148,29 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1615920190869</updated> <updated>1615920190869</updated>
</task> </task>
<task id="LOCAL-00001" summary="Dodanie projektu">
<created>1624381365660</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1624381365660</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Dodanie projektu" />
<option name="LAST_COMMIT_MESSAGE" value="Dodanie projektu" />
</component>
</project> </project>

View File

@ -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.evaluate(X_test, y_test)
model.save('C:/Users/Natalia/Desktop/lsm04/smieciara/saved_model') model.save('./saved_model')

View File

@ -14,7 +14,7 @@ def b():
a = dff.sample() a = dff.sample()
pred(a) 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): def pred(a):

View File

@ -8,15 +8,15 @@ from PIL import Image
img_height = 180 img_height = 180
img_width = 180 img_width = 180
class_names=['glass','metal','paper','plastic'] 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(): def predict():
path="C:/Users/Natalia/Documents/dane_testowe" path="./dane_testowe"
files=os.listdir(path) files=os.listdir(path)
d=random.choice(files) d=random.choice(files)
im = Image.open("C:/Users/Natalia/Documents/dane_testowe/" + d) im = Image.open("./dane_testowe/" + d)
im.show() im.show()
img = keras.preprocessing.image.load_img( 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 = keras.preprocessing.image.img_to_array(img)
img_array = tf.expand_dims(img_array, 0) # Create a batch img_array = tf.expand_dims(img_array, 0) # Create a batch