Skip to content

comet_ml.Polygon ¶

Polygon(
    points: List[Point],
    label: str,
    score: Optional[float] = None,
    id: Optional[str] = None,
    metadata: Optional[Dict[str, Any]] = None,
)

A data structure containing an annotation for a collection of polygons.

Creates a polygon annotation. A polygon must contain at least three (x, y) points. These values are given in pixels in association with the original image size.

Parameters:

  • points (list of Point) –

    a list of (x, y) pairs.

  • label (str) –

    A name; could be class name (like "dog") or specific item.

  • score (float, default: None ) –

    A value between 0 and 1.

  • id (str, default: None ) –

    A user-given ID for polygon.

  • metadata (dict, default: None ) –

    Additional metadata to be associated with the polygon.

Functions¶

to_dict ¶

to_dict() -> Dict[str, Any]
Sep. 4, 2024