code: def get_image_filenames(path: str | Path) -> list[Path]:
      """Get image filenames.
  
      Args:
          path (str | Path): Path to image or image-folder.
  
      Returns:
          list[Path]: List of image filenames
  
      """
      image_filenames: list[Path]
  
      if isinstance(path, str):
          path = Path(path)
  
      if path.is_file() and path.suffix in IMG_EXTENSIONS:
          image_filenames = [path]
  
      if path.is_dir():
          image_filenames = [
              p for p in path.glob("**/*") if p.suffix in IMG_EXTENSIONS
          ]
  
      if not image_filenames:
          raise ValueError(f"Found 0 images in {path}")
  
      return image_filenames
  
file_path: anomalib/src/anomalib/data/utils/image.py
imports: from __future__ import annotations
  import math
  import warnings
  from pathlib import Path
  import cv2
  import numpy
  import tifffile
  import torch.nn.functional
  from torch import Tensor
  from torchvision.datasets.folder import IMG_EXTENSIONS
label_desc: Use image node_id 1 for calling a global function with example usage: get_image_filenames(path) and returns: image_filenames