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

update for oracle run

parent f04ce4d8
Branches
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ label_formats: ...@@ -10,6 +10,7 @@ label_formats:
semantic_segmentation_params: semantic_segmentation_params:
sematic_segmentation_script: './run_bash_scripts/sem_seg_sean.sh' sematic_segmentation_script: './run_bash_scripts/sem_seg_sean.sh'
checkpoint_model_path: './fsct/model/model.pth' checkpoint_model_path: './fsct/model/model.pth'
batch_size : 5 # batch size for inference
tile_size: 10 # tile size in meters tile_size: 10 # tile size in meters
min_density: 100 # minimum density of points in a tile(used for removing small tiles) min_density: 100 # minimum density of points in a tile(used for removing small tiles)
remove_small_tiles: 1 # 1: remove small tiles, 0: not remove small tiles remove_small_tiles: 1 # 1: remove small tiles, 0: not remove small tiles
......
...@@ -36,6 +36,7 @@ def main(path_to_config_file): ...@@ -36,6 +36,7 @@ def main(path_to_config_file):
sem_seg_args.extend([ sem_seg_args.extend([
"-d", str(config["general"]["input_folder"]), "-d", str(config["general"]["input_folder"]),
"-c", str(config["semantic_segmentation_params"]["checkpoint_model_path"]), "-c", str(config["semantic_segmentation_params"]["checkpoint_model_path"]),
"-b", str(config["semantic_segmentation_params"]["batch_size"]),
"-t", str(config["semantic_segmentation_params"]["tile_size"]), "-t", str(config["semantic_segmentation_params"]["tile_size"]),
"-m", str(config["semantic_segmentation_params"]["min_density"]), "-m", str(config["semantic_segmentation_params"]["min_density"]),
"-z", str(config["semantic_segmentation_params"]["remove_small_tiles"]) "-z", str(config["semantic_segmentation_params"]["remove_small_tiles"])
......
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
############################ parameters ################################################# ############################ parameters #################################################
# General parameters # General parameters
CLEAR_INPUT_FOLDER=1 # 1: clear input folder, 0: not clear input folder CLEAR_INPUT_FOLDER=1 # 1: clear input folder, 0: not clear input folder
CONDA_ENV="pdal-env-1" # conda environment for running the pipeline CONDA_ENV="pdal-env" # conda environment for running the pipeline
# Parameters for the semetnic segmentation # Parameters for the semetnic segmentation
data_folder="" # path to the folder containing the data data_folder="" # path to the folder containing the data
checkpoint_model_path="./fsct/model/model.pth" checkpoint_model_path="./fsct/model/model.pth"
batch_size=5 # batch size for the inference
tile_size=10 # tile size in meters tile_size=10 # tile size in meters
min_density=75 # minimum density of points in a tile(used for removing small tiles) min_density=75 # minimum density of points in a tile(used for removing small tiles)
remove_small_tiles=0 # 1: remove small tiles, 0: not remove small tiles remove_small_tiles=0 # 1: remove small tiles, 0: not remove small tiles
...@@ -17,12 +18,14 @@ remove_small_tiles=0 # 1: remove small tiles, 0: not remove small tiles ...@@ -17,12 +18,14 @@ remove_small_tiles=0 # 1: remove small tiles, 0: not remove small tiles
# extract tiling parameters as command line arguments with the same default values # extract tiling parameters as command line arguments with the same default values
# add remove_small_tiles parameter # add remove_small_tiles parameter
while getopts "d:c:t:m:z:" opt; do while getopts "d:c:b:t:m:z:" opt; do
case $opt in case $opt in
d) data_folder="$OPTARG" d) data_folder="$OPTARG"
;; ;;
c) checkpoint_model_path="$OPTARG" c) checkpoint_model_path="$OPTARG"
;; ;;
b) batch_size="$OPTARG"
;;
t) tile_size="$OPTARG" t) tile_size="$OPTARG"
;; ;;
m) min_density="$OPTARG" m) min_density="$OPTARG"
...@@ -145,7 +148,7 @@ for d in $data_folder/segmented_point_clouds/tiled/*/; do ...@@ -145,7 +148,7 @@ for d in $data_folder/segmented_point_clouds/tiled/*/; do
python sean_sem_seg/run_single_file.py \ python sean_sem_seg/run_single_file.py \
--model $checkpoint_model_path \ --model $checkpoint_model_path \
--point-cloud $f \ --point-cloud $f \
--batch_size 10 \ --batch_size $batch_size \
--odir $d \ --odir $d \
--verbose \ --verbose \
# --tile-index $d/tile_index.dat \ # --tile-index $d/tile_index.dat \
......
...@@ -60,6 +60,20 @@ def run_oracle_wrapper(path_to_config_file): ...@@ -60,6 +60,20 @@ def run_oracle_wrapper(path_to_config_file):
# run the main function # run the main function
main(path_to_config_file) main(path_to_config_file)
# get list of files in the output folder
list_of_files = os.listdir(config_flow_params['general']['output_folder'])
# save files to the output bucket 'bucket_lidar_data' in the subfolder 'output'
for file in list_of_files:
# get the full path of the file
path_to_file = config_flow_params['general']['output_folder'] + '/' + file
# get the file name
file_name = file
# upload the file to the bucket
client.put_object(namespace, bucket_name, 'output/' + file_name, io.open(path_to_file, 'rb'))
if __name__ == '__main__': if __name__ == '__main__':
# use argparse to get the path to the config file # use argparse to get the path to the config file
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment