diplomat.wx_gui.point_edit.PointEditor
- class diplomat.wx_gui.point_edit.PointEditor(*args: Any, **kwargs: Any)[source]
Bases:
PanelThe Point Editor. Combines a PointViewNEdit and A ColoredRadio box to allow the user to edit any body parts on any frame.
- __init__(parent, video_hdl: VideoCapture, crop_box: Tuple[int, int, int, int] | None, poses: Pose, bp_names: List[str], labeling_modes: List[PoseLabeler], group_list: List[int] | None = None, skeleton_info: StorageGraph = None, colormap: str = None, shape_list: str = None, plot_threshold: float = 0.1, point_radius: int = 5, point_alpha: float = 0.7, line_thickness: int = 1, w_id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TAB_TRAVERSAL, name='PointEditor')[source]
Construct a new PointEdit
- Parameters:
parent – The wx Control Parent.
video_hdl – The cv2 VideoCapture to play video from. One should avoid never manipulate the video capture once passed to this constructor, as the handle will be passed to another thread for fast video loading.
crop_box – A tuple of 4 integers being the x, y, width, and height of the cropped area of the video.
poses – The Pose object for the above video, used as initial point data.
bp_names – A list of strings, being the names of the body parts.
labeling_modes – A list of pose labelers, the labeling modes to make available for selection.
group_list – Optional list of integers, groups to group body parts into.
colormap – The matplotlib colormap to use when coloring the points.
shape_list – A iterable or generator of strings, being the shapes to use to draw each point.
plot_threshold – The probability threshold at which to not plot a points. Defaults to 0.1.
point_radius – Determines the size of the points. Defaults to 5.
point_alpha – Determines the alpha level of the points. Defaults to 0.7.
line_thickness – The thickness to draw occluded poses with. Defaults to 1.
w_id – The wx ID.
pos – The position of the widget.
size – The size of the widget.
style – The style of the widget.
name – The name of the widget.
Methods
__init__(parent, video_hdl, crop_box, poses, ...)Construct a new PointEdit
Get the selected body parts.
on_radio_change(event)PRIVATE: Triggered when the selected body part is changed.
set_body_parts(part)Set the selected body parts.
toggle_select_box(event, value)PRIVATE: Triggered when editing a point in the PointViewNEdit, disables to ColoredRadioBox to keep the body part from being changed mid-frame.
- get_body_parts() ndarray[source]
Get the selected body parts.
- Returns:
An array of integers, the indexes of the selected body parts.