Пример #1
0
    #save time for logging
    dirname = datetime.now().strftime("%Y%m%d_%H%M%S")

    #Load DeepForest_config and data file based on training or retraining mode

    DeepForest_config = load_config("train")
    data = preprocess.load_data(DeepForest_config["training_csvs"],
                                DeepForest_config["rgb_res"],
                                DeepForest_config["lidar_path"])

    #Log site
    site = DeepForest_config["evaluation_site"]

    ##Preprocess Filters##
    if DeepForest_config['preprocess']['zero_area']:
        data = preprocess.zero_area(data)

    #pass an args object instead of using command line
    args = [
        "--epochs",
        str(DeepForest_config["epochs"]), "--batch-size",
        str(DeepForest_config['batch_size']), "--backbone",
        str(DeepForest_config["backbone"]), "--score-threshold",
        str(DeepForest_config["score_threshold"])
    ]

    #Create log directory if saving snapshots
    if not DeepForest_config["save_snapshot_path"] == "None":
        snappath = DeepForest_config["save_snapshot_path"] + dirname
        os.mkdir(snappath)
Пример #2
0
                            project_name='deepforest-retinanet')

    ##Set seed for reproducibility##
    np.random.seed(2)

    #Load data and combine into a large frame
    #Training
    data = preprocess.load_data(data_dir=config['training_csvs'])

    #Evaluation
    evaluation = preprocess.load_data(data_dir=config['evaluation_csvs'])

    ##Preprocess Filters##

    if config['preprocess']['zero_area']:
        data = preprocess.zero_area(data)
        evaluation = preprocess.zero_area(evaluation)

    #Write training and evaluation data to file for annotations
    data.to_csv("data/training/detection.csv")
    evaluation.to_csv("data/training/evaluation.csv")

    #log data size and set number of steps
    if not config["subsample"] == "None":
        experiment.log_parameter("training_samples", config["subsample"])
        steps = config["subsample"]
    else:
        experiment.log_parameter("training_samples", data.shape[0])
        steps = data.shape[0]

    #Create log directory if saving snapshots