예제 #1
0
                            batch_size=config["batch_size"],
                            experiment_directory=config["load_experiment"],
                            load_best=config["load_best_model"])

    if args.train:
        experiment.analyze()
        experiment.train(epochs=config["epochs"])
        experiment.save_model()
        experiment.bundle()
        print("Training finished")
        exit()

    if args.benchmark:
        if config["load_experiment"] is None:
            exit("No model selected")
        experiment.benchmark_inference()

    if args.score:
        experiment.score()
        exit()

    if args.score_generalisation:
        experiment.score_generalization()

    if args.predict:
        input_file = args.predict
        output_file_name = args.output if args.output else f"{Path(input_file).stem}-prediction"
        predicted_file = experiment.predict(input_file,
                                            output_file_name,
                                            postprocessing=False,
                                            save_overlay=True)