-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
52 lines (47 loc) · 1.12 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import argparse
import yaml
from core.tester import Tester
def main(args):
config_path = args.c
ckpt_path = args.p
name = args.n
output_dir = args.o
device = args.d
with open(config_path) as config_file:
config = yaml.load(config_file, Loader=yaml.FullLoader)
tester = Tester(config, ckpt_path, output_dir, name, device)
tester.test_checkpoint()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
'-c',
type=str,
metavar='CONFIG_PATH',
help='Path to yaml configuration file'
)
parser.add_argument(
'-p',
type=str,
metavar='CKPT_PATH',
help='Path to the checkpoint file'
)
parser.add_argument(
'-o',
type=str,
metavar='OUTPUT_DIR',
help='Path to the output images'
)
parser.add_argument(
'-n',
type=str,
metavar='NAME',
help='Name of the test'
)
parser.add_argument(
'-d',
type=str,
metavar='DEVICE',
help='GPU device'
)
args = parser.parse_args()
main(args)