ground_recognition/batchtrainer.py
def save_batch(batch):
    """
    make batch directory and save batch info.
    """
    batch_name = batch["batch_name"]
    batch_dir = result_base_dir / batch_name
    batch_dir.mkdir()

    # save batch information
    info_file = batch_dir / "batch_info.txt"
    with open(info_file, "w") as info_f:
        info_f.write(f"batch_name: {batch_name}\n")
        info_f.write(f"batch_time: {batchs['time']}\n")
        info_f.write(f"batch_info: {batchs['batch_info']}\n")

    # save batch config snapshot to file
    snapshot_file = batch_dir / "trainconfig.snapshot"
    shutil.copyfile(config_file_path, snapshot_file)
    # save snapshot to json format too
    snapshot_json_file = batch_dir / "trainconfig.json"
    with open(snapshot_json_file, "w") as json_f:
        json.dump(batch, json_f, indent=4)

    return batch_dir

    make batch directory and save batch info.
    
make batch directory and save batch info.
make batch directory and save batch info .
def save_batch(batch):
    batch_name = batch["batch_name"]
    batch_dir = result_base_dir / batch_name
    batch_dir.mkdir()
    info_file = batch_dir / "batch_info.txt"
    with open(info_file, "w") as info_f:
        info_f.write(f"batch_name: {batch_name}\n")
        info_f.write(f"batch_time: {batchs['time']}\n")
        info_f.write(f"batch_info: {batchs['batch_info']}\n")
    snapshot_file = batch_dir / "trainconfig.snapshot"
    shutil.copyfile(config_file_path, snapshot_file)
    snapshot_json_file = batch_dir / "trainconfig.json"
    with open(snapshot_json_file, "w") as json_f:
        json.dump(batch, json_f, indent=4)
    return batch_dir
def save_batch ( batch ) : batch_name = batch [ "batch_name" ] batch_dir = result_base_dir / batch_name batch_dir . mkdir ( ) info_file = batch_dir / "batch_info.txt" with open ( info_file , "w" ) as info_f : info_f . write ( f"batch_name: {batch_name}\n" ) info_f . write ( f"batch_time: {batchs['time']}\n" ) info_f . write ( f"batch_info: {batchs['batch_info']}\n" ) snapshot_file = batch_dir / "trainconfig.snapshot" shutil . copyfile ( config_file_path , snapshot_file ) snapshot_json_file = batch_dir / "trainconfig.json" with open ( snapshot_json_file , "w" ) as json_f : json . dump ( batch , json_f , indent = 4 ) return batch_dir
make batch directory and save batch info.
make batch directory and save batch info .
"""
    make batch directory and save batch info.
    """ # save batch information # save batch config snapshot to file # save snapshot to json format too
batch