feat(configs): implement Pydantic configuration system with type safety

This commit is contained in:
2026-01-31 12:19:11 +08:00
parent 1454647aa6
commit 9e9070bdb4
10 changed files with 628 additions and 78 deletions

View File

@@ -1,7 +1,7 @@
"""Image loading and preprocessing utilities."""
from pathlib import Path
from typing import List, Union
from typing import List, Optional, Union
import requests
from PIL import Image
@@ -52,7 +52,7 @@ def preprocess_image(image: Image.Image, size: int = 224) -> Image.Image:
def load_images_from_directory(
dir_path: Union[str, Path], extensions: List[str] = None
dir_path: Union[str, Path], extensions: Optional[List[str]] = None
) -> List[Image.Image]:
"""Load all images from a directory.