forked from nerfstudio-project/nerfstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstruct.sh
60 lines (54 loc) · 1.28 KB
/
instruct.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
59
#!/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 PROMPT="replace humans by aliens"
else
export PROMPT="$4"
fi
if [ -z $5 ]
then
export GSCALE=7.5
else
export GSCALE=$5
fi
if [ -z $6 ]
then
export ISCALE=1.5
else
export ISCALE=$6
fi
if [ -z $7 ]
then
export INSTRUCT="in2n" #or 'igs2gs'
else
export INSTRUCT=$7
fi
export SCENE=$(echo $(basename $DATASET))
echo $PROMPT
SCENE=`echo ${PROMPT// /_}` # output folder name, using _ instead of spaces
CKPT_PATH=$(ls outputs/$SCENE/$MODEL/*/*/*.ckpt | sort -n | tail -n 1)
MODEL_PATH=$(dirname $(dirname $CKPT_PATH))
CKPT_DATE=$(basename $MODEL_PATH)
CFG_PATH=$MODEL_PATH/config.yml
OUTPUT_PATH=$MODEL_PATH/results.json
# RUN
echo "ns-train $INSTRUCT --data $DATASET --load-dir $MODEL_PATH --pipeline.prompt '$PROMPT' --experiment-name '${SCENE}' --pipeline.guidance-scale $GSCALE --pipeline.image-guidance-scale $ISCALE --vis viewer"
ns-train $INSTRUCT --data $DATASET --load-dir $MODEL_PATH --pipeline.prompt '$PROMPT' --experiment-name '${SCENE}' --pipeline.guidance-scale $GSCALE --pipeline.image-guidance-scale $ISCALE --vis viewer