LEGENDFTW/image-segmentation-explorer
0
1"""utils.py — I/O helpers."""2 3import os4import numpy as np5from PIL import Image6 7SAMPLE_DIR = os.path.join(os.path.dirname(__file__), "sample_images")8 9 10def load_sample_image(filename: str) -> np.ndarray:11 path = os.path.join(SAMPLE_DIR, filename)12 if not os.path.exists(path):13 raise FileNotFoundError(f"Sample image not found: {path}")14 return np.array(Image.open(path).convert("RGB"))15 