| from __future__ import annotations | |
| from abc import ABC, abstractmethod | |
| from collections.abc import Sequence | |
| from PIL import Image | |
| from src.schemas.detection import DetectionResult | |
| class Detector(ABC): | |
| """Discovers and localizes radiographic findings (Stage 1).""" | |
| def detect( | |
| self, | |
| images: Sequence[Image.Image], | |
| input_images: list[str], | |
| case_id: str | None = None, | |
| ) -> tuple[DetectionResult, list[Image.Image]]: | |
| """Return (DetectionResult, processed_images). | |
| processed_images are the padded versions of the input images used | |
| internally during detection; they are forwarded to Stage 2 and | |
| visualization so that coordinate spaces remain consistent. | |
| """ | |