cascade.utils.vision#

class cascade.utils.vision.FolderImageDataset(root: str, backend: Literal['cv2', 'PIL'] = 'PIL', *args: Any, **kwargs: Any)[source]#

Simple dataset for image folder with lazy loading. Accepts the path to the folder with images. In each __getitem__ call invokes opencv imread on image and returns it if it exists.

Supports opencv or pillow backends

__init__(root: str, backend: Literal['cv2', 'PIL'] = 'PIL', *args: Any, **kwargs: Any) None[source]#
Parameters:
  • root (str) – The folder with images. Should contain image files only

  • backend (Literal["cv2", "PIL"], optional) – What library to use to load images, by default “PIL”