-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_test.py
More file actions
58 lines (36 loc) · 1.25 KB
/
main_test.py
File metadata and controls
58 lines (36 loc) · 1.25 KB
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
#!/usr/bin/python3
import logging
import os
import pprint
from tools.train import train_model,train
from tools.test import test_model
from utils import setup_logging, load_config, parse_args,set_output_dir,get_max_epoch_pth_file
from tools import train,test
import time
LOGGER = logging.getLogger(__name__)
def main():
args = parse_args()
os.environ["CUDA_VISIBLE_DEVICES"] = args.device
for path_to_config in args.cfg_files:
cfg = load_config(args, path_to_config=path_to_config)
# set output directory and logging
cfg = set_output_dir(cfg)
setup_logging(cfg)
LOGGER.info(pprint.pformat(cfg))
test_(cfg, path_to_config)
def test_(cfg, path_to_config):
LOGGER.info("time is {}".format(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())))
LOGGER.info(pprint.pformat(cfg))
LOGGER.info("path_to_config is {}".format(path_to_config))
LOGGER.info("start testing!")
"""
include:
1) test dataloader load
2) test prepare phase: 1) base model load
2) start test (one follow by one)
"""
test_model(cfg=cfg)
LOGGER.info("Testing complete!")
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
main()