Exemplo n.º 1
0
    def test_set_output_dir(self):
        path = "./output"
        environment.set_output_dir(path)

        abs_path = os.path.abspath(path)
        assert environment.OUTPUT_DIR == abs_path
        assert os.environ["OUTPUT_DIR"] == abs_path

        assert environment._EXPERIMENT_DIR == os.path.join(
            abs_path,
            "{experiment_id}",
        )
        assert environment._TENSORBOARD_DIR == os.path.join(
            abs_path,
            "{experiment_id}",
            "tensorboard",
        )
        assert environment._CHECKPOINTS_DIR == os.path.join(
            abs_path,
            "{experiment_id}",
            "checkpoints",
        )
        assert environment.EXPERIMENT_DIR is None
        assert environment.TENSORBOARD_DIR is None
        assert environment.CHECKPOINTS_DIR is None
Exemplo n.º 2
0
def train(config, experiment_id, recreate, profile_step, data_dir, output_dir):
    environment.set_data_dir(data_dir)
    environment.set_output_dir(output_dir)
    experiment_id, checkpoint_name = run_train(config, experiment_id, recreate,
                                               profile_step)
    click.echo('Next step: blueoil convert -e {} -p {}'.format(
        experiment_id, checkpoint_name))
Exemplo n.º 3
0
def convert(experiment_id, checkpoint, template, image_size, project_name, output_dir, test_image):
    environment.set_output_dir(output_dir)
    export_output_root_dir = run_convert(
        experiment_id, checkpoint, template, image_size, project_name, test_image,
    )

    click.echo('Output files are generated in {}'.format(export_output_root_dir))
    click.echo('Please see {}/README.md to run prediction'.format(export_output_root_dir))
Exemplo n.º 4
0
    def test_set_output_dir_after_init(self):
        experiment_id = "experiment001"
        environment.init(experiment_id)

        path = "./output"
        environment.set_output_dir(path)

        abs_path = os.path.abspath(path)
        assert environment.EXPERIMENT_DIR == os.path.join(
            abs_path,
            experiment_id,
        )
        assert environment.TENSORBOARD_DIR == os.path.join(
            abs_path,
            experiment_id,
            "tensorboard",
        )
        assert environment.CHECKPOINTS_DIR == os.path.join(
            abs_path,
            experiment_id,
            "checkpoints",
        )
Exemplo n.º 5
0
def predict(input, output, experiment_id, config, checkpoint, save_images, output_dir):
    environment.set_output_dir(output_dir)
    run_predict(input, output, experiment_id, config, checkpoint, save_images)

    click.echo('Result files are created: {}'.format(output))
Exemplo n.º 6
0
 def test_set_output_dir_with_gcs_path(self):
     path = "gs://output"
     environment.set_output_dir(path)
     assert environment.OUTPUT_DIR == path
     assert os.environ["OUTPUT_DIR"] == path