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

update sematic seg. sean with switch off flag for removal of small tiles

parent ec2ee7aa
No related branches found
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/*
cp /home/nibio/mutable-outside-world/data/corrected/test/*.las $TARGET_FOLDER
...@@ -7,14 +7,19 @@ CONDA_ENV="pdal-env-1" # conda environment for running the pipeline ...@@ -7,14 +7,19 @@ CONDA_ENV="pdal-env-1" # conda environment for running the pipeline
# Tiling parameters # Tiling parameters
data_folder="" # path to the folder containing the data data_folder="" # path to the folder containing the data
remove_small_tiles=0 # 1: remove small tiles, 0: not remove small tiles
############################# end of parameters declaration ############################ ############################# end of parameters declaration ############################
# extract tiling parameters as command line arguments with the same default values # extract tiling parameters as command line arguments with the same default values
while getopts "d:" opt; do
# add remove_small_tiles parameter
while getopts "d:z:" opt; do
case $opt in case $opt in
d) data_folder="$OPTARG" d) data_folder="$OPTARG"
;; ;;
z) remove_small_tiles="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2 \?) echo "Invalid option -$OPTARG" >&2
;; ;;
esac esac
...@@ -27,6 +32,7 @@ echo "d: data_folder" ...@@ -27,6 +32,7 @@ echo "d: data_folder"
# print values of the parameters # print values of the parameters
echo " The values of the parameters:" echo " The values of the parameters:"
echo "data_folder: $data_folder" echo "data_folder: $data_folder"
echo "remove_small_tiles: $remove_small_tiles"
# Do the environment setup # Do the environment setup
# check if PYTHONPATH is set to the current directory # check if PYTHONPATH is set to the current directory
...@@ -108,14 +114,20 @@ python nibio_preprocessing/tiling.py \ ...@@ -108,14 +114,20 @@ python nibio_preprocessing/tiling.py \
--tile_size 10 --tile_size 10
# remove small tiles using nibio_preprocessing/remove_small_tiles.py # remove small tiles using nibio_preprocessing/remove_small_tiles.py
for d in $data_folder/segmented_point_clouds/tiled/*; do
echo "Removing small tiles from $d" # make it conditional bassed remove_small_tiles parameter
python nibio_preprocessing/remove_small_tiles.py \ if [ $remove_small_tiles -eq 1 ]
--dir $d \ then
--tile_index $d/tile_index.dat \ # iterate over all the directories in the tiled folder
--min_density 75 \ for d in $data_folder/segmented_point_clouds/tiled/*; do
--verbose echo "Removing small tiles from $d"
done python nibio_preprocessing/remove_small_tiles.py \
--dir $d \
--tile_index $d/tile_index.dat \
--min_density 75 \
--verbose
done
fi
# iterate over all the directories in the tiled folder # iterate over all the directories in the tiled folder
for d in $data_folder/segmented_point_clouds/tiled/*/; do for d in $data_folder/segmented_point_clouds/tiled/*/; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment