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

small updates in metrics and helper functions

parent 6e4c3e0e
No related branches found
No related tags found
No related merge requests found
SOURCE_FOLDER=/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground
rm -rf $SOURCE_FOLDER/*
TARGET_FOLDER=/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/maciek
rm -rf $TARGET_FOLDER/*
cp /home/nibio/mutable-outside-world/data/small_file_pipeline_test/small_file_pipeline_test.las \
/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground
cp /home/nibio/mutable-outside-world/data/small_file_pipeline_test/small_file_pipeline_test.las $TARGET_FOLDER
# change name of the file to first.laz
mv /home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground/small_file_pipeline_test.las \
/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground/first.las
mv $TARGET_FOLDER/small_file_pipeline_test.las $TARGET_FOLDER/first.las
# copy first.laz to second.laz
cp /home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground/first.las \
/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground/second.las
\ No newline at end of file
# make a copy of the file
cp $TARGET_FOLDER/first.las $TARGET_FOLDER/second.las
# # make a copy of the file
# cp $TARGET_FOLDER/first.las $TARGET_FOLDER/third.las
# # make a copy of the file
# cp $TARGET_FOLDER/first.las $TARGET_FOLDER/fourth.las
\ No newline at end of file
#!/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/terestial_data_for_training_sem_seg_model/validation/*.las $TARGET_FOLDER
......@@ -7,14 +7,10 @@ class InstanceSegmentationMetricsInFolder():
self,
gt_las_folder_path,
target_las_folder_path,
gt_label_name='gt_label', #TODO: implement the same as in the instance_segmentation_metrics.py
target_label_name='target_label', #TODO: implement the same as in the instance_segmentation_metrics.py
verbose=False
):
self.gt_las_folder_path = gt_las_folder_path
self.target_las_folder_path = target_las_folder_path
self.gt_label_name = gt_label_name
self.target_label_name = target_label_name
self.verbose = verbose
def main(self):
......@@ -80,8 +76,6 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--gt_las_folder_path', type=str, required=True)
parser.add_argument('--target_las_folder_path', type=str, required=True)
parser.add_argument('--gt_label_name', type=str, default='gt_label')
parser.add_argument('--target_label_name', type=str, default='target_label')
parser.add_argument('--verbose', action='store_true', help="Print information about the process")
args = parser.parse_args()
......@@ -89,8 +83,6 @@ if __name__ == '__main__':
instance_segmentation_metrics_in_folder = InstanceSegmentationMetricsInFolder(
args.gt_las_folder_path,
args.target_las_folder_path,
gt_label_name=args.gt_label_name,
target_label_name=args.target_label_name,
verbose=args.verbose
)
......
import argparse
from joblib import Parallel, delayed
import pdal
import os, glob
import json
......@@ -84,8 +85,7 @@ class Tiling:
files = glob.glob(self.input_folder + "/*.ply")
# loop through all the files
for file in tqdm(files):
self.do_tiling_of_single_file(file)
Parallel(n_jobs=(os.cpu_count() - 2))(delayed(self.do_tiling_of_single_file)(file) for file in tqdm(files))
def convert_single_file_from_las_to_ply(self, file):
"""
......
......@@ -92,8 +92,6 @@ def main():
metric = InstanceSegmentationMetricsInFolder(
gt_las_folder_path = '/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground/results/input_data',
target_las_folder_path = '/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground/results/instance_segmented_point_clouds_with_ground',
gt_label_name='treeID',
target_label_name='treeID',
verbose=True
)
......
......@@ -161,7 +161,7 @@ for d in $data_folder/segmented_point_clouds/tiled/*/; do
python fsct/run.py \
--model /home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/fsct/model/model.pth \
--point-cloud $f \
--batch_size 5 \
--batch_size 10 \
--odir $d \
--verbose \
# --tile-index $d/tile_index.dat \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment