diplomat.wx_gui.fpe_editor.FPEEditor
- class diplomat.wx_gui.fpe_editor.FPEEditor(*args: Any, **kwargs: Any)[source]
Bases:
FrameMain Forward Backward Editor Frame.
- __init__(parent, video_hdl: VideoCapture, poses: Pose, names: List[str], plot_settings: Mapping[str, Any], crop_box: Tuple[int, int, int, int] | None, labeling_modes: List[PoseLabeler], score_engines: List[ScoreEngine], identity_swapper: IdentitySwapper | None = None, part_groups: List[str] | None = None, w_id=wx.ID_ANY, title='', pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name='FPEEditor')[source]
Construct a new FBEditor UI.
- Parameters:
parent – The parent window, can be None.
video_hdl – A cv2.VideoCapture, the video to display to the user.
data – A list of 1D numpy arrays, probability data for each body part…
poses – Pose object, being the poses produced by the FB Algorithm…
names – A list of strings, being the names of the body parts…
plot_settings – The video_metadata object from the predictor plugin, includes important point and video settings.
crop_box – The cropping box of the video which poses were actually predicted on. The format is: (x, y, width, height)…
labeling_modes – A list of pose labelers, labeling modes to enable in the UI.
score_engines – A list of scoring engines to produce scores in the UI.
identity_swapper – An identity swapper object, enables identity swapping functionality in the UI.
part_groups – An optional list of integers, the group to place a body part in when building the selection list on the side.
w_id – The WX ID of the window. Defaults to wx.ID_ANY
title – String title of the window. Defaults to “”.
pos – WX Position of the window. Defaults to wx.DefaultPosition.
size – The size of the window. Defaults to wx.DefaultSize.
style – The style of the WX Frame. Look at wx.Frame docs for supported styles.
name – The WX internal name of the window.
Methods
__init__(parent, video_hdl, poses, names, ...)Construct a new FBEditor UI.
on_tool(evt)PRIVATE: Triggered whenever a tool is clicked on in the toolbar....
set_fb_runner(func)Set the Forward/Backward runner function, which runs FB on the entire dataset.
set_frame_exporter(func)Set the frame exporting function, which exports current modified frames UI is showing...
Attributes
HIST_IDENTITY_SWAPHIST_POSE_CHANGETOOLBAR_ICON_SIZEGet the history object of this FB Editor, allows the user to add there own custom history events, and also manipulate this history.
Get the score engine displays.
- property history: History
Get the history object of this FB Editor, allows the user to add there own custom history events, and also manipulate this history.
- on_tool(evt: wx.CommandEvent)[source]
PRIVATE: Triggered whenever a tool is clicked on in the toolbar….
- property score_displays
Get the score engine displays.
- Returns:
A list of ScoreEngineDisplayer, being all the probability displays of this editor window.
- set_fb_runner(func: Callable[[], bool] | None)[source]
Set the Forward/Backward runner function, which runs FB on the entire dataset.
- Parameters:
func – A callable which accepts no arguments, and return a boolean determining if the history should be cleared. It is assumed this method already has access to all data to rerun FB on the data, and it is also assumed this function will manipulate the widgets of the FB Editor to have the updated data. (Specifically the score_displays, and the video_player.video_viewer).
- set_frame_exporter(func: Callable[[int, str, Path], Tuple[bool, str]] | None)[source]
Set the frame exporting function, which exports current modified frames UI is showing…
- Parameters:
func – The function to handle frame exporting. It will be passed an integer being the type of frames to export (0 for pre frame passes and 1 for post frame passes), a string being the format to save the file to (‘DLFS’ or ‘HDF5’) and a Path to where the user selected to save the frames, and is expected to return a boolean being if the export succeeded and a string being the error message displayed if it did not.