code: def register_box_converter(
      src_type: Union[str, type],
      dst_type: Union[str, type],
      converter: Optional[Callable] = None,
      force: bool = False,
  ) -> Callable:
      """Register a box converter.
  
      A record will be added to ``box_converter``, whose key is
      '{src_type_name}2{dst_type_name}' and value is the convert function.
      It can be used as a decorator or a normal function.
  
      Args:
          src_type (str or type): source box type name or class.
          dst_type (str or type): destination box type name or class.
          converter (Callable): Convert function. Defaults to None.
          force (bool): Whether to override the existing box type with the same
              name. Defaults to False.
  
      Examples:
          >>> from mmdet.structures.bbox import register_box_converter
          >>> # as a decorator
          >>> @register_box_converter('hbox', 'rbox')
          >>> def converter_A(boxes):
          >>>     pass
  
          >>> # as a normal function
          >>> def converter_B(boxes):
          >>>     pass
          >>> register_box_converter('rbox', 'hbox', converter_B)
      """
      if not isinstance(force, bool):
          raise TypeError(
              f"force must be a boolean, but got {type(force)}"
          )
  
      # use it as a normal method:
      # register_box_converter(src_type, dst_type, converter=Func)
      if converter is not None:
          _register_box_converter(
              src_type=src_type,
              dst_type=dst_type,
              converter=converter,
              force=force,
          )
          return converter
  
      # use it as a decorator: @register_box_converter(name)
      def _register(func):
          _register_box_converter(
              src_type=src_type,
              dst_type=dst_type,
              converter=func,
              force=force,
          )
          return func
  
      return _register
  
file_path: mmdetection/mmdet/structures/bbox/box_type.py
imports: from typing import Callable, Optional, Tuple, Type, Union
  import numpy
  import torch
  from torch import Tensor
  from .base_boxes import BaseBoxes
label_desc: Use image node_id 4 for calling a global function with example usage: register_box_converter(src_type, dst_type, converter, force) and returns: _register, converter, func