code: def get_checkpoints(run_dir, from_global_step=None, last_only=False):
      """Return all available checkpoints.
  
      Args:
          run_dir: Directory where the checkpoints are located.
          from_global_step (int): Only return checkpoints after this global step.
              The comparison is *strict*. If ``None``, returns all available
              checkpoints.
  
      Returns:
          List of dicts (with keys ``global_step``, ``file``) with all the
          checkpoints found.
  
      Raises:
          ValueError: If there are no checkpoints in ``run_dir``.
      """
      # The latest checkpoint file should be the last item of
      # `all_model_checkpoint_paths`, according to the CheckpointState protobuf
      # definition.
      # TODO: Must check if the checkpoints are complete somehow.
      ckpt = tf.train.get_checkpoint_state(run_dir)
      if not ckpt or not ckpt.all_model_checkpoint_paths:
          raise ValueError(
              "Could not find checkpoint in {}.".format(run_dir)
          )
  
      # TODO: Any other way to get the global_step? (Same as in `checkpoints`.)
      checkpoints = sorted(
          [
              {"global_step": int(path.split("-")[-1]), "file": path}
              for path in ckpt.all_model_checkpoint_paths
          ],
          key=lambda c: c["global_step"],
      )
  
      if last_only:
          checkpoints = checkpoints[-1:]
          tf.logging.info(
              "Using last checkpoint in run_dir, global_step = {}".format(
                  checkpoints[0]["global_step"]
              )
          )
      elif from_global_step is not None:
          checkpoints = [
              c
              for c in checkpoints
              if c["global_step"] > from_global_step
          ]
  
          tf.logging.info(
              "Found %s checkpoints in run_dir with global_step > %s",
              len(checkpoints),
              from_global_step,
          )
  
      else:
          tf.logging.info(
              "Found {} checkpoints in run_dir".format(len(checkpoints))
          )
  
      return checkpoints
  
file_path: luminoth/luminoth/eval.py
imports: import click
  import json
  import numpy
  import os
  import tensorflow
  import time
  from luminoth.datasets import get_dataset
  from luminoth.models import get_model
  from luminoth.utils.bbox_overlap import bbox_overlap
  from luminoth.utils.config import get_config
  from luminoth.utils.image_vis import image_vis_summaries
label_desc: Use image node_id 2 for calling a global function with example usage: get_checkpoints(run_dir, from_global_step, last_only) and returns: checkpoints