diff --git a/scripts/bin/tar_derived_data b/scripts/bin/tar_derived_data new file mode 100755 index 0000000..f0c9e4f --- /dev/null +++ b/scripts/bin/tar_derived_data @@ -0,0 +1,11 @@ +#!/bin/bash + +scene_dir=${PWD##*/} +echo "Creating a tar.gz for only the derived data of this scene " $scene_dir + +cd .. +tar --exclude='*resized_images*' --exclude='*log*' -zcvf "$scene_dir"-labeled.tar.gz $scene_dir +cd $scene_dir + + + diff --git a/scripts/bin/tar_raw_log b/scripts/bin/tar_raw_log new file mode 100755 index 0000000..f4b6e8a --- /dev/null +++ b/scripts/bin/tar_raw_log @@ -0,0 +1,11 @@ +#!/bin/bash + +scene_dir=${PWD##*/} +echo "Creating a tar.gz for only the raw logs (both trimmed and untrimmed) of this scene " $scene_dir + +cd .. +tar -zcvf "$scene_dir"-log.tar.gz $scene_dir/*log* +cd $scene_dir + + + diff --git a/scripts/cleanAllSceneFolders.py b/scripts/cleanAllSceneFolders.py new file mode 100644 index 0000000..db6c150 --- /dev/null +++ b/scripts/cleanAllSceneFolders.py @@ -0,0 +1,13 @@ +# +# Usage: python /path/to/cleanAllSceneFolders.py +# +# Iterates (non-recursively) over all scene folders and does +# a couple cleaning operations. + +import os + +for item in os.listdir(os.getcwd()): + if os.path.isdir(os.path.join(os.getcwd(), item)): + print item + os.system("cd " + os.path.join(os.getcwd(),item) + " && ls") + os.system("cd " + os.path.join(os.getcwd(),item) + " && rm -f *.jlp *.freiburg && find . -name *lcmlog.ply | xargs -I '{}' mv {} binary.ply") diff --git a/scripts/prepareForObjectAlignment.py b/scripts/prepareForObjectAlignment.py index c2dc6ec..326428a 100644 --- a/scripts/prepareForObjectAlignment.py +++ b/scripts/prepareForObjectAlignment.py @@ -18,15 +18,11 @@ # Run Elastic Fusion # ###################### -# later, I want to try automatically install ElasticFusion -# or at least check for it -# for now, just need to specify ElasticFusion executable location path_to_ElasticFusion_executable = os.environ['ELASTIC_FUSION_EXECUTABLE'] if not (os.path.isfile(path_to_ElasticFusion_executable)): print "You need to install ElasticFusion and set the path to the executable in setup_environment.sh" quit() - path = os.getcwd() yaml_path = path + "/info.yaml" f = open(yaml_path) @@ -52,9 +48,11 @@ os.system("cd " + path_to_ply + " && make") ply_binary_filename = lcmlog_filename + ".ply" +desired_binary_filename = "binary.ply" +os.system("mv " + ply_binary_filename + " " + desired_binary_filename) # call ply2ascii -os.system(path_to_ply + "/ply2ascii <./" + ply_binary_filename + "> ./converted_to_ascii.ply") +os.system(path_to_ply + "/ply2ascii <./" + desired_binary_filename + "> ./converted_to_ascii.ply") # change header to be compatible with Director # TODO: make so Director accepts other header? @@ -88,5 +86,5 @@ os.system("directorPython " + path_to_labelfusion + "/scripts/convertPlyToVtp.py " + "./converted_to_ascii_modified_header.ply") # clean up and rename -# os.system("rm *.ply *.freiburg") +os.system("rm *.freiburg *.jlp") os.system("mv converted_to_ascii_modified_header.vtp reconstructed_pointcloud.vtp") diff --git a/scripts/tarAllSceneFolders.py b/scripts/tarAllSceneFolders.py new file mode 100644 index 0000000..5b329ab --- /dev/null +++ b/scripts/tarAllSceneFolders.py @@ -0,0 +1,17 @@ +# +# Usage: python /path/to/tarAllSceneFolders.py +# +# Iterates (non-recursively) over all scene folders and packages +# them into .tar.gz compressed files + +import os + +for item in sorted(os.listdir(os.getcwd())): + if os.path.isdir(os.path.join(os.getcwd(), item)): + print item + try: + os.system("cd " + os.path.join(os.getcwd(),item) + " && ls") + os.system("cd " + os.path.join(os.getcwd(),item) + " && tar_derived_data") + #os.system("cd " + os.path.join(os.getcwd(),item) + " && tar_raw_log") + except (KeyboardInterrupt, SystemExit): + raise