MCPcopy Create free account
hub / github.com/HYUNJS/SGT / main

Function main

projects/CenterNet/train_net.py:41–67  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

39
40
41def main(args):
42 cfg = setup(args)
43 register_all_coco(args.data_dir)
44 register_all_mot(args.data_dir, cfg)
45 register_mix_tgt(args.data_dir, cfg)
46 if args.eval_only:
47 model = Trainer.build_model(cfg)
48 CenterNetCheckpointer(model, save_dir=cfg.OUTPUT_DIR).resume_or_load(
49 cfg.MODEL.WEIGHTS, resume=args.resume
50 )
51 res = Trainer.test(cfg, model)
52 if comm.is_main_process():
53 verify_results(cfg, res)
54 return res
55
56 """
57 If you'd like to do anything fancier than the standard training logic,
58 consider writing your own training loop (see plain_train_net.py) or
59 subclassing the trainer.
60 """
61 trainer = Trainer(cfg)
62 trainer.resume_or_load(resume=args.resume)
63 if cfg.TEST.AUG.ENABLED:
64 trainer.register_hooks(
65 [hooks.EvalHook(0, lambda: trainer.test_with_TTA(cfg, trainer.model))]
66 )
67 return trainer.train()
68
69
70if __name__ == "__main__":

Callers

nothing calls this directly

Calls 10

resume_or_loadMethod · 0.95
register_all_cocoFunction · 0.90
register_all_motFunction · 0.90
register_mix_tgtFunction · 0.90
TrainerClass · 0.90
build_modelMethod · 0.80
trainMethod · 0.80
setupFunction · 0.70
testMethod · 0.45

Tested by

no test coverage detected