code: def replace_to_ceph(cfg):
      backend_args = dict(
          backend="petrel",
          path_mapping=dict(
              {
                  "./data/": "s3://openmmlab/datasets/detection/",
                  "data/": "s3://openmmlab/datasets/detection/",
              }
          ),
      )
  
      # TODO: name is a reserved interface, which will be used later.
      def _process_pipeline(dataset, name):
          def replace_img(pipeline):
              if pipeline["type"] == "LoadImageFromFile":
                  pipeline["backend_args"] = backend_args
  
          def replace_ann(pipeline):
              if (
                  pipeline["type"] == "LoadAnnotations"
                  or pipeline["type"] == "LoadPanopticAnnotations"
              ):
                  pipeline["backend_args"] = backend_args
  
          if "pipeline" in dataset:
              replace_img(dataset.pipeline[0])
              replace_ann(dataset.pipeline[1])
              if "dataset" in dataset:
                  # dataset wrapper
                  replace_img(dataset.dataset.pipeline[0])
                  replace_ann(dataset.dataset.pipeline[1])
          else:
              # dataset wrapper
              replace_img(dataset.dataset.pipeline[0])
              replace_ann(dataset.dataset.pipeline[1])
  
      def _process_evaluator(evaluator, name):
          if evaluator["type"] == "CocoPanopticMetric":
              evaluator["backend_args"] = backend_args
  
      # half ceph
      _process_pipeline(cfg.train_dataloader.dataset, cfg.filename)
      _process_pipeline(cfg.val_dataloader.dataset, cfg.filename)
      _process_pipeline(cfg.test_dataloader.dataset, cfg.filename)
      _process_evaluator(cfg.val_evaluator, cfg.filename)
      _process_evaluator(cfg.test_evaluator, cfg.filename)
  
imports: import copy
  from os.path import dirname, exists, join
  import numpy
  import torch
  from mmengine.config import Config
  from mmengine.dataset import pseudo_collate
  from mmengine.structures import InstanceData, PixelData
  from mmdet.utils.util_random import ensure_rng
  from ..registry import TASK_UTILS
  from ..structures import DetDataSample, TrackDataSample
  from ..structures.bbox import HorizontalBoxes
label_desc: Use image node_id 12 for calling a global function with example usage: replace_to_ceph(cfg) without return types