Add files using upload-large-folder tool
Browse files
extract.sh
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Exit script immediately if any command fails
|
| 4 |
+
set -e
|
| 5 |
+
# Ensure pipeline commands fail if any part fails (important for cat | zstd | tar)
|
| 6 |
+
set -o pipefail
|
| 7 |
+
|
| 8 |
+
# --- Configuration ---
|
| 9 |
+
DEFAULT_TARGET_DIR="/workspace/Pointcept/data/waymo"
|
| 10 |
+
|
| 11 |
+
# Define the pattern for the split training archive parts.
|
| 12 |
+
# Assumes parts are in the current directory where the script is run.
|
| 13 |
+
# Adjust the path if the parts are elsewhere, e.g., /path/to/parts/processed_waymo...
|
| 14 |
+
TRAINING_ARCHIVE_PATTERN="./processed_waymo_training.tar.zst.part.*"
|
| 15 |
+
|
| 16 |
+
# Define the single validation archive file.
|
| 17 |
+
# Assumes the file is in the current directory where the script is run.
|
| 18 |
+
# Adjust the path if the file is elsewhere, e.g., /path/to/file/processed_waymo...
|
| 19 |
+
VALIDATION_ARCHIVE="./processed_waymo_validation.tar.zst"
|
| 20 |
+
|
| 21 |
+
# --- Determine Target Directory ---
|
| 22 |
+
# Use the first command-line argument ($1) if provided, otherwise use the default.
|
| 23 |
+
if [[ -n "$1" ]]; then
|
| 24 |
+
TARGET_DIR="$1"
|
| 25 |
+
echo "Using custom target directory provided: $TARGET_DIR"
|
| 26 |
+
else
|
| 27 |
+
TARGET_DIR="$DEFAULT_TARGET_DIR"
|
| 28 |
+
echo "No custom target directory provided. Using default: $TARGET_DIR"
|
| 29 |
+
fi
|
| 30 |
+
echo # Blank line for spacing
|
| 31 |
+
|
| 32 |
+
# --- Script Start ---
|
| 33 |
+
echo "--- Waymo Data Extraction Script ---"
|
| 34 |
+
START_TIME=$SECONDS
|
| 35 |
+
|
| 36 |
+
# --- Check and Create Target Directory ---
|
| 37 |
+
echo "Ensuring target directory exists: $TARGET_DIR"
|
| 38 |
+
if [ ! -d "$TARGET_DIR" ]; then
|
| 39 |
+
echo "Target directory does not exist. Creating..."
|
| 40 |
+
# Create the directory, including any necessary parent directories (-p)
|
| 41 |
+
mkdir -p "$TARGET_DIR"
|
| 42 |
+
echo "Created directory: $TARGET_DIR"
|
| 43 |
+
else
|
| 44 |
+
echo "Target directory already exists."
|
| 45 |
+
fi
|
| 46 |
+
echo # Blank line for spacing
|
| 47 |
+
|
| 48 |
+
# --- Extract Training Archive (Split) ---
|
| 49 |
+
echo "Starting extraction of TRAINING archive..."
|
| 50 |
+
echo "Source pattern: $TRAINING_ARCHIVE_PATTERN"
|
| 51 |
+
echo "This may take a while..."
|
| 52 |
+
|
| 53 |
+
# Check if any training parts exist before attempting cat
|
| 54 |
+
if ! ls $TRAINING_ARCHIVE_PATTERN > /dev/null 2>&1; then
|
| 55 |
+
echo "ERROR: No files found matching training archive pattern: $TRAINING_ARCHIVE_PATTERN"
|
| 56 |
+
exit 1
|
| 57 |
+
fi
|
| 58 |
+
|
| 59 |
+
# 1. Concatenate the parts using cat
|
| 60 |
+
# 2. Pipe the combined stream to zstd for decompression (-d = decompress, -c = to stdout)
|
| 61 |
+
# 3. Pipe the decompressed tar stream to tar for extraction
|
| 62 |
+
# -x = extract
|
| 63 |
+
# -v = verbose (shows files being extracted)
|
| 64 |
+
# -f - = read archive from stdin (the pipe)
|
| 65 |
+
# -C "$TARGET_DIR" = change directory to TARGET_DIR before extracting
|
| 66 |
+
cat $TRAINING_ARCHIVE_PATTERN | zstd -dc - | tar -xvf - -C "$TARGET_DIR"
|
| 67 |
+
|
| 68 |
+
echo "Training archive extraction complete."
|
| 69 |
+
echo # Blank line for spacing
|
| 70 |
+
|
| 71 |
+
# --- Extract Validation Archive (Single File) ---
|
| 72 |
+
echo "Starting extraction of VALIDATION archive..."
|
| 73 |
+
echo "Source file: $VALIDATION_ARCHIVE"
|
| 74 |
+
echo "This may take a while..."
|
| 75 |
+
|
| 76 |
+
# Check if validation archive exists
|
| 77 |
+
if [ ! -f "$VALIDATION_ARCHIVE" ]; then
|
| 78 |
+
echo "ERROR: Validation archive file not found: $VALIDATION_ARCHIVE"
|
| 79 |
+
exit 1
|
| 80 |
+
fi
|
| 81 |
+
|
| 82 |
+
# 1. Decompress the file with zstd (-d = decompress, -c = to stdout)
|
| 83 |
+
# 2. Pipe the decompressed tar stream to tar for extraction (same flags as above)
|
| 84 |
+
zstd -dc "$VALIDATION_ARCHIVE" | tar -xvf - -C "$TARGET_DIR"
|
| 85 |
+
|
| 86 |
+
echo "Validation archive extraction complete."
|
| 87 |
+
echo # Blank line for spacing
|
| 88 |
+
|
| 89 |
+
# --- Stats and Summary ---
|
| 90 |
+
END_TIME=$SECONDS
|
| 91 |
+
DURATION=$((END_TIME - START_TIME))
|
| 92 |
+
|
| 93 |
+
echo "--- Extraction Summary ---"
|
| 94 |
+
echo "Extraction process finished successfully."
|
| 95 |
+
echo "Total time taken: $DURATION seconds."
|
| 96 |
+
echo "Data extracted to: $TARGET_DIR"
|
| 97 |
+
|
| 98 |
+
# Show the top-level directories created inside the target directory
|
| 99 |
+
echo "Contents of target directory ($TARGET_DIR):"
|
| 100 |
+
ls -l "$TARGET_DIR"
|
| 101 |
+
|
| 102 |
+
echo "--------------------------"
|
| 103 |
+
|
| 104 |
+
exit 0
|
processed_waymo_training.tar.zst.part.01
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9f03ae73f26703307096ba13aa6abf33ec5498c8925d7ad2f915e0969001269a
|
| 3 |
+
size 9663676416
|
processed_waymo_training.tar.zst.part.02
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d86a8d2b41f64320528be6b563a896391b04d8fd05446bc0cca63f867cf4b200
|
| 3 |
+
size 9663676416
|
processed_waymo_training.tar.zst.part.03
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2d4eb09a4505168bfef86ceb8cf48d5a52f4196a03f225b5a30a332cc1680da
|
| 3 |
+
size 9663676416
|
processed_waymo_training.tar.zst.part.04
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2fdfe1d2c615f2328862a4c8b80a5bf6fdf73415750d07e10a33d4ee834999c0
|
| 3 |
+
size 8898576876
|
processed_waymo_validation.tar.zst
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:532b2231fc7116adcec1871a9226b1ff618cef5375486dfe9d58b13bbffc0ac4
|
| 3 |
+
size 9620067282
|