def load_classifier(self): utils.clear_screen() if not MODEL_CONTROLLER.load_model(): self.start_menue() else: self.main_menue()
def show_setting_SURF(self): utils.clear_screen() # print current settings print "SURF SETTINGS" print "Cross Val. k:\t\t", Settings.SU_CROSS_VALIDATION_K print "Test Segments:\t\t", Settings.SU_TESTDATA_SEGMENTS print "SVM Props:\t\t", Settings.SU_SVM_PARAMS print "BOW Dimension:\t\t", Settings.SU_BOW_DIMENSION options = ["change cross validation number", "change BOW Dimension"] input = utils.menue("OPTIONS:", options, False, True) if input == 1: Settings.SU_CROSS_VALIDATION_K = utils.value_setting( "Cross validation runs", "i", "1 means no cross validation.") self.save_settings() self.show_setting_SURF() elif input == 2: Settings.SU_BOW_DIMENSION = utils.value_setting( "Change BOW Dimension", "i", "default: 1000") self.save_settings() self.show_setting_SURF() else: self.show_settings()
def start_menue(self): """Starting point of program.""" utils.clear_screen() options = [ "create NEW classifier", "load EXISTING classifier", "test parameters", "show high scores", "segment image", "test data manipulation", "settings" ] input = utils.menue("START MENUE:", options, True, False) if input == 1: self.create_classifier() elif input == 2: self.load_classifier() elif input == 3: self.test_parameters() elif input == 4: self.show_highscores() elif input == 5: self.segment_image() elif input == 6: self.test_data_menue() elif input == 7: self.show_settings() elif input == 8: return self.start_menue()
def show_setting_histogram(self): utils.clear_screen() # print current settings print "Histogram SETTINGS" print "Cross Val. k:\t\t", Settings.H_CROSS_VALIDATION_K print "Test Segments:\t\t", Settings.H_TESTDATA_SEGMENTS print "Image Segments:\t\t", Settings.H_IMAGE_SEGMENTS print "Bins per Color\t\t", Settings.H_BINS print "Range:\t\t\t", Settings.H_COLOR_RANGE print "Color Space:\t\t", Settings.H_COLOR_SPACE print "SVM Props:\t\t", Settings.H_SVM_PARAMS options = [ "change cross validation number", "change image segmentation", "change number of bins", "change color range", "change color space" ] input = utils.menue("OPTIONS:", options, False, True) if input == 1: Settings.H_CROSS_VALIDATION_K = utils.value_setting( "Cross validation runs", "i", "1 means no cross validation.") self.save_settings() self.show_setting_histogram() elif input == 2: Settings.H_IMAGE_SEGMENTS = utils.radio_setting( "Number of Image Segments", Settings.H_IMAGE_SEGMENTS, ["1", "2", "4", "9", "16", "25"], [1, 2, 4, 9, 16, 25]) self.save_settings() self.show_setting_histogram() elif input == 3: Settings.H_BINS = utils.value_setting( "Number of histogram bins per color", "i", "default: 64 bins") self.save_settings() self.show_setting_histogram() elif input == 4: lower = utils.value_setting("Lower range for color values", "i", "default: 0") upper = utils.value_setting("Upper range for color values", "i", "default: 256") Settings.H_COLOR_RANGE = [lower, upper] self.save_settings() self.show_setting_histogram() elif input == 5: Settings.H_COLOR_SPACE = utils.radio_setting( "Color Space", Settings.H_COLOR_SPACE, ["HSV", "RGB", "BGR"], [ColorSpace.HSV, ColorSpace.RGB, ColorSpace.BGR]) self.save_settings() self.show_setting_histogram() else: self.show_settings()
def show_model_screen(self): """ Prints a model selection screen to the console window. Returns: ModelId """ utils.clear_screen() options = ["SIFT kp/dp + BoW + SVM", "Histogram & SVM", "SURF kp/dp + BoW + SVM", "ORB kp/dp + BoW + SVM", "DAISY [deprecated]", "CenSurE kp, SIFT dp + BoW + SVM", "Late Fusion - SVM-Vectors", "LBP + SVM", "Neural Nets", "Late Fusion Majority Vote", "Random Keypoint Sampling"] modelId = utils.menue("Choose model:", options, False) if modelId == len(options): return -1 return modelId
def show_settings(self): utils.clear_screen() # print current settings print "SETTINGS" print "DataSet:\t\t", self.show_default_dataset() print "High Eval Detail:\t", Settings.G_EVALUATION_DETAIL_HIGH print "Detailed output:\t", Settings.G_DETAILED_CONSOLE_OUTPUT print "Mail Notifications:\t", MailServer.are_mails_enabled() print "Auto report mailing:\t", Settings.G_AUTOMATIC_REPORT_MAILING options = [ "change default data set", "change evaluation detail level", "change console output level", "SIFT Settings", "Histogram Settings", "SURF Settings", "Configure Mail Settings" ] input = utils.menue("OPTIONS:", options, False, True) if input == 1: self.change_default_dataset() self.show_settings() elif input == 2: Settings.G_EVALUATION_DETAIL_HIGH = utils.radio_setting( "Detail Level", Settings.G_EVALUATION_DETAIL_HIGH, ["High", "Low"], [True, False]) self.save_settings() self.show_settings() elif input == 3: Settings.G_DETAILED_CONSOLE_OUTPUT = utils.radio_setting( "Console Output Detail", Settings.G_DETAILED_CONSOLE_OUTPUT, ["High", "Low"], [True, False]) self.save_settings() self.show_settings() elif input == 4: self.show_setting_SIFT() self.show_settings() elif input == 5: self.show_setting_histogram() self.show_settings() elif input == 6: self.show_setting_SURF() self.show_settings() elif input == 7: self.show_setting_Mail() self.show_settings() elif input == 8: self.start_menue()
def test_data_menue(self): utils.clear_screen() options = [ "equalize test data image size", "add prefix to test data", "crop bounding boxes", "crop to square", "augment test data size", "cherry pick 'test data augmentation' iteration" ] input = utils.menue("Test data menue", options, False, True) if input == 1: self.normalize_testdata() elif input == 2: self.rename_prefix() elif input == 3: self.crop_bounding_boxes() elif input == 4: self.crop_test_data_to_square() elif input == 5: self.augment_test_data() elif input == 6: self.augment_test_data(True) else: return self.test_data_menue()