class_docstr: An abstract class representing a face detector.
  
  Any other face detection implementation must subclass it. All subclasses
  must implement ``detect_from_image``, that return a list of detected
  bounding boxes. Optionally, for speed considerations detect from path is
  recommended.
docstr: Convert path (represented as a string) or torch.tensor to a numpy.ndarray
  
  Arguments:
      tensor_or_path {numpy.ndarray, torch.tensor or string} -- path to the image, or the image itself
docstr_tok: ["Convert","path","(","represented","as","a","string",")","or","torch.tensor","to","a","numpy.ndarray","Arguments",":","tensor_or_path","{","numpy.ndarray",",","torch.tensor","or","string","}","--","path","to","the","image",",","or","the","image","itself"]
code: def tensor_or_path_to_ndarray(tensor_or_path):
      """Convert path (represented as a string) or torch.tensor to a numpy.ndarray
  
      Arguments:
          tensor_or_path {numpy.ndarray, torch.tensor or string} -- path to the image, or the image itself
      """
      if isinstance(tensor_or_path, str):
          return io.imread(tensor_or_path)
      elif torch.is_tensor(tensor_or_path):
          return tensor_or_path.cpu().numpy()
      elif isinstance(tensor_or_path, np.ndarray):
          return tensor_or_path
      else:
          raise TypeError
  
file_path: face-alignment/face_alignment/detection/core.py
imports: import logging
  import glob
  from tqdm import tqdm
  import numpy
  import torch
  from skimage import io
label_desc: Use image node_id 8 for calling the FaceDetector obj's underlying member method code with example usage: obj.tensor_or_path_to_ndarray(tensor_or_path) and returns: io, tensor_or_path, tensor_or_path