sieć neuronowa, rozpoznawanie cyfry z obrazka oraz testowe cyfry

This commit is contained in:
Aniela 2022-05-25 20:20:09 +02:00
parent 08a66b94f4
commit 4a49e5d829
4 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" /> <excludeFolder url="file://$MODULE_DIR$/venv" />
</content> </content>
<orderEntry type="jdk" jdkName="Python 3.8 (Sztuczna_Inteligencja_Gr16)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.9 (1213)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

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.8 (Sztuczna_Inteligencja_Gr16)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (1213)" project-jdk-type="Python SDK" />
</project> </project>

View File

@ -8,7 +8,7 @@ from agent import *
from okno import * from okno import *
from ramy_czyli_wiedza_agenta import * from ramy_czyli_wiedza_agenta import *
from rescue import * from rescue import *
from neural_network import *
# aby działalo w oknie + rozdzielczość ekranu # aby działalo w oknie + rozdzielczość ekranu
# ctypes.windll.shcore.SetProcessDpiAwareness(1) # ctypes.windll.shcore.SetProcessDpiAwareness(1)
@ -146,6 +146,7 @@ def main():
pygame.time.wait(1500) pygame.time.wait(1500)
flaga1 = 0 flaga1 = 0
t = threading.Timer(5.0, zdarzenie_osoba).start() t = threading.Timer(5.0, zdarzenie_osoba).start()
recognition()
try: try:
main() main()

View File

@ -17,9 +17,9 @@ def drzewo_decyzyjne():
clf = clf.fit(x, y) clf = clf.fit(x, y)
# print("Dokładność: ", metrics.accuracy_score(y_test, y_pred)) # print("Dokładność: ", metrics.accuracy_score(y_test, y_pred))
dot_data = tree.export_graphviz(clf, out_file=None, feature_names=kolumny_x, class_names=['0', '1']) # dot_data = tree.export_graphviz(clf, out_file=None, feature_names=kolumny_x, class_names=['0', '1'])
graph = pydotplus.graph_from_dot_data(dot_data) # graph = pydotplus.graph_from_dot_data(dot_data)
graph.write_png('drzewo.png') #graph.write_png('drzewo.png')
return clf return clf