def get_save_dir_from_config(config_file_name): """ Returns the configuration's save_dir """ param_pretrain = paramStruct() param_pretrain.loadParam(config_file_name, verbose=False) pathconf_pretrain = pathConfig() # check the results directory to see if we are working on this # configuration already pathconf_pretrain.setupTrain(param_pretrain, 0) save_dir_pretrain = pathconf_pretrain.result return save_dir_pretrain
def load_data(self, param, image_file_name, kp_file_name): print(' --------------------------------------------------- ') print(' Test Data Module ') print(' --------------------------------------------------- ') pathconf = pathConfig() pathconf.setupTrain(param, 0) cur_data = self.load_data_for_set( pathconf, param, image_file_name, kp_file_name) self.x = cur_data[0] self.y = cur_data[1] self.ID = cur_data[2] self.pos = cur_data[3] self.angle = cur_data[4] self.coords = cur_data[5] print(' -- Loading finished')
output_file = sys.argv[4] bDumpPatch = bool(int(sys.argv[5])) if len(sys.argv) >= 7: bPrintTime = bool(int(sys.argv[6])) else: bPrintTime = False if len(sys.argv) >= 8: model_dir = sys.argv[7] else: model_dir = None # ------------------------------------------------------------------------ # Setup and load parameters param = paramStruct() param.loadParam(config_file, verbose=True) pathconf = pathConfig() pathconf.setupTrain(param, 0) # Overwrite with hard-coded base model setattr(param.model, "descriptor_export_folder", os.getenv("_LIFT_BASE_PATH", "") + "/models/base") # Use model dir if given if model_dir is not None: pathconf.result = model_dir # ------------------------------------------------------------------------- # Modify the network so that we bypass the keypoint part and the # orientation part param.model.sDetector = 'bypass' # This ensures that you don't create unecessary scale space
output_file = sys.argv[4] bDumpPatch = bool(int(sys.argv[5])) if len(sys.argv) >= 7: bPrintTime = bool(int(sys.argv[6])) else: bPrintTime = False if len(sys.argv) >= 8: model_dir = sys.argv[7] else: model_dir = None # ------------------------------------------------------------------------ # Setup and load parameters param = paramStruct() param.loadParam(config_file, verbose=True) pathconf = pathConfig() pathconf.setupTrain(param, 0) # Use model dir if given if model_dir is not None: pathconf.result = model_dir # ------------------------------------------------------------------------- # Modify the network so that we bypass the keypoint part and the # descriptor part. param.model.sDetector = 'bypass' # This ensures that you don't create unecessary scale space param.model.fScaleList = np.array([1.0]) param.patch.fMaxScale = np.max(param.model.fScaleList) # this ensures that you don't over eliminate features at boundaries param.model.nPatchSize = int(np.round(param.model.nDescInputSize) *