Skip to content

Commit 909f287

Browse files
Update visualizer script.
1 parent 0655ee5 commit 909f287

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

bash_scripts/nerfcapture.bash

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ scene="$(basename $2)_nerfcapture"
3030
echo $base_dir $scene
3131

3232
# Convert Spectacular AI dataset to NeRF Capture.
33+
echo "Exporting dataset to NeRF Capture format..."
3334
python3 spectacularAI-sdk/python/mapping/replay_to_nerf.py $2 \
3435
--format=nerfcapture --fast \
3536
--image_format=png \
@@ -39,16 +40,18 @@ python3 spectacularAI-sdk/python/mapping/replay_to_nerf.py $2 \
3940

4041
frames=$(ls -l ${base_dir}/${scene}/rgb | wc -l)
4142
if [ -z $frames ] || [ $frames -eq 0 ]; then
42-
echo "Not enough frames at $base_dir/$scene/rgb!"
43+
echo "ERROR: Not enough frames at $base_dir/$scene/rgb!"
4344
exit
4445
fi
4546

47+
echo "Building SplaTAM expected directories..."
4648
python3 scripts/nerfcapture2dataset.py --config $1 --base_dir $base_dir --scene $scene --frames $frames
4749

4850
# Run SplaTAM
51+
echo "Running SplaTAM..."
4952
python3 scripts/splatam.py $1 --base_dir $base_dir --scene $scene --frames $frames
5053

51-
exit 0
52-
5354
# Visualize SplaTAM Output
54-
python3 viz_scripts/final_recon.py $1
55+
echo "Running visualizer..."
56+
python3 viz_scripts/final_recon.py $1 --base_dir $base_dir --scene $scene --frames $frames
57+

viz_scripts/final_recon.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ def visualize(scene_path, cfg):
279279
parser = argparse.ArgumentParser()
280280

281281
parser.add_argument("experiment", type=str, help="Path to experiment file")
282+
parser.add_argument("--base_dir", type=str, help="Path to the dataset.")
283+
parser.add_argument("--scene", type=str, help="Name of the NeRFCapture dataset. Usually has a _nerfcapture suffix.")
284+
parser.add_argument("--frames", type=int, help="Amount of frames to process.")
282285

283286
args = parser.parse_args()
284287

@@ -287,6 +290,10 @@ def visualize(scene_path, cfg):
287290
).load_module()
288291

289292
seed_everything(seed=experiment.config["seed"])
293+
experiment.config['workdir'] = args.base_dir + "/" + args.scene
294+
experiment.config['data']['num_frames'] = experiment.config['num_frames'] = int(args.frames / 3) # SplaTAM usually stars to go nuts after 1/3 of the dataset frames.
295+
experiment.config['data']['basedir'] = experiment.config['basedir'] = args.base_dir
296+
experiment.config['data']['sequence'] = experiment.config['scene_name'] = args.scene
290297

291298
if "scene_path" not in experiment.config:
292299
results_dir = os.path.join(

0 commit comments

Comments
 (0)