# Path: ldif/model/hparams.py
# def backwards_compatible_hparam_defaults(ident):
# def tf_hparams_to_dict(tf_hparams):
# def build_ldif_hparams():
# def build_sif_hparams():
# def build_improved_sif_hparams():
# def build_singleview_depth_hparams():
# def write_hparams(hparams, path):
# def read_hparams_with_new_backwards_compatible_additions(path):
# def read_hparams(path):
# 
# Path: ldif/util/file_util.py
# def readlines(p):
# def readbin(p):
# def writebin(p, s):
# def writetxt(p, s):
# def write_np(path, arr):
# def read_grd(path):
# def read_sif_v1(path, verbose=False):
# def read_lines(p):
# def read_image(p):
# def read_npz(p):
# def read_np(p):
# def read_txt_to_np(p):
# def read_py2_pkl(p):
# def write_mesh(path, mesh):
# def read_mesh(path):
# def read_csv(path):
# def read_normals(path_to_dir, im_count=20, leading='_depth'):
# def write_points(path_ext_optional, points):
# def write_grd(path, volume, world2grid=None):
# def write_depth_image(path, depth_image):
# 
# Path: ldif/util/path_util.py
# def get_path_to_ldif_root():
# def get_path_to_ldif_parent():
# def package_to_abs(path):
# def gaps_path():
# def test_data_path():
# def util_test_data_path():
# def create_test_output_dir():
# 
# Path: ldif/util/file_util.py
# def readlines(p):
# def readbin(p):
# def writebin(p, s):
# def writetxt(p, s):
# def write_np(path, arr):
# def read_grd(path):
# def read_sif_v1(path, verbose=False):
# def read_lines(p):
# def read_image(p):
# def read_npz(p):
# def read_np(p):
# def read_txt_to_np(p):
# def read_py2_pkl(p):
# def write_mesh(path, mesh):
# def read_mesh(path):
# def read_csv(path):
# def read_normals(path_to_dir, im_count=20, leading='_depth'):
# def write_points(path_ext_optional, points):
# def write_grd(path, volume, world2grid=None):
# def write_depth_image(path, depth_image):


import importlib
import os
import numpy as np
from ldif.model import hparams as hparams_util
from ldif.util import file_util
from ldif.util import path_util
from ldif.util.file_util import log
    return self._root_dir

  @property
  def all_checkpoint_indices(self):
    return [c.idx for c in self.all_checkpoints]

  @property
  def all_checkpoints(self):
    """A list of all checkpoint objects in the checkpoint directory."""
    if self._all_checkpoints is None:
      candidates = [
          os.path.basename(n) for n in file_util.glob(f'{self.ckpt_dir}/*')
      ]
      inds = [
          int(x.replace('model.ckpt-', '').replace('.index', ''))
          for x in candidates
          if 'index' in x and 'tempstate' not in x
      ]
      inds.sort(reverse=False)
      # The train task may delete the 5 most recent checkpoints periodically:
      if not inds:
        raise ValueError('There are no checkpoints in the directory %s.' %
                         self.ckpt_dir)
      elif self._use_temp_ckpts is True:  # pylint: disable=g-bool-id-comparison
        message = 'Temporary checkpoints are enabled.'
        message += ' The most recent temporary checkpoint is %i.' % inds[-1]
        if len(inds) >= 6:
          message += ' The most recent permanent checkpoint is %i.' % inds[-6]
        else:
          message += ' There are no permanent checkpoints.'

# Path: ldif/model/hparams.py
# def backwards_compatible_hparam_defaults(ident):
# def tf_hparams_to_dict(tf_hparams):
# def build_ldif_hparams():
# def build_sif_hparams():
# def build_improved_sif_hparams():
# def build_singleview_depth_hparams():
# def write_hparams(hparams, path):
# def read_hparams_with_new_backwards_compatible_additions(path):
# def read_hparams(path):
# 
# Path: ldif/util/file_util.py
# def readlines(p):
# def readbin(p):
# def writebin(p, s):
# def writetxt(p, s):
# def write_np(path, arr):
# def read_grd(path):
# def read_sif_v1(path, verbose=False):
# def read_lines(p):
# def read_image(p):
# def read_npz(p):
# def read_np(p):
# def read_txt_to_np(p):
# def read_py2_pkl(p):
# def write_mesh(path, mesh):
# def read_mesh(path):
# def read_csv(path):
# def read_normals(path_to_dir, im_count=20, leading='_depth'):
# def write_points(path_ext_optional, points):
# def write_grd(path, volume, world2grid=None):
# def write_depth_image(path, depth_image):
# 
# Path: ldif/util/path_util.py
# def get_path_to_ldif_root():
# def get_path_to_ldif_parent():
# def package_to_abs(path):
# def gaps_path():
# def test_data_path():
# def util_test_data_path():
# def create_test_output_dir():
# 
# Path: ldif/util/file_util.py
# def readlines(p):
# def readbin(p):
# def writebin(p, s):
# def writetxt(p, s):
# def write_np(path, arr):
# def read_grd(path):
# def read_sif_v1(path, verbose=False):
# def read_lines(p):
# def read_image(p):
# def read_npz(p):
# def read_np(p):
# def read_txt_to_np(p):
# def read_py2_pkl(p):
# def write_mesh(path, mesh):
# def read_mesh(path):
# def read_csv(path):
# def read_normals(path_to_dir, im_count=20, leading='_depth'):
# def write_points(path_ext_optional, points):
# def write_grd(path, volume, world2grid=None):
# def write_depth_image(path, depth_image):


# Path: ldif/inference/experiment.py
import importlib
import os
import numpy as np
from ldif.model import hparams as hparams_util
from ldif.util import file_util
from ldif.util import path_util
from ldif.util.file_util import log

    return self._root_dir

  @property
  def all_checkpoint_indices(self):
    return [c.idx for c in self.all_checkpoints]

  @property
  def all_checkpoints(self):
    """A list of all checkpoint objects in the checkpoint directory."""
    if self._all_checkpoints is None:
      candidates = [
          os.path.basename(n) for n in file_util.glob(f'{self.ckpt_dir}/*')
      ]
      inds = [
          int(x.replace('model.ckpt-', '').replace('.index', ''))
          for x in candidates
          if 'index' in x and 'tempstate' not in x
      ]
      inds.sort(reverse=False)
      # The train task may delete the 5 most recent checkpoints periodically:
      if not inds:
        raise ValueError('There are no checkpoints in the directory %s.' %
                         self.ckpt_dir)
      elif self._use_temp_ckpts is True:  # pylint: disable=g-bool-id-comparison
        message = 'Temporary checkpoints are enabled.'
        message += ' The most recent temporary checkpoint is %i.' % inds[-1]
        if len(inds) >= 6:
          message += ' The most recent permanent checkpoint is %i.' % inds[-6]
        else:
          message += ' There are no permanent checkpoints.'

        log.warning(message)