code: def __init__(self, json_path: str, auto_update=True, dry_run=False):
      self.json_path = (
          json_path
          if json_path.endswith(".json")
          else json_path + ".json"
      )
      self.json_path = os.path.abspath(
          os.path.expanduser(os.path.expandvars(self.json_path))
      )
      self.ckpt_path = os.path.splitext(self.json_path)[0]
      self.dry_run = dry_run
      self.dirname = os.path.dirname(self.ckpt_path)
      self.basename = os.path.basename(split_all_ext(self.ckpt_path)[0])
  
      # do not parse as proto, since some parameters might have changed
      with open(self.json_path, "r") as f:
          self.dict = json.load(f)
  
          self.version = (
              self.dict["version"] if "version" in self.dict else 0
          )
  
      if self.version != SavedCalamariModel.VERSION:
          if auto_update:
              self.update_checkpoint()
          else:
              raise Exception(
                  "Version of checkpoint is {} but {} is required. Please upgrade the model or "
                  "set the auto update flag.".format(
                      self.version, SavedCalamariModel.VERSION
                  )
              )
  
      else:
          logger.info(
              f"Checkpoint version {self.version} is up-to-date."
          )
  
      from calamari_ocr.ocr.training.params import TrainerParams
  
      if "scenario" in self.dict:
          self.trainer_params = TrainerParams.from_dict(self.dict)
      else:
          self.trainer_params = TrainerParams.from_dict(
              {"scenario": self.dict}
          )
      self.scenario_params = self.trainer_params.scenario
  
file_path: calamari/calamari_ocr/ocr/savedmodel/saved_model.py
imports: import shutil
  import json
  import os
  import logging
  import packaging.version
  from calamari_ocr import __version__
  from calamari_ocr.utils import split_all_ext
label_desc: Use image node_id 1 to create a new SavedCalamariModel object  with example: obj = SavedCalamariModel(json_path, auto_update, dry_run)