paralleldomain.model.annotation.polygon_2d¶
- class Polygon2D(lines, class_id, instance_id=-1, attributes=<factory>)¶
A closed polygon made up of a collection of 2D Lines.
- Parameters:
lines (
List[Line2DBaseGeometry[TypeVar(T,int,float)]]) –Polygon2D.linesclass_id (
int) –Polygon2D.class_idinstance_id (
int) –Polygon2D.instance_idattributes (
Dict[str,Any]) –Polygon2D.attributes
- lines¶
Ordered list of
Line2Dinstances
- class_id¶
Class ID of the polygon. Can be used to lookup more details in
ClassMap.
- instance_id¶
Instance ID of annotated object. Can be used to cross-reference with other instance annotation types, e.g.,
InstanceSegmentation2DorInstanceSegmentation3D. If unknown defaults to -1.
- attributes¶
Dictionary of arbitrary object attributes.
- to_numpy()¶
Returns all ordered vertices as a numpy array of shape (N x 2).
- property length¶
Returns the length of the line.