From 945ad8ce12e263877c57d217ad00cb6d9ba5f16a Mon Sep 17 00:00:00 2001 From: nlitkowski Date: Mon, 10 Jun 2019 00:37:01 +0200 Subject: [PATCH 1/3] Update gitignore --- .gitignore | 2 +- Logic/TrashRecognition/ImageClassification.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d6b1547..29784c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .vscode/ -*/__pycache__/ +*__pycache__* *tex Images/TrainingImages/ Model/bottleneck/ diff --git a/Logic/TrashRecognition/ImageClassification.py b/Logic/TrashRecognition/ImageClassification.py index 72b29d3..ebd1686 100644 --- a/Logic/TrashRecognition/ImageClassification.py +++ b/Logic/TrashRecognition/ImageClassification.py @@ -199,7 +199,7 @@ if __name__ == "__main__": if 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) # for i in top_k: From 078768815fbef19dd1be81478d57046ea4e3a5ba Mon Sep 17 00:00:00 2001 From: nlitkowski Date: Mon, 10 Jun 2019 00:41:31 +0200 Subject: [PATCH 2/3] code cleanup --- UI/grid.py | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/UI/grid.py b/UI/grid.py index abab26c..4998bb0 100644 --- a/UI/grid.py +++ b/UI/grid.py @@ -100,18 +100,16 @@ class House: def find_trash_file(self): - # trash_files_list = [] from os.path import sep # culture and os invariant separator file_names = [(join(f"Images{sep}TestImages", f)) for f in listdir(f"Images{sep}TestImages") 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] + from Logic.TrashRecognition.ImageClassification import classify_file + if file_name in recognized_trash: rt = recognized_trash[file_name] return (file_name, rt[0], rt[1]) @@ -119,16 +117,6 @@ class House: classification = classify_file(file_dir=file_name) recognized_trash[file_name] = (classification[1], classification[2]) 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): self.empty = False @@ -136,19 +124,6 @@ class House: classification = self.find_trash_file() self.trash = self.trash_dict[classification[1]] 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): for day in self.DAYS: From ce707a1b7507efceb3d7638fa15372018f1efb5d Mon Sep 17 00:00:00 2001 From: nlitkowski Date: Mon, 10 Jun 2019 00:43:35 +0200 Subject: [PATCH 3/3] remove cache --- .../ImageClassification.cpython-36.pyc | Bin 4490 -> 0 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 173 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Logic/TrashRecognition/__pycache__/ImageClassification.cpython-36.pyc delete mode 100644 Logic/TrashRecognition/__pycache__/__init__.cpython-36.pyc diff --git a/Logic/TrashRecognition/__pycache__/ImageClassification.cpython-36.pyc b/Logic/TrashRecognition/__pycache__/ImageClassification.cpython-36.pyc deleted file mode 100644 index 0abd90502cc971910bec9174bd63d3f2d0ac0220..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4490 zcmbtXTXWmS6$U_n1i?E+NtPVjv=b+0VoARA7B@|r+I8Z#(YUtjbTH~*AnuX^MS{!% ztSuIt$&8Xm)p_V!njg^jKJ>Tj^sO_U(Mx}T+m8F4g(y*On@OkS;Oy?%vx~i)?>h%K zOC=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