Skip to content

kernel: bbox/polygon geometry as a pydantic discriminated union (replaces Annotation.geometry: dict) #10

Description

@JArmandoAnaya

Context

The bootstrap left Annotation.geometry: dict. The wire format needs real types now:
exporters, the API contract and the TS generation all depend on it.

Deliverables

  • Discriminated union on a type field: BboxGeometry {x, y, width, height},
    PolygonGeometry {points: [[x,y], ...]} (≥3 points, non-self-intersecting not
    validated in M1 — document), ClassificationGeometry {} (tag, no coordinates).
  • Coordinates in the asset's native reference frame (pixels), floats, never normalized —
    documented in docstrings (exporter concern).
  • The union is designed to extend (polyline, keypoints, 3D) without breaking the
    discriminator.

Acceptance criteria

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kernelvisionset.kernel — domain, ports, adapters, servicesm1M1 — Living kernel (0.0.1-alpha.1)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions