forked from nerfstudio-project/nerfstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall_render.sh
73 lines (64 loc) · 1.45 KB
/
all_render.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
60
61
62
63
64
65
66
67
68
69
70
71
72
if [ -z $1 ]
then
export CUDA_VISIBLE_DEVICES=0
else
export CUDA_VISIBLE_DEVICES=$1
fi
if [ -z $2 ]
then
export RESOL=1
else
export RESOL=$2
fi
if [ -z $3 ]
then
export OVERWRITE=false
else
export OVERWRITE=$3
fi
ALL_CKPTS=$(ls outputs/*/*/*/*/*.ckpt)
for CKPT in $ALL_CKPTS
do
DATE=$(basename $(dirname $(dirname $CKPT)))
MODEL=$(basename $(dirname $(dirname $(dirname $CKPT))))
SCENE=$(basename $(dirname $(dirname $(dirname $(dirname $CKPT)))))
if [ "${MODEL}" = "generfacto" ] # for model generation
then
export DATASET=$SCENE
echo "sh render.sh $CUDA_VISIBLE_DEVICES $MODEL $DATASET 1 $OVERWRITE"
sh render.sh $CUDA_VISIBLE_DEVICES $MODEL $DATASET 1 $OVERWRITE
else # for any nerf model
for FOLDER in data/*;
do
PACK=$(basename $FOLDER)
if [ -e data/$PACK/$SCENE ]; then
DATASET=data/$PACK/$SCENE
echo "sh render.sh $CUDA_VISIBLE_DEVICES $MODEL $DATASET 1 $OVERWRITE"
sh render.sh $CUDA_VISIBLE_DEVICES $MODEL $DATASET 1 $OVERWRITE
fi
done
fi
##################### old: force existing camera path
: '
for FOLDER in data/*;
do
PACK=$(basename $FOLDER)
if [ -d "data/$PACK/$SCENE/camera_paths" ];
then
PATH_SUB_CAMERA=data/${PACK}/${SCENE}/camera_paths/*.json
if [ -e $PATH_SUB_CAMERA ];
then
DATASET=data/$PACK/$SCENE
PATH_SUB_MP4=renders/${SCENE}/*/*.mp4
if [ -e $PATH_SUB_MP4 ]
then
echo "$SCENE already rendered"
else
echo "sh render.sh $CUDA_VISIBLE_DEVICES $MODEL $DATASET 1"
#sh render.sh $CUDA_VISIBLE_DEVICES $MODEL $DATASET 1
fi
fi
fi
done
'
done