code: def migrate3to5(trainer_params: dict) -> dict:
      convert_processor_name = {
          "CenterNormalizer": "calamari_ocr.ocr.dataset.imageprocessors.center_normalizer:CenterNormalizerProcessorParams",
          "DataRangeNormalizer": "calamari_ocr.ocr.dataset.imageprocessors.data_range_normalizer:DataRangeProcessorParams",
          "FinalPreparation": "calamari_ocr.ocr.dataset.imageprocessors.final_preparation:FinalPreparationProcessorParams",
          "AugmentationProcessor": "calamari_ocr.ocr.dataset.imageprocessors.augmentation:AugmentationProcessorParams",
          "StripTextProcessor": "calamari_ocr.ocr.dataset.textprocessors.basic_text_processors:StripTextProcessorParams",
          "BidiTextProcessor": "calamari_ocr.ocr.dataset.textprocessors.basic_text_processors:BidiTextProcessorParams",
          "TextNormalizer": "calamari_ocr.ocr.dataset.textprocessors.text_normalizer:TextNormalizerProcessorParams",
          "TextRegularizer": "calamari_ocr.ocr.dataset.textprocessors.text_regularizer:TextRegularizerProcessorParams",
          "PrepareSampleProcessor": "calamari_ocr.ocr.dataset.imageprocessors.preparesample:PrepareSampleProcessorParams",
          "ReshapeOutputsProcessor": "calamari_ocr.ocr.dataset.postprocessors.reshape:ReshapeOutputsProcessorParams",
          "CTCDecoderProcessor": "calamari_ocr.ocr.dataset.postprocessors.ctcdecoder:CTCDecoderProcessorParams",
      }
  
      for name in ["scenario"]:
          rename(trainer_params, name + "_params", name)
  
      for name in ["model", "data"]:
          rename(trainer_params["scenario"], name + "_params", name)
  
      scenario = trainer_params["scenario"]
      scenario["data"][
          "__cls__"
      ] = "calamari_ocr.ocr.dataset.params:DataParams"
      scenario["model"][
          "__cls__"
      ] = "calamari_ocr.ocr.model.params:ModelParams"
  
      data = scenario["data"]
      rename(data, "line_height_", "line_height")
      rename(data, "skip_invalid_gt_", "skip_invalid_gt")
      rename(data, "resource_base_path_", "resource_base_path")
      rename(data, "pre_processors_", "pre_proc")
      rename(data, "post_processors_", "post_proc")
      rename(data["pre_proc"], "sample_processors", "processors")
      rename(data["post_proc"], "sample_processors", "processors")
      data["post_proc"][
          "__cls__"
      ] = "tfaip.data.pipeline.processor.params:SequentialProcessorPipelineParams"
      data["pre_proc"][
          "__cls__"
      ] = "tfaip.data.pipeline.processor.params:SequentialProcessorPipelineParams"
      for proc in (
          data["pre_proc"]["processors"]
          + data["post_proc"]["processors"]
      ):
          if "args" in proc:
              args = proc["args"]
              if args:
                  for k, v in args.items():
                      proc[k] = v
              del proc["args"]
          name = proc["name"]
          del proc["name"]
          proc["__cls__"] = convert_processor_name[name]
  
      migrate_model_params(scenario["model"])
  
      params = CalamariScenario.params_from_dict(scenario)
      post_init(params)
      scenario = params.to_dict()
  
      return {"scenario": scenario}
  
file_path: calamari/calamari_ocr/ocr/savedmodel/migrations/version3_4to5.py
imports: import logging
  import os
  from tensorflow import keras
  from tfaip.util.tfaipargparse import post_init
  from calamari_ocr.ocr.scenario import CalamariScenario
  from calamari_ocr.ocr.training.params import TrainerParams
label_desc: Use image node_id 4 for calling a global function with example usage: migrate3to5(trainer_params) and returns: dict