code: def save_schp_checkpoint(
      states,
      is_best_parsing,
      output_dir,
      filename="schp_checkpoint.pth.tar",
  ):
      save_path = os.path.join(output_dir, filename)
      # if os.path.exists(save_path):
      #     os.remove(save_path)
      torch.save(states, save_path)
      if is_best_parsing and "state_dict" in states:
          best_save_path = os.path.join(
              output_dir, "model_parsing_best.pth.tar"
          )
          if os.path.exists(best_save_path):
              os.remove(best_save_path)
          torch.save(states, best_save_path)
  
file_path: insightface/parsing/dml_csr/utils/schp.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import torch
label_desc: Use image node_id 8 for calling a global function with example usage: save_schp_checkpoint(states, is_best_parsing, output_dir, filename) without return types