diplomat.utils.tweak_ui.TweakUI

class diplomat.utils.tweak_ui.TweakUI[source]

Bases: object

The tweak UI manager. Provides a functionality for creating a UI for modifying user tracks. Should be used by frontends to implementing DIPLOMAT’s tweak command functionality.

__init__()[source]

Create a tweak UI manager, which can be used to make modifications to user tracks passed to it.

Raises

UIImportError – If the UI manager it is unable to import needed packages for creating a UI.

Methods

__init__()

Create a tweak UI manager, which can be used to make modifications to user tracks passed to it.

tweak(parent, video_path, poses, ...[, make_app])

Load a lighter version of the supervised UI to allow for minor modifications to user saved tracking data.

tweak(parent, video_path: PathLike, poses: Pose, bodypart_names: List[str], video_metadata: Dict[str, Any], num_outputs: int, crop_box: Optional[Tuple[int, int, int, int]], on_end: Callable[[bool, Pose], Any], make_app: bool = True)[source]

Load a lighter version of the supervised UI to allow for minor modifications to user saved tracking data.

Parameters
  • parent – The parent wx widget of the UI. Can be None, indicating no parent widget, or an independent window.

  • video_path – The path to the video to display in the editor.

  • poses – The poses for the given video, contains x and y locations and likelihood values. Must be converted to a Pose object.

  • bodypart_names – A list of strings, the names for each body part.

  • video_metadata – Various required video info needed to set up the UI to handle the video and specify appearance settings. See the video_metadata attribute of Predictors to get more information about the required attributes for this dictionary.

  • crop_box – A tuple of 4 integers (x, y, width, height), specifying the box to crop results to within the video.

  • on_end – A callable that is executed when the user attempts to save there results or close the window. Two arguments are passed, a boolean specifying if the user wants to save the modified results (True if they do), and a Pose object containing the user modified poses.

  • make_app – A boolean. If true, this function will create a wx app and run its main loop, meaning execution will pause until the user saves their results or closes the window. If false, no app is made. Defaults to true.

Returns