MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / _init_det_model

Method _init_det_model

tools/engine/trainer.py:202–216  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

200 self.eval_class = build_rec_metric(self.cfg['Metric'])
201
202 def _init_det_model(self):
203 from opendet.losses import build_loss as build_det_loss
204 from opendet.metrics import build_metric as build_det_metric
205 from opendet.modeling import build_model as build_det_model
206 from opendet.postprocess import build_post_process as build_det_post_process
207
208 # build post process
209 self.post_process_class = build_det_post_process(
210 self.cfg['PostProcess'], self.cfg['Global'])
211 # build detmodel
212 self.model = build_det_model(self.cfg['Architecture'])
213 # build loss
214 self.loss_class = build_det_loss(self.cfg['Loss'])
215 # build metric
216 self.eval_class = build_det_metric(self.cfg['Metric'])
217
218 def load_params(self, params):
219 self.model.load_state_dict(params)

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected