def __getitem__(self, index: int) -> ImageItem:
        """Get image item at specified index.

        Args:
            index (int): Index of the image to retrieve.

        Returns:
            ImageItem: Object containing the loaded image and its metadata.
        """
        image_filename = self.image_filenames[index]
        image = read_image(image_filename, as_tensor=True)
        if self.transform:
            image = self.transform(image)

        return ImageItem(
            image=image,
            image_path=str(image_filename),
        )
Get image item at specified index.

        Args:
            index (int): Index of the image to retrieve.

        Returns:
            ImageItem: Object containing the loaded image and its metadata.
        
src/anomalib/data/predict.py