Esempio n. 1
0
def main():
    args = download_parser().parse_args()
    if not args.no_models:
        model_path = models.main(args.model, args.install_path)

    if not args.no_amend_config:
        amend_cfg(new_model_path=model_path)
Esempio n. 2
0
def main():
    args = download_parser().parse_args()
    if not args.no_atlas:
        atlas_dir = args.install_path / "atlas"
        atlas_download.atlas_download(args.atlas, atlas_dir,
                                      args.download_path)
    if not args.no_models:
        model_path = models.main(args.model, args.install_path)

    amend_cfg(new_atlas_folder=atlas_dir,
              atlas=args.atlas,
              new_model_path=model_path)
Esempio n. 3
0
def prep_models(args):
    ## if no model or weights, set default weights
    if args.trained_model is None and args.model_weights is None:
        logging.debug("No model or weights supplied, so using the default")

        config_file = source_files.source_custom_config()
        if not Path(config_file).exists():
            logging.debug("Custom config does not exist, downloading models")
            model_path = model_download.main(args.model, args.install_path)
            amend_cfg(new_model_path=model_path)

        model_weights = get_model_weights(config_file)
        if model_weights is not "" and Path(model_weights).exists():
            args.model_weights = model_weights
        else:
            logging.debug("Model weights do not exist, downloading")
            model_path = model_download.main(args.model, args.install_path)
            amend_cfg(new_model_path=model_path)
            model_weights = get_model_weights(config_file)
            args.model_weights = model_weights
    return args
Esempio n. 4
0
def main():
    args = download_parser().parse_args()
    if args.download_path is None:
        atlas_download_path = os.path.join(temp_dir_path, "atlas.tar.gz")
    else:
        atlas_download_path = os.path.join(args.download_path, "atlas.tar.gz")
    if not args.no_atlas:
        atlas_dir = os.path.join(args.install_path, "atlas")
        atlas_download.main(args.atlas, atlas_dir, atlas_download_path)
    if not args.no_models:
        model_path = models.main(args.model, args.install_path)

    amend_cfg(new_atlas_folder=atlas_dir,
              atlas=args.atlas,
              new_model_path=model_path)