Merge branch 'master' of https://git.wmi.amu.edu.pl/s434720/2019SZI-Projekt
This commit is contained in:
commit
232b4af77d
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
*/__pycache__/
|
*__pycache__*
|
||||||
*tex
|
*tex
|
||||||
Images/TrainingImages/
|
Images/TrainingImages/
|
||||||
Model/bottleneck/
|
Model/bottleneck/
|
||||||
|
@ -199,7 +199,7 @@ if __name__ == "__main__":
|
|||||||
if args.output_layer:
|
if args.output_layer:
|
||||||
output_layer = args.output_layer
|
output_layer = args.output_layer
|
||||||
|
|
||||||
classify(model_file=model_file, label_file=label_file, input_height=input_height, input_width=input_width,
|
classify_files(model_file=model_file, label_file=label_file, input_height=input_height, input_width=input_width,
|
||||||
input_mean=input_mean, input_std=input_std, input_layer=input_layer, output_layer=output_layer)
|
input_mean=input_mean, input_std=input_std, input_layer=input_layer, output_layer=output_layer)
|
||||||
|
|
||||||
# for i in top_k:
|
# for i in top_k:
|
||||||
|
Binary file not shown.
31
UI/grid.py
31
UI/grid.py
@ -100,18 +100,16 @@ class House:
|
|||||||
|
|
||||||
|
|
||||||
def find_trash_file(self):
|
def find_trash_file(self):
|
||||||
# trash_files_list = []
|
|
||||||
from os.path import sep # culture and os invariant separator
|
from os.path import sep # culture and os invariant separator
|
||||||
|
|
||||||
file_names = [(join(f"Images{sep}TestImages", f))
|
file_names = [(join(f"Images{sep}TestImages", f))
|
||||||
for f in listdir(f"Images{sep}TestImages")
|
for f in listdir(f"Images{sep}TestImages")
|
||||||
if isfile(join(f"Images{sep}TestImages", f))]
|
if isfile(join(f"Images{sep}TestImages", f))]
|
||||||
# #filter names
|
|
||||||
# for f in file_names:
|
|
||||||
# if trash[2] in f:
|
|
||||||
# trash_files_list.append(f)
|
|
||||||
file_name = file_names[rd.randint(0,len(file_names)) - 1]
|
file_name = file_names[rd.randint(0,len(file_names)) - 1]
|
||||||
|
|
||||||
from Logic.TrashRecognition.ImageClassification import classify_file
|
from Logic.TrashRecognition.ImageClassification import classify_file
|
||||||
|
|
||||||
if file_name in recognized_trash:
|
if file_name in recognized_trash:
|
||||||
rt = recognized_trash[file_name]
|
rt = recognized_trash[file_name]
|
||||||
return (file_name, rt[0], rt[1])
|
return (file_name, rt[0], rt[1])
|
||||||
@ -120,35 +118,12 @@ class House:
|
|||||||
recognized_trash[file_name] = (classification[1], classification[2])
|
recognized_trash[file_name] = (classification[1], classification[2])
|
||||||
return classification
|
return classification
|
||||||
|
|
||||||
# trash_files_list = []
|
|
||||||
|
|
||||||
# # filter names
|
|
||||||
# for f in trash_files:
|
|
||||||
# if trash[2] in f[1]:
|
|
||||||
# trash_files_list.append(f[0])
|
|
||||||
|
|
||||||
# f = rd.randint(0,len(trash_files_list))
|
|
||||||
# return trash_files_list[f-1]
|
|
||||||
|
|
||||||
def generate_trash(self):
|
def generate_trash(self):
|
||||||
self.empty = False
|
self.empty = False
|
||||||
|
|
||||||
classification = self.find_trash_file()
|
classification = self.find_trash_file()
|
||||||
self.trash = self.trash_dict[classification[1]]
|
self.trash = self.trash_dict[classification[1]]
|
||||||
self.trash_file = classification[0]
|
self.trash_file = classification[0]
|
||||||
# num = rd.randint(1, 4)
|
|
||||||
# if num == 1:
|
|
||||||
# self.trash = self.paper
|
|
||||||
# self.trash_file = self.find_trash_file(self.trash)
|
|
||||||
# elif num == 2:
|
|
||||||
# self.trash = self.glass
|
|
||||||
# self.trash_file = self.find_trash_file(self.trash)
|
|
||||||
# elif num == 3:
|
|
||||||
# self.trash = self.metal
|
|
||||||
# self.trash_file = self.find_trash_file(self.trash)
|
|
||||||
# elif num == 4:
|
|
||||||
# self.trash = self.plastic
|
|
||||||
# self.trash_file = self.find_trash_file(self.trash)
|
|
||||||
|
|
||||||
def get_day_of_week(self, d: int):
|
def get_day_of_week(self, d: int):
|
||||||
for day in self.DAYS:
|
for day in self.DAYS:
|
||||||
|
Loading…
Reference in New Issue
Block a user