forked from nerfstudio-project/nerfstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain.sh
50 lines (44 loc) · 1.25 KB
/
train.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
#!/bin/bash
if [ -z $1 ]
then
export CUDA_VISIBLE_DEVICES=0
else
export CUDA_VISIBLE_DEVICES=$1
fi
if [ -z $2 ]
then
export MODEL="nerfacto"
else
export MODEL=$2
fi
if [ -z "$3" ]
then
export DATASET="data/nerfstudio/kitchen"
else
export DATASET="$3"
fi
if [ -z $4 ]
then
export VIS="viewer_legacy"
else
export VIS=$4
fi
if [ "${MODEL}" = "refnerfacto" ] # [ "${MODEL}" = "nerfacto" ] ||
then
export EXTRAFLAGS="--pipeline.model.predict-normals True"
elif [ "${MODEL}" = "generfacto" ]
then
export EXTRAFLAGS="--pipeline.model.diffusion_model stablediffusion"
else
export EXTRAFLAGS=""
fi
# RUN
if [ "${MODEL}" = "generfacto" ] # for generfacto, dataset is prompt (string)
then
export SCENE=`echo ${DATASET// /_}` # replace spaces (for 'ls' path readout)
echo "ns-train ${MODEL} --prompt '${DATASET}' --experiment-name '${SCENE}' --vis $VIS --viewer.quit-on-train-completion True $EXTRAFLAGS";
ns-train ${MODEL} --prompt "${DATASET}" --experiment-name "${SCENE}" --vis $VIS --viewer.quit-on-train-completion True $EXTRAFLAGS;
else # for nerf models, specify dataset
echo "ns-train ${MODEL} --data ${DATASET} --vis $VIS --viewer.quit-on-train-completion True $EXTRAFLAGS";
ns-train ${MODEL} --data ${DATASET} --vis $VIS --viewer.quit-on-train-completion True $EXTRAFLAGS;
fi