Commit 8390e5c3 authored by Geazy Menezes's avatar Geazy Menezes
Browse files

menu item place changed

parent 6f925869
......@@ -524,7 +524,7 @@ class CNNKeras(Classifier):
return train_generator, validation_generator, test_generator
def single_classify(self, image_path, directory, extractors, dict_classes):
from matplotlib.pylab im imread
from matplotlib.pylab import imread
image = imread(image_path)
predict = self.model.predict([image])[0]
return dict_classes[predict]
\ No newline at end of file
......@@ -89,11 +89,12 @@ if __name__ == "__main__":
tk.add_command("Load h5 weight (only for CNNs)", act.open_weight)
tk.add_command("Execute", act.run_classifier, 'C')
tk.add_command("Execute folder", act.run_classifier_folder)
tk.add_command("Execute Graphical Confusion Matrix", act.run_grafic_confusion_matrix)
tk.add_menu("Experimenter")
tk.add_check_button("Ground Truth", act.toggle_ground_truth, default_state = False)
tk.add_separator()
tk.add_command("Execute Graphical Confusion Matrix", act.run_grafic_confusion_matrix)
tk.add_separator()
tk.add_command("Cross Validation", act.cross_validation, 'X')
tk.add_command("Experimenter All", act.experimenter_all, 'p')
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
"""
This file must contain the implementation code for all actions of pynovisao.
......@@ -465,7 +463,7 @@ class Act(object):
def process_config():
"""Update the current classifier."""
new_config = self.tk.get_config_and_destroy()
self.classifier = [new_config[classifier].meta for classifier in new_config
if new_config[classifier].value == True ][0]()
......@@ -946,8 +944,14 @@ class Act(object):
def run_grafic_confusion_matrix(self):
'''
Generate a a graphical confusion matrix where images are classified and according to classification go to the wrong or right folder.
'''
from classification import WekaClassifiers
if not isinstance(self.classifier, WekaClassifiers):
message='Only available to Weka Classifiers.'
IException(message)
if not self.has_trained:
message='Dataset Must Be Trained.'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment