-
Notifications
You must be signed in to change notification settings - Fork 16
/
test.py
31 lines (22 loc) · 878 Bytes
/
test.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
import yaml
import argparse
from trainer import ExpTester
def arg_parser():
parser = argparse.ArgumentParser(description="config")
parser.add_argument("--config",
type=str,
default="config/Recce.yml",
help="Specify the path of configuration file to be used.")
parser.add_argument('--display', '-d', action="store_true",
default=False, help='Display some images.')
return parser.parse_args()
if __name__ == '__main__':
import torch
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.enabled = True
arg = arg_parser()
config = arg.config
with open(config) as config_file:
config = yaml.load(config_file, Loader=yaml.FullLoader)
trainer = ExpTester(config, stage="Test")
trainer.test(display_images=arg.display)