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

update for prod oracle folder mapping -> to be tested on the oracle

parent 81ce9019
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,10 @@ COPY . /app ...@@ -41,7 +41,10 @@ COPY . /app
WORKDIR /app WORKDIR /app
ENTRYPOINT ["/miniconda/bin/conda", "run", "-n", "pdal-env", "python", "/app/run_oracle_wrapper.py"] # ENTRYPOINT ["/miniconda/bin/conda", "run", "-n", "pdal-env", "python", "/app/run_oracle_wrapper.py"]
ENTRYPOINT ["/miniconda/bin/conda", "run", "-n", "pdal-env", "python", "/app/run_oracle_wrapper_local.py"]
Dockerfile - set correct oracle wrapper
build.sh
run_oracle_wrapper.py or run_oracle_wrapper_local.py -> set paths
config.yaml -> pick segmentation or instance segmentation
\ No newline at end of file
...@@ -3,7 +3,7 @@ general: ...@@ -3,7 +3,7 @@ general:
output_folder: 'local_output_folder' output_folder: 'local_output_folder'
clean_output_folder: false clean_output_folder: false
run_sematic_segmentation: true run_sematic_segmentation: true
run_instance_segmentation: true run_instance_segmentation: false
label_formats: label_formats:
label_for_instances_in_gt: 'treeID' label_for_instances_in_gt: 'treeID'
label_for_instances_in_predicted: 'instance_nr' label_for_instances_in_predicted: 'instance_nr'
......
...@@ -4,6 +4,10 @@ docker image rm nibio/pc-geoslam-oracle ...@@ -4,6 +4,10 @@ docker image rm nibio/pc-geoslam-oracle
./build.sh ./build.sh
echo "Running the container" echo "Running the container"
# docker run --gpus all --name test_oracle nibio/pc-geoslam-oracle # docker run --gpus all --name test_oracle nibio/pc-geoslam-oracle
docker run -it --gpus all --name test_oracle nibio/pc-geoslam-oracle docker run -it --gpus all \
--name test_oracle \
--mount type=bind,source=/home/nibio/mutable-outside-world/code/oracle_deploy/instance_segmentation_classic/local_folder_out/las_files,target=/app/local_folder_out/las_files \
nibio/pc-geoslam-oracle
# This is the the file to be run on the oracle cloud
import oci
import argparse
import os
import io
import shutil
import yaml
from run import main
def run_oracle_wrapper(path_to_config_file):
# read the config file from config folder
with open(path_to_config_file) as f:
config_flow_params = yaml.load(f, Loader=yaml.FullLoader)
# read system environment variables
# input_location = os.environ['OBJ_INPUT_LOCATION']
# output_location = os.environ['OBJ_OUTPUT_LOCATION']
# remap the input and output locations
# input_location = input_location.replace("@axqlz2potslu", "").replace("oci://", "/mnt/")
# output_location = output_location.replace("@axqlz2potslu", "").replace("oci://", "/mnt/")
input_location = "local_folder_in/las_files/"
output_location = "local_folder_out/las_files/"
# copy files from input_location to the input folder
shutil.copytree(input_location, config_flow_params['general']['input_folder'])
# 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_with_ground')
else:
path_to_the_output_folder = config_flow_params['general']['output_folder']
# zip the files in path_to_the_output_folder
zip_file_name = 'results'
shutil.make_archive(zip_file_name, 'zip', path_to_the_output_folder) # this will be done in the current folder
shutil.copy('results.zip', path_to_the_output_folder)
# copy the zip file and other files to the output location
for filename in os.listdir(path_to_the_output_folder):
src_file = os.path.join(path_to_the_output_folder, filename)
dst_file = os.path.join(output_location, filename)
shutil.copy(src_file, dst_file)
if __name__ == '__main__':
# use argparse to get the path to the config file
parser = argparse.ArgumentParser()
parser.add_argument("--path_to_config_file", type=str, default="./config/config.yaml")
args = parser.parse_args()
# run the main function
print('Running the main function in run_oracle_wrapper.py')
run_oracle_wrapper(args.path_to_config_file)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment