class_docstr: Open Images dataset for detection.
  
  Args:
      ann_file (str): Annotation file path.
      label_file (str): File path of the label description file that
          maps the classes names in MID format to their short
          descriptions.
      meta_file (str): File path to get image metas.
      hierarchy_file (str): The file path of the class hierarchy.
      image_level_ann_file (str): Human-verified image level annotation,
          which is used in evaluation.
      backend_args (dict, optional): Arguments to instantiate the
          corresponding backend. Defaults to None.
docstr: Get the matrix of class hierarchy from the hierarchy file. Hierarchy
  for 600 classes can be found at https://storage.googleapis.com/openimag
  es/2018_04/bbox_labels_600_hierarchy_visualizer/circle.html.
  
  Args:
      hierarchy_file (str): File path to the hierarchy for classes.
  
  Returns:
      np.ndarray: The matrix of the corresponding relationship between
      the parent class and the child class, of shape
      (class_num, class_num).
docstr_tok: ["Get","the","matrix","of","class","hierarchy","from","the","hierarchy","file",".","Hierarchy","for","600","classes","can","be","found","at","https",":","\/\/storage.googleapis.com\/openimag","es\/2018_04\/bbox_labels_600_hierarchy_visualizer\/circle.html",".","Args",":","hierarchy_file","(","str",")",":","File","path","to","the","hierarchy","for","classes",".","Returns",":","np.ndarray",":","The","matrix","of","the","corresponding","relationship","between","the","parent","class","and","the","child","class",",","of","shape","(","class_num",",","class_num",")","."]
code: def _get_relation_matrix(self, hierarchy_file: str) -> np.ndarray:
      """Get the matrix of class hierarchy from the hierarchy file. Hierarchy
      for 600 classes can be found at https://storage.googleapis.com/openimag
      es/2018_04/bbox_labels_600_hierarchy_visualizer/circle.html.
  
      Args:
          hierarchy_file (str): File path to the hierarchy for classes.
  
      Returns:
          np.ndarray: The matrix of the corresponding relationship between
          the parent class and the child class, of shape
          (class_num, class_num).
      """  # noqa
  
      hierarchy = load(
          hierarchy_file,
          file_format="json",
          backend_args=self.backend_args,
      )
      class_num = len(self._metainfo["classes"])
      relation_matrix = np.eye(class_num, class_num)
      relation_matrix = self._convert_hierarchy_tree(
          hierarchy, relation_matrix
      )
      return relation_matrix
  
imports: import csv
  import os.path
  from collections import defaultdict
  from typing import Dict, List, Optional
  import numpy
  from mmengine.fileio import get_local_path, load
  from mmengine.utils import is_abs
  from mmdet.registry import DATASETS
  from .base_det_dataset import BaseDetDataset
label_desc: Use image node_id 5 for calling the OpenImagesDataset obj's underlying member method code with example usage: obj._get_relation_matrix(hierarchy_file) and returns: relation_matrix