Skip to content

Add scripts to package data in tar files for each scene #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/bin/tar_derived_data
Original file line number Diff line number Diff line change
@@ -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



11 changes: 11 additions & 0 deletions scripts/bin/tar_raw_log
Original file line number Diff line number Diff line change
@@ -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



13 changes: 13 additions & 0 deletions scripts/cleanAllSceneFolders.py
Original file line number Diff line number Diff line change
@@ -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")
10 changes: 4 additions & 6 deletions scripts/prepareForObjectAlignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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?
Expand Down Expand Up @@ -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")
17 changes: 17 additions & 0 deletions scripts/tarAllSceneFolders.py
Original file line number Diff line number Diff line change
@@ -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