docstr: Find the predefined detector config directory.
docstr_tok: ["Find","the","predefined","detector","config","directory","."]
code: def _get_config_directory(self):
      """Find the predefined detector config directory."""
      try:
          # Assume we are running in the source mmocr repo
          repo_dpath = dirname(
              dirname(dirname(dirname(dirname(__file__))))
          )
      except NameError:
          # For IPython development when this __file__ is not defined
          import mmocr
  
          repo_dpath = dirname(
              dirname(dirname(dirname(dirname(mmocr.__file__))))
          )
      config_dpath = join(repo_dpath, "configs")
      if not exists(config_dpath):
          raise Exception("Cannot find config path")
      return config_dpath
  
file_path: mmocr/tests/test_models/test_textdet/test_detectors/test_drrg.py
imports: import copy
  import unittest
  from os.path import dirname, exists, join
  from unittest import mock
  import numpy
  import torch
  from mmengine.config import Config, ConfigDict
  from mmengine.registry import init_default_scope
  from mmocr.registry import MODELS
  from mmocr.testing.data import create_dummy_textdet_inputs
label_desc: Use image node_id 6 for calling the TestDRRG obj's underlying member method code with example usage: obj._get_config_directory() and returns: config_dpath