diff --git a/bash_helper_scripts/get_austrian_after_sem_seg.sh b/bash_helper_scripts/get_austrian_after_sem_seg.sh new file mode 100755 index 0000000000000000000000000000000000000000..2c7f4b7a0395881508fcf8aa733a8d7eecf4b0ff --- /dev/null +++ b/bash_helper_scripts/get_austrian_after_sem_seg.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +TARGET_FOLDER=/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/maciek_optimized +# clean the folder +rm -rf $TARGET_FOLDER/* + +cp -r /home/nibio/mutable-outside-world/data/austrian_data_after_seg/* $TARGET_FOLDER + diff --git a/bash_helper_scripts/get_austrian_after_sem_seg_sean.sh b/bash_helper_scripts/get_austrian_after_sem_seg_sean.sh new file mode 100755 index 0000000000000000000000000000000000000000..d581635befa02af19ea040064f5787bd4b1bcd1d --- /dev/null +++ b/bash_helper_scripts/get_austrian_after_sem_seg_sean.sh @@ -0,0 +1,8 @@ +#!/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 -r /home/nibio/mutable-outside-world/data/austrian_data_after_seg_sean/* $TARGET_FOLDER + diff --git a/bash_helper_scripts/get_small_data_for_playground.sh b/bash_helper_scripts/get_small_data_for_playground.sh index 3e096fb1a845bd2a80de14bade678c0e873668c7..a0c5e0f2b06007b807018a42cf8a9201507e01eb 100755 --- a/bash_helper_scripts/get_small_data_for_playground.sh +++ b/bash_helper_scripts/get_small_data_for_playground.sh @@ -6,7 +6,7 @@ cp /home/nibio/mutable-outside-world/data/small_file_pipeline_test/small_file_pi # change name of the file to first.laz mv $TARGET_FOLDER/small_file_pipeline_test.las $TARGET_FOLDER/first.las -# # make a copy of the file +# make a copy of the file # cp $TARGET_FOLDER/first.las $TARGET_FOLDER/second.las # # make a copy of the file diff --git a/helpers/how_many_points_in_class.py b/helpers/how_many_points_in_class.py new file mode 100644 index 0000000000000000000000000000000000000000..d9b1e84d70a9fd60801333017a6e4688eb7b0443 --- /dev/null +++ b/helpers/how_many_points_in_class.py @@ -0,0 +1,51 @@ +import os +from collections import Counter +import laspy + + +def main (folder_path): + # Define the path to the folder containing the LAS files + # folder_path = "/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground" + + # Define the class codes you want to count + class_codes = [0, 1, 2, 3, 4] + + # Define a dictionary to hold the counts for each class + class_counts = {class_code: 0 for class_code in class_codes} + + # Iterate through the files in the folder + for file_name in os.listdir(folder_path): + if file_name.endswith(".las"): + # Open the LAS file using laspy + las_file = laspy.read(os.path.join(folder_path, file_name)) + + # Count the points in each class and update the class_counts dictionary + point_classes = Counter(las_file.label) + for class_code in class_codes: + class_counts[class_code] += point_classes[class_code] + + # Define the names of the classes + names = ["ignore", "terrain", "vegetation", "CWD ", "stem"] + + # Print the class counts + print("Class counts:") + for class_code in class_codes: + print(f"Class {names[class_code]}: {class_counts[class_code]}") + + # print it in percentages + print("Class counts in percentages:") + for class_code in class_codes: + print(f"Class {names[class_code]}: {class_counts[class_code] / sum(class_counts.values()) * 100:.2f} %") + + +if __name__ == "__main__": + # use argparse to parse the command line arguments + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--folder_path", help="Path to the folder containing the LAS files") + + args = parser.parse_args() + + main(args.folder_path) + + diff --git a/optimization_pipeline/tls.sh b/optimization_pipeline/tls.sh index 2e3a19a031dc8cc54051261c80875524b2045e3d..9f76038b7a1759d0301abd1c1e758c875813126c 100755 --- a/optimization_pipeline/tls.sh +++ b/optimization_pipeline/tls.sh @@ -3,7 +3,7 @@ ############################ parameters ################################################# # General parameters CLEAR_INPUT_FOLDER=1 # 1: clear input folder, 0: not clear input folder -CONDA_ENV="pdal-env" # conda environment for running the pipeline +CONDA_ENV="pdal-env-1" # conda environment for running the pipeline # Tiling parameters data_folder="" # path to the folder containing the data diff --git a/run_bash_scripts/tls.sh b/run_bash_scripts/tls.sh index 2e3a19a031dc8cc54051261c80875524b2045e3d..9f76038b7a1759d0301abd1c1e758c875813126c 100755 --- a/run_bash_scripts/tls.sh +++ b/run_bash_scripts/tls.sh @@ -3,7 +3,7 @@ ############################ parameters ################################################# # General parameters CLEAR_INPUT_FOLDER=1 # 1: clear input folder, 0: not clear input folder -CONDA_ENV="pdal-env" # conda environment for running the pipeline +CONDA_ENV="pdal-env-1" # conda environment for running the pipeline # Tiling parameters data_folder="" # path to the folder containing the data