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
image_file_name = sys.argv[2] kp_file_name = sys.argv[3] 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
image_file_name = sys.argv[2] kp_file_name = sys.argv[3] 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)