From 9d81d0d82633526a6e966b11fa79ea31c0c44e78 Mon Sep 17 00:00:00 2001 From: Maciej Wielgosz <maciej.wielgosz@nibio.no> Date: Thu, 26 Jan 2023 15:02:38 +0100 Subject: [PATCH] update for oracle instane segmentation --- config/config.yaml | 2 +- run_oracle_wrapper.py | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 2184575..22812fd 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -3,7 +3,7 @@ general: output_folder: './maciek_results' clean_output_folder: true run_sematic_segmentation: true - run_instance_segmentation: false + run_instance_segmentation: true label_formats: label_for_instances_in_gt: 'treeID' label_for_instances_in_predicted: 'instance_nr' diff --git a/run_oracle_wrapper.py b/run_oracle_wrapper.py index 418709a..550aabf 100644 --- a/run_oracle_wrapper.py +++ b/run_oracle_wrapper.py @@ -102,19 +102,30 @@ def run_oracle_wrapper(path_to_config_file): # run the main function main(path_to_config_file) + # instance segmentation is set to true + if config_flow_params['general']['run_instance_segmentation']: + path_to_the_output_folder = os.path.join(config_flow_params['general']['output_folder'], 'instance_segmented_point_clouds') + else: + path_to_the_output_folder = config_flow_params['general']['output_folder'] + # get list of files in the output folder - list_of_files = os.listdir(config_flow_params['general']['output_folder']) + list_of_files = os.listdir(path_to_the_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 + path_to_file = path_to_the_output_folder + '/' + file # get the file name file_name = file # upload the file to the bucket - client.put_object(output_namespace, output_bucket_name, os.path.join(output_folder_in_bucket, file_name), io.open(path_to_file, 'rb')) + client.put_object( + output_namespace, + output_bucket_name, + os.path.join(output_folder_in_bucket, file_name), + io.open(path_to_file, 'rb') + ) if __name__ == '__main__': # use argparse to get the path to the config file -- GitLab