This commit is contained in:
2026-03-30 07:22:14 -03:00
parent d0707333fd
commit 4220b0418e
182 changed files with 3668 additions and 5231 deletions

View File

@@ -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,
]