-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess_all_ninja_files.sh
executable file
·58 lines (44 loc) · 2.06 KB
/
process_all_ninja_files.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
set -e # Exit on any error
NINJA_DIR="/Users/shahanneda/Documents/projects/rust-gs/splats/ninja"
LOCAL_RS_PATH="/Users/shahanneda/Documents/projects/rust-gs/src/local/local.rs"
# Files to process - excluding files we've already processed or created
FILES=(
"apple_rotate.ply"
"bread.ply"
"cake.ply"
"orange.ply"
"watermelon.ply"
)
# Ensure conda is initialized for this script
eval "$(conda shell.bash hook)"
conda activate cs486
# Process each file
for file in "${FILES[@]}"; do
echo "===================================================="
echo "Processing $file"
echo "===================================================="
# Get base filename without extension
base_name="${file%.*}"
# Step 1: Create simplified version with increased scale
echo "Step 1: Creating simplified version with increased scale"
python -u prune.py "$NINJA_DIR/$file" --output_file "$NINJA_DIR/${base_name}_fuller.ply" --method random_scaled --sample_ratio 0.2 --scale_factor 1.5
# Step 2: Create extra full version with even larger scale
echo "Step 2: Creating extra full version with larger scale"
python -u prune.py "$NINJA_DIR/$file" --output_file "$NINJA_DIR/${base_name}_extra_full.ply" --method random_scaled --sample_ratio 0.2 --scale_factor 2.0
# Step 3: Update local.rs to process the regular simplified version
echo "Step 3: Creating RKYV file for _fuller version"
sed -i '' "s|let scene_name = \".*\";|let scene_name = \"ninja/${base_name}_fuller\";|" "$LOCAL_RS_PATH"
# Run buildLocal.sh
echo "Running buildLocal.sh for _fuller version"
./buildLocal.sh
# Step 4: Update local.rs to process the extra full version
echo "Step 4: Creating RKYV file for _extra_full version"
sed -i '' "s|let scene_name = \".*\";|let scene_name = \"ninja/${base_name}_extra_full\";|" "$LOCAL_RS_PATH"
# Run buildLocal.sh
echo "Running buildLocal.sh for _extra_full version"
./buildLocal.sh
echo "Completed processing $file"
echo ""
done
echo "All files processed!"