Skip to content
Snippets Groups Projects
Commit 3d4d2993 authored by Maciej Wielgosz's avatar Maciej Wielgosz
Browse files

update for hyper params search

parent f0bc2a69
Branches
No related tags found
No related merge requests found
#!/bin/bash
TARGET_FOLDER=/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground
# clean the folder
rm -rf $TARGET_FOLDER/*
mkdir $TARGET_FOLDER/segmented_point_clouds
mkdir $TARGET_FOLDER/instance_segmented_point_clouds
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/burum2_tile_-100_0.las $TARGET_FOLDER
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/Plot89_tile_-25_0.las $TARGET_FOLDER
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/plot82_tile_-25_0.las $TARGET_FOLDER
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/Plot104_tile_-25_0.las $TARGET_FOLDER
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/segmented_point_clouds/burum2_tile_-100_0.segmented.ply $TARGET_FOLDER/segmented_point_clouds
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/segmented_point_clouds/Plot89_tile_-25_0.segmented.ply $TARGET_FOLDER/segmented_point_clouds
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/segmented_point_clouds/plot82_tile_-25_0.segmented.ply $TARGET_FOLDER/segmented_point_clouds
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/segmented_point_clouds/Plot104_tile_-25_0.segmented.ply $TARGET_FOLDER/segmented_point_clouds
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/segmented_point_clouds/tiled/burum2_tile_-100_0.segmented $TARGET_FOLDER/segmented_point_clouds/tiled
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/segmented_point_clouds/tiled/Plot89_tile_-25_0.segmented $TARGET_FOLDER/segmented_point_clouds/tiled
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/segmented_point_clouds/tiled/plot82_tile_-25_0.segmented $TARGET_FOLDER/segmented_point_clouds/tiled
cp -r /home/nibio/mutable-outside-world/data/corrected/validation_after_seg/segmented_point_clouds/tiled/Plot104_tile_-25_0.segmented $TARGET_FOLDER/segmented_point_clouds/tiled
...@@ -44,6 +44,20 @@ pbounds = { ...@@ -44,6 +44,20 @@ pbounds = {
'add_leaves_edge_length': (0.2, 1.5) 'add_leaves_edge_length': (0.2, 1.5)
} }
# partially fixed params for faster optimization
# pbounds = {
# 'n_tiles': (3, 3),
# 'slice_thickness': (0.25, 0.75), # important
# 'find_stems_height': (1.6, 1.6), # 1.6
# 'find_stems_thickness': (0.1, 1.0), # important
# 'graph_maximum_cumulative_gap': (12.9, 12.9), # 12.9
# 'add_leaves_voxel_length': (0.25, 0.25), # 0.25
# 'find_stems_min_points': (50, 500), # important
# 'graph_edge_length': (0.92, 0.92), # 0.92
# 'add_leaves_edge_length': (0.85, 0.85) # 0.85
# }
optimizer = BayesianOptimization( optimizer = BayesianOptimization(
f=bayes_opt_main, f=bayes_opt_main,
pbounds=pbounds, pbounds=pbounds,
...@@ -52,12 +66,12 @@ optimizer = BayesianOptimization( ...@@ -52,12 +66,12 @@ optimizer = BayesianOptimization(
) )
# load the logs # load the logs
load_logs(optimizer, logs=["./bayes_opt_run_logs.json"]) # load_logs(optimizer, logs=["./our_model_opt.json"])
logger = JSONLogger(path="./bayes_opt_run_logs_1.json") logger = JSONLogger(path="./our_model_non_cut_trees_4_files.json")
optimizer.subscribe(Events.OPTIMIZATION_STEP, logger) optimizer.subscribe(Events.OPTIMIZATION_STEP, logger)
optimizer.maximize( optimizer.maximize(
init_points=1, init_points=5,
n_iter=100 n_iter=200
) )
import os import os
import argparse import argparse
from joblib import Parallel, delayed
from matplotlib import use from matplotlib import use
from tqdm import tqdm from tqdm import tqdm
...@@ -78,8 +79,12 @@ class ConvertFilesInFolder(object): ...@@ -78,8 +79,12 @@ class ConvertFilesInFolder(object):
logging.info("Found {} files that can be converted.".format(len(file_paths))) logging.info("Found {} files that can be converted.".format(len(file_paths)))
# iterate over all files and convert them # iterate over all files and convert them
for file_path in tqdm(file_paths):
self.convert_file(file_path) # for file_path in tqdm(file_paths):
# self.convert_file(file_path)
# use joblib to speed up the process
Parallel(n_jobs=-1)(delayed(self.convert_file)(file_path) for file_path in tqdm(file_paths))
# print out the progress # print out the progress
if self.verbose: if self.verbose:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment