phase 4
This commit is contained in:
@@ -160,6 +160,39 @@ class AnalyzeRegionsDebugResponse:
|
||||
pair_count: int = 0
|
||||
|
||||
|
||||
# --- Field Segmentation ---
|
||||
|
||||
|
||||
@dataclass
|
||||
class SegmentFieldRequest:
|
||||
"""Request body for field segmentation."""
|
||||
image: str # base64 JPEG
|
||||
hue_low: int = 30
|
||||
hue_high: int = 85
|
||||
sat_low: int = 30
|
||||
sat_high: int = 255
|
||||
val_low: int = 30
|
||||
val_high: int = 255
|
||||
morph_kernel: int = 15
|
||||
min_area_ratio: float = 0.05
|
||||
|
||||
|
||||
@dataclass
|
||||
class SegmentFieldResponse:
|
||||
"""Response from field segmentation."""
|
||||
boundary: List[List[int]] = field(default_factory=list)
|
||||
coverage: float = 0.0
|
||||
mask_b64: str = "" # binary mask as base64 PNG (for downstream stages)
|
||||
|
||||
|
||||
@dataclass
|
||||
class SegmentFieldDebugResponse:
|
||||
"""Response from field segmentation with debug overlay."""
|
||||
boundary: List[List[int]] = field(default_factory=list)
|
||||
coverage: float = 0.0
|
||||
mask_overlay_b64: str = ""
|
||||
|
||||
|
||||
# --- Server Config ---
|
||||
|
||||
|
||||
@@ -193,5 +226,8 @@ INFERENCE_VIEWS = [
|
||||
RegionBox,
|
||||
AnalyzeRegionsResponse,
|
||||
AnalyzeRegionsDebugResponse,
|
||||
SegmentFieldRequest,
|
||||
SegmentFieldResponse,
|
||||
SegmentFieldDebugResponse,
|
||||
ConfigUpdate,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user