From 6ce5fff0c436a74a60a6c5265f2aa13a5d9663bc Mon Sep 17 00:00:00 2001
From: Maciej Wielgosz <maciej.wielgosz@nibio.no>
Date: Tue, 17 Jan 2023 12:37:24 +0100
Subject: [PATCH] cleaning before production v0

---
 .gitignore                                    |  3 +-
 bash_helper_scripts/are_files_identical.sh    |  7 +++++
 .../run_all_command_line.sh                   |  0
 .../run_all_fine_grained.sh                   |  2 +-
 config/config.yaml                            | 11 +++++--
 test_run.sh                                   | 30 -------------------
 6 files changed, 19 insertions(+), 34 deletions(-)
 create mode 100755 bash_helper_scripts/are_files_identical.sh
 rename run_all_command_line.sh => bash_helper_scripts/run_all_command_line.sh (100%)
 rename run_all_fine_grained.sh => bash_helper_scripts/run_all_fine_grained.sh (99%)
 delete mode 100755 test_run.sh

diff --git a/.gitignore b/.gitignore
index 9e04dff..e68d29e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,4 +15,5 @@ wandb/
 sample_data/segmented_point_clouds/*
 *.dat
 *.json
-*.png
\ No newline at end of file
+*.png
+*.txt
\ No newline at end of file
diff --git a/bash_helper_scripts/are_files_identical.sh b/bash_helper_scripts/are_files_identical.sh
new file mode 100755
index 0000000..33fa992
--- /dev/null
+++ b/bash_helper_scripts/are_files_identical.sh
@@ -0,0 +1,7 @@
+
+
+./bash_helper_scripts/get_austrian_sample_instance_p2.sh
+pdal translate maciek/p2_instance.las maciek/p2_instance.ply
+python fsct/run.py --model /home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/fsct/model/model.pth --point-cloud maciek/p2_instance.ply --batch_size 10 --odir maciek/ --verbose --keep-npy
+
+python helpers/compare_files_in_folders.py --folder1 maciek/p2_instance.tmp --folder2 old_maciek/p2_instance.tmp --verbose
\ No newline at end of file
diff --git a/run_all_command_line.sh b/bash_helper_scripts/run_all_command_line.sh
similarity index 100%
rename from run_all_command_line.sh
rename to bash_helper_scripts/run_all_command_line.sh
diff --git a/run_all_fine_grained.sh b/bash_helper_scripts/run_all_fine_grained.sh
similarity index 99%
rename from run_all_fine_grained.sh
rename to bash_helper_scripts/run_all_fine_grained.sh
index 446ab41..76b095e 100755
--- a/run_all_fine_grained.sh
+++ b/bash_helper_scripts/run_all_fine_grained.sh
@@ -111,7 +111,7 @@ for d in $data_folder/segmented_point_clouds/tiled/*/; do
     for f in $d/*.ply; do
         echo "Processing $f file..."
         python fsct/run.py \
-        --model /home/nibio/mutable-outside-world/code/instance_segmentation_classic/fsct/model/model.pth \
+        --model /home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/fsct/model/model.pth \
         --point-cloud $f \
         --batch_size 5 \
         --odir $d \
diff --git a/config/config.yaml b/config/config.yaml
index 3175bce..815cf88 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -1,3 +1,10 @@
-files_formats:
+general:
+  input_folder: 'some_path'
+  output_folder: 'some_path'
+  run_sematic_segmentation: true
+  run_instance_segmentation: false
+label_formats:
   label_for_instances_in_gt: 'treeID'
-  label_for_instances_in_predicted:  
+  label_for_instances_in_predicted: 'instance_nr'
+semantic_segmentation_params:
+  first: 'some'
diff --git a/test_run.sh b/test_run.sh
deleted file mode 100755
index 7a04086..0000000
--- a/test_run.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-# run run_all_command_lines.sh with the following arguments:
-
-data_folder="/home/nibio/mutable-outside-world/code/gitlab_fsct/instance_segmentation_classic/sample_playground" 
-N_TILES=3
-
-SLICE_THICKNESS=0.382368454442735
-FIND_STEMS_HEIGHT=1.8948172056774
-FIND_STEMS_THICKNESS=0.9980435744231868
-GRAPH_MAXIMUM_CUMULATIVE_GAP=13.841583930676254
-ADD_LEAVES_VOXEL_LENGTH=0.19332721135500391
-FIND_STEMS_MIN_POINTS=495
-GRAPH_EDGE_LENGTH=0.5652008887940575
-ADD_LEAVES_EDGE_LENGTH=0.5622733957401558
-
-# get test data from the following link:
-bash ./bash_helper_scripts/get_terrestial_sem_seg_test.sh
-
-# run run_all_command_lines.sh with the following arguments:
-./run_all_command_line.sh -d $data_folder \
--n $N_TILES \
--s $SLICE_THICKNESS \
--h $FIND_STEMS_HEIGHT \
--t $FIND_STEMS_THICKNESS \
--g $GRAPH_MAXIMUM_CUMULATIVE_GAP \
--l $ADD_LEAVES_VOXEL_LENGTH \
--m $FIND_STEMS_MIN_POINTS \
--o $GRAPH_EDGE_LENGTH \
--p $ADD_LEAVES_EDGE_LENGTH
\ No newline at end of file
-- 
GitLab