MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / test_with_TTA

Method test_with_TTA

tools/train_net.py:102–116  ·  view source on GitHub ↗
(cls, cfg, model)

Source from the content-addressed store, hash-verified

100
101 @classmethod
102 def test_with_TTA(cls, cfg, model):
103 logger = logging.getLogger("detectron2.trainer")
104 # In the end of training, run an evaluation with TTA
105 # Only support some R-CNN models.
106 logger.info("Running inference with test-time augmentation ...")
107 model = GeneralizedRCNNWithTTA(cfg, model)
108 evaluators = [
109 cls.build_evaluator(
110 cfg, name, output_folder=os.path.join(cfg.OUTPUT_DIR, "inference_TTA")
111 )
112 for name in cfg.DATASETS.TEST
113 ]
114 res = cls.test(cfg, model, evaluators)
115 res = OrderedDict({k + "_TTA": v for k, v in res.items()})
116 return res
117
118
119def setup(args):

Callers 1

mainFunction · 0.95

Calls 3

build_evaluatorMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected