forked from spla-tam/SplaTAM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnerfcapture.bash
More file actions
57 lines (46 loc) · 1.61 KB
/
Copy pathnerfcapture.bash
File metadata and controls
57 lines (46 loc) · 1.61 KB
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
#!/bin/bash
# check rmem_max and wmem_max, and increase size if necessary
if [ "$#" -ne 2 ]; then
echo "Usage: bash_scripts/nerfcapture.bash <config_file> <input_dataset>"
exit
fi
if [ ! -f $1 ]; then
echo "Config file not found!"
exit
fi
if sysctl -a | grep -q "net.core.rmem_max = 2147483647"; then
echo "rmem_max already set to 2147483647"
else
echo "Setting rmem_max to 2147483647"
sysctl -w net.core.rmem_max=2147483647
fi
if sysctl -a | grep -q "net.core.wmem_max = 2147483647"; then
echo "wmem_max already set to 2147483647"
else
echo "Setting wmem_max to 2147483647"
sysctl -w net.core.wmem_max=2147483647
fi
base_dir=$(dirname $2)
scene="$(basename $2)_nerfcapture"
echo $base_dir $scene
# Convert Spectacular AI dataset to NeRF Capture.
echo "Exporting dataset to NeRF Capture format..."
python3 spectacularAI-sdk/python/mapping/replay_to_nerf.py $2 \
--format=nerfcapture --fast \
--image_format=png \
--device_preset=ios-tof \
--key_frame_distance=0.0001 \
$base_dir/$scene
frames=$(ls -l ${base_dir}/${scene}/rgb | wc -l)
if [ -z $frames ] || [ $frames -eq 0 ]; then
echo "ERROR: Not enough frames at $base_dir/$scene/rgb!"
exit
fi
echo "Building SplaTAM expected directories..."
python3 scripts/nerfcapture2dataset.py --config $1 --base_dir $base_dir --scene $scene --frames $frames
# Run SplaTAM
echo "Running SplaTAM..."
python3 scripts/splatam.py $1 --base_dir $base_dir --scene $scene --frames $frames
# Visualize SplaTAM Output
echo "Running visualizer..."
python3 viz_scripts/final_recon.py $1 --base_dir $base_dir --scene $scene --frames $frames