-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest.py
More file actions
33 lines (23 loc) · 726 Bytes
/
test.py
File metadata and controls
33 lines (23 loc) · 726 Bytes
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
import os
import options
import sys
import torch
from coach import Coach
from misc.utils import log
def main():
log.process(os.getpid())
log.title("[{}] (PyTorch code for testing MatchNeRF)".format(sys.argv[0]))
opt_cmd = options.parse_arguments(sys.argv[1:])
opt = options.set(opt_cmd=opt_cmd)
options.save_options_file(opt)
with torch.cuda.device(opt.device):
m = Coach(opt)
m.build_networks()
m.restore_checkpoint()
m.load_dataset(splits=['test'])
if opt.nerf.render_video:
m.test_model_video(leave_tqdm=True)
else:
m.test_model(leave_tqdm=True, separate_save=opt.separate_save)
if __name__ == "__main__":
main()