MCPcopy
hub / github.com/Duankaiwen/CenterNet / test

Function test

test.py:39–61  ·  view source on GitHub ↗
(db, split, testiter, debug=False, suffix=None)

Source from the content-addressed store, hash-verified

37 os.makedirs(directory)
38
39def test(db, split, testiter, debug=False, suffix=None):
40 result_dir = system_configs.result_dir
41 result_dir = os.path.join(result_dir, str(testiter), split)
42
43 if suffix is not None:
44 result_dir = os.path.join(result_dir, suffix)
45
46 make_dirs([result_dir])
47
48 test_iter = system_configs.max_iter if testiter is None else testiter
49 print("loading parameters at iteration: {}".format(test_iter))
50
51 print("building neural network...")
52 nnet = NetworkFactory(db)
53 print("loading parameters...")
54 nnet.load_params(test_iter)
55
56 test_file = "test.{}".format(db.data)
57 testing = importlib.import_module(test_file).testing
58
59 nnet.cuda()
60 nnet.eval_mode()
61 testing(db, nnet, result_dir, debug=debug)
62
63if __name__ == "__main__":
64 args = parse_args()

Callers 1

test.pyFile · 0.85

Calls 6

load_paramsMethod · 0.95
cudaMethod · 0.95
eval_modeMethod · 0.95
NetworkFactoryClass · 0.90
make_dirsFunction · 0.85
testingFunction · 0.85

Tested by

no test coverage detected