class_docstr: The predictor class handles prediction, given an input model.
  
  Loads the images in the input directory, executes training given a model
  and saves the results in the output directory.
  Can receive a path for the weights or can let the user browse through the
  weights directory for the desired weights.
  
  Args:
      input_dir: string, path to the input directory.
      output_dir: string, path to the output directory.
      verbose: bool.
  
  Attributes:
      extensions: list of accepted image extensions.
      img_ls: list of image files in input_dir.
  
  Methods:
      get_predictions: given a model and a string containing the weights' path,
          runs the predictions on the images contained in the input directory and
          stores the results in the output directory.
class_docstr_tok: ["The","predictor","class","handles","prediction",",","given","an","input","model",".","Loads","the","images","in","the","input","directory",",","executes","training","given","a","model","and","saves","the","results","in","the","output","directory",".","Can","receive","a","path","for","the","weights","or","can","let","the","user","browse","through","the","weights","directory","for","the","desired","weights",".","Args",":","input_dir",":","string",",","path","to","the","input","directory",".","output_dir",":","string",",","path","to","the","output","directory",".","verbose",":","bool",".","Attributes",":","extensions",":","list","of","accepted","image","extensions",".","img_ls",":","list","of","image","files","in","input_dir",".","Methods",":","get_predictions",":","given","a","model","and","a","string","containing","the","weights","'","path",",","runs","the","predictions","on","the","images","contained","in","the","input","directory","and","stores","the","results","in","the","output","directory","."]
docstr: Invokes the model's load weights function if any weights are provided. 
docstr_tok: ["Invokes","the","model","'s","load","weights","function","if","any","weights","are","provided","."]
code: def _load_weights(self):
      """Invokes the model's load weights function if any weights are provided."""
      if self.weights_path is not None:
          self.logger.info(
              "Loaded weights from \n > {}".format(self.weights_path)
          )
          # loading by name automatically excludes the vgg layers
          self.model.model.load_weights(str(self.weights_path))
      else:
          self.logger.error(
              "Error: Weights path not specified (check config file)."
          )
          raise ValueError(
              "Weights path not specified (check config file)."
          )
  
      session_config_path = (
          self.weights_path.parent / "session_config.yml"
      )
      if session_config_path.exists():
          conf = yaml.load(
              session_config_path.read_text(), Loader=yaml.FullLoader
          )
      else:
          self.logger.warning(
              "Could not find weights training configuration"
          )
          conf = {}
      conf.update({"pre-trained-weights": self.weights_path.name})
      return conf
  
file_path: image-super-resolution/ISR/predict/predictor.py
imports: from time import time
  import imageio
  import yaml
  import numpy
  from pathlib import Path
  from ISR.utils.logger import get_logger
  from ISR.utils.utils import get_timestamp
label_desc: Use image node_id 2 for calling the Predictor obj's underlying member method code with example usage: obj._load_weights() and returns: conf