-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathfull_eval.py
158 lines (145 loc) · 5.49 KB
/
full_eval.py
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#
# Copyright (C) 2023, Inria
# GRAPHDECO research group, https://team.inria.fr/graphdeco
# All rights reserved.
#
# This software is free for non-commercial, research and evaluation use
# under the terms of the LICENSE.md file.
#
# For inquiries contact [email protected]
#
import os
from argparse import ArgumentParser
GLO_SCENES = ["alameda"]
# mipnerf360_outdoor_scenes = ["bicycle", "flowers", "garden", "stump", "treehill"]
mipnerf360_outdoor_scenes = ["bicycle", "flowers", "garden", "stump", "treehill"]
mipnerf360_indoor_scenes = ["room", "counter", "kitchen", "bonsai"]
# mipnerf360_indoor_scenes = ["counter", "kitchen", "bonsai"]
tanks_and_temples_scenes = ["truck", "train"]
deep_blending_scenes = ["drjohnson", "playroom"]
zipnerf_scenes = ["alameda", "nyc", "london", "berlin"]
parser = ArgumentParser(description="Full evaluation script parameters")
parser.add_argument("--skip_training", action="store_true")
parser.add_argument("--skip_rendering", action="store_true")
parser.add_argument("--skip_metrics", action="store_true")
parser.add_argument("--output_path", default="./eval")
args, _ = parser.parse_known_args()
parser.add_argument('--mipnerf360', "-m360", default='', type=str)
parser.add_argument("--tanksandtemples", "-tat", default='', type=str)
parser.add_argument("--deepblending", "-db", default='', type=str)
parser.add_argument("--zipnerf", "-zn", default='', type=str)
parser.add_argument("--skip_360_indoor", action='store_true')
parser.add_argument("--skip_360_outdoor", action='store_true')
parser.add_argument("--port", default=6009, type=int)
parser.add_argument("--additional_args", default="", type=str)
args = parser.parse_args()
if args.skip_360_outdoor:
mipnerf360_outdoor_scenes = []
if args.skip_360_indoor:
mipnerf360_indoor_scenes = []
if len(args.mipnerf360) == 0:
mipnerf360_indoor_scenes = []
mipnerf360_outdoor_scenes = []
if len(args.tanksandtemples) == 0:
tanks_and_temples_scenes = []
if len(args.deepblending) == 0:
deep_blending_scenes = []
if len(args.zipnerf) == 0:
zipnerf_scenes = []
all_scenes = []
all_scenes.extend(mipnerf360_outdoor_scenes)
all_scenes.extend(mipnerf360_indoor_scenes)
all_scenes.extend(tanks_and_temples_scenes)
all_scenes.extend(deep_blending_scenes)
all_scenes.extend(zipnerf_scenes)
if not args.skip_training:
common_args = f" --quiet --eval --test_iterations -1 --port {args.port} {args.additional_args}"
for scene in mipnerf360_outdoor_scenes:
source = args.mipnerf360 + "/" + scene
os.system("python train.py -s " + source + " -i images_4 -m " + args.output_path + "/" + scene + common_args)
for scene in mipnerf360_indoor_scenes:
source = args.mipnerf360 + "/" + scene
os.system("python train.py -s " + source + " -i images_2 -m " + args.output_path + "/" + scene + common_args)
for scene in tanks_and_temples_scenes:
source = args.tanksandtemples + "/" + scene
os.system(
"python train.py -s "
+ source
+ " -m "
+ args.output_path
+ "/"
+ scene
+ common_args
)
for scene in deep_blending_scenes:
source = args.deepblending + "/" + scene
os.system(
"python train.py -s "
+ source
+ " -m "
+ args.output_path
+ "/"
+ scene
+ common_args
)
for scene in zipnerf_scenes:
glo_args = ""
if scene in GLO_SCENES:
glo_args = " --enable_GLO --glo_lr 0 --checkpoint_iterations 7000 30000 "
source = args.zipnerf + "/" + scene
os.system(
"python train.py -s "
+ source
+ " -m "
+ args.output_path
+ "/"
+ scene
+ common_args
+ glo_args
+ " -r 1 --images images_2 "
+ " --position_lr_init 4e-5 --position_lr_final 4e-7 "
+ " --percent_dense 0.0005 --tmin 0"
)
if not args.skip_rendering:
all_sources = []
for scene in mipnerf360_outdoor_scenes:
all_sources.append(args.mipnerf360 + "/" + scene)
for scene in mipnerf360_indoor_scenes:
all_sources.append(args.mipnerf360 + "/" + scene)
for scene in tanks_and_temples_scenes:
all_sources.append(args.tanksandtemples + "/" + scene)
for scene in deep_blending_scenes:
all_sources.append(args.deepblending + "/" + scene)
common_args = " --quiet --eval --skip_train"
for scene, source in zip(all_scenes, all_sources):
# glo_args = ""
# if scene in GLO_SCENES:
# glo_args = f" --checkpoint {os.path.join(args.output_path,scene,'chkpnt7000.pth')} "
# os.system(
# "python render.py --iteration 7000 -s "
# + source
# + " -m "
# + args.output_path
# + "/"
# + scene
# + common_args
# + glo_args
# )
glo_args = ""
if scene in GLO_SCENES:
glo_args = f" --checkpoint {os.path.join(args.output_path,scene,'chkpnt30000.pth')} "
os.system(
"python render.py --iteration 30000 -s "
+ source
+ " -m "
+ args.output_path
+ "/"
+ scene
+ common_args
+ glo_args
)
if not args.skip_metrics:
scenes_string = ""
for scene in all_scenes:
scenes_string += '"' + args.output_path + "/" + scene + '" '
os.system("python metrics.py -m " + scenes_string)