docstr: Wrapper to initialize text detection model. This model includes contructing
  and weight loading.
  
  Parameters
  ----------
  model_config : dict
      Configuration dictionary.
  weight_path : str
      Path to trained weight.
  
  Returns
  -------
  None.
docstr_tok: ["Wrapper","to","initialize","text","detection","model",".","This","model","includes","contructing","and","weight","loading",".","Parameters","--","--","--","--","--","model_config",":","dict","Configuration","dictionary",".","weight_path",":","str","Path","to","trained","weight",".","Returns","--","--","--","-","None","."]
code: def initialize_model(self, model_config, weight_path):
      """
      Wrapper to initialize text detection model. This model includes contructing
      and weight loading.
  
      Parameters
      ----------
      model_config : dict
          Configuration dictionary.
      weight_path : str
          Path to trained weight.
  
      Returns
      -------
      None.
      """
      self.construct_model(model_config)
      self.load_weight(weight_path)
      if (
          isinstance(self.model.model, torch.nn.DataParallel)
          and self.device == "cpu"
      ):
          self.model.model = self.model.model.module.to(self.device)
  
imports: import os
  import math
  import yaml
  from shapely.geometry import Polygon
  import PIL.Image
  import numpy
  import cv2
  import pyclipper
  import torch
  from .model.constructor import Configurable
label_desc: Use image node_id 5 for calling the DBNet obj's underlying member method code with example usage: obj.initialize_model(model_config, weight_path) without return types