Node¶
-
class Node(location=
None, disabled=False, label=None, row=None, col=None)[source]¶ Bases:
JsonSerializableSingle vertex in a keypoint graph: a labeled point (row, col) used as a building block for
GraphNodes(e.g. pose keypoints, skeleton joints).Node for a single
GraphNodes.- Parameters:
- Usage Example:
import supervisely as sly from supervisely.geometry.graph import Node vertex = Node(sly.PointLocation(5, 5))
Methods
Convert a json dict to Node.
Convert the Node to a json dict.
Attributes
Display the Node when drawing or not.
Location of Node.
- classmethod from_json(data)[source]¶
Convert a json dict to Node. Read more about Supervisely format.
- to_json()[source]¶
Convert the Node to a json dict. Read more about Supervisely format.
- Returns:
Node in json format as a dict.
- Return type:
- Usage Example:
import supervisely as sly from supervisely.geometry.graph import Node vertex = Node(sly.PointLocation(5, 5)) vertex_json = vertex.to_json() print(vertex_json) # Output: { # "loc": [5, 5] # }
- transform_location(transform_fn)[source]¶
- property location : supervisely.geometry.point_location.PointLocation¶
Location of Node.
- Returns:
Location of Node.
- Return type: