(args)
| 130 | |
| 131 | |
| 132 | def main(args): |
| 133 | cfg = setup(args) |
| 134 | |
| 135 | if args.eval_only: |
| 136 | model = Trainer.build_model(cfg) |
| 137 | DetectionCheckpointer(model, save_dir=cfg.OUTPUT_DIR).resume_or_load(cfg.MODEL.WEIGHTS, resume=args.resume) |
| 138 | res = Trainer.test(cfg, model) |
| 139 | if cfg.TEST.AUG.ENABLED: |
| 140 | res.update(Trainer.test_with_TTA(cfg, model)) |
| 141 | if comm.is_main_process(): |
| 142 | verify_results(cfg, res) |
| 143 | return res |
| 144 | |
| 145 | trainer = Trainer(cfg) |
| 146 | trainer.resume_or_load(resume=args.resume) |
| 147 | return trainer.train() |
| 148 | |
| 149 | |
| 150 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected