adhisetiawan's picture
Deploy CXR report generation demo
16d6749
Raw
History Blame Contribute Delete
619 Bytes
from __future__ import annotations
from abc import ABC, abstractmethod
from PIL import Image
from src.schemas.segmentation import MaskResult
class Segmenter(ABC):
"""Segments a detected finding given its bounding box (Stage 2)."""
@abstractmethod
def segment(
self,
image: Image.Image,
bbox_normalized: list[int],
finding_label: str,
image_path: str,
image_index: int,
) -> MaskResult:
"""Return a MaskResult for one finding on one image view.
bbox_normalized: [y0, x0, y1, x1] in [0, 1000] space (matches BBox.box_2d).
"""