class_docstr: Create a Detectron2-based Layout Detection Model
  
  Args:
      config_path (:obj:`str`):
          The path to the configuration file.
      model_path (:obj:`str`, None):
          The path to the saved weights of the model.
          If set, overwrite the weights in the configuration file.
          Defaults to `None`.
      label_map (:obj:`dict`, optional):
          The map from the model prediction (ids) to real
          word labels (strings). If the config is from one of the supported
          datasets, Layout Parser will automatically initialize the label_map.
          Defaults to `None`.
      device(:obj:`str`, optional):
          Whether to use cuda or cpu devices. If not set, LayoutParser will
          automatically determine the device to initialize the models on.
      extra_config (:obj:`list`, optional):
          Extra configuration passed to the Detectron2 model
          configuration. The argument will be used in the `merge_from_list
          <https://detectron2.readthedocs.io/modules/config.html
          #detectron2.config.CfgNode.merge_from_list>`_ function.
          Defaults to `[]`.
  
  Examples::
      >>> import layoutparser as lp
      >>> model = lp.Detectron2LayoutModel('lp://HJDataset/faster_rcnn_R_50_FPN_3x/config')
      >>> model.detect(image)
code: def _create_model(self):
      self.model = detectron2.engine.DefaultPredictor(self.cfg)
  
file_path: layout-parser/src/layoutparser/models/detectron2/layoutmodel.py
imports: from typing import Union
  from PIL import Image
  import numpy
  import warnings
  from .catalog import MODEL_CATALOG, PathManager, LABEL_MAP_CATALOG
  from ..base_layoutmodel import BaseLayoutModel
  from ...elements import Rectangle, TextBlock, Layout
  from ...file_utils import is_torch_cuda_available, is_detectron2_available
label_desc: Use image node_id 2 for calling the Detectron2LayoutModel obj's underlying member method code with example usage: obj._create_model() without return types