AUGui¶
-
class
AUGui.
AUGui
(parent, frame_id, name, curr_directory, path_to_csv=None)¶ Main GUI
-
bind_to_canvas
()¶ Binds necessary events to canvas.
Returns: None.
-
click_on_emotion
(event)¶ Event handler for when an emotion is chosen from the list of emotions. Shows emotion templates.
Parameters: event – Unused Effects: Launches a wx.Dialog
with the emotion templates.Returns: None.
-
click_on_pic
(event)¶ Event handler for when an image is chosen from the list of images. Updates so clicked pic is shown.
Modifies: self.imageIndex to the index of the current image. Parameters: event – Provides the name of the picture chosen. Returns: None.
-
evt_reorder_pics
(event=None)¶ Event handling wrapper for reordering pictures. If pictures are currently ordered by index, orders by prominence and vice versa.
Parameters: event – Unused. Returns: None
-
on_key_press
(event)¶ Event handler for key press. If the right arrow key is pressed, displays the next image in the directory (in lexicographically sorted order). If the left arrow key is pressed, displays the previous image in the directory.
Parameters: event (wx.Event) – Keypress.
-
pop_dialog
(name, string)¶ Shows a new text dialog with name equal to name and text equal to string.
Parameters: - name – Name of dialog.
- string – Text to display.
Returns: None
-
redraw
()¶ Redraws canvas, zooms.
Returns: None
-
reorder_pics
(order_type)¶ Reorders pictures according to the specified order type.
Parameters: order_type – Either ‘Index’ or ‘Prominence’. Returns: None
-
rm_dir
(event=None)¶ Removes the temporary directory created by this, if it exists. :param event: Unused. :return: None
-
show_entire_video
(landmarks)¶ Shows entire video, with or without landmarks based on params.
Requires: Cropped video saved as ‘inter_out.mp4’ in cwd and cropped video with landmarks saved as ‘out.mp4’ in cwd (both from CropAndOpenFace). Parameters: landmarks (bool.) – Whether landmarks should be displayed. Returns: None
-
show_im
()¶ Changes currently displayed image to the image at self.imageIndex.
Returns: None
-
show_landmarks
(event)¶ If landmarks are available, either shows or hides face landmarks based on whether or not they are currently present: if shown, hides them and vice versa. If landmarks are unavailable, shows a dialog with that information.
Parameters: event – Unused. Returns: None
-
show_video_around_frames
()¶ Displays media window with video with second before and after frame.
Returns: None
-
-
class
AUGui.
VidPanel
(parent, id, scorer)¶ Panel for showing video. Code originally from https://www.daniweb.com/programming/software-development/code/216704/wxpython-plays-audio-and-video-files.
-
onLoadFile
(evt)¶ Event handler for loading a file. Launches a dialog for picking a file to load.
Parameters: evt – Unused.
-
onPause
(evt)¶ Event handler for pausing a video.
Parameters: evt – Unused. Returns: None
-
onPlay
(evt)¶ Event handler for playing a video.
Parameters: evt – Unused. Returns: None
-
onSeek
(evt)¶ Event handler for seeking a video.
Parameters: evt – Unused. Returns: None
-
onStop
(evt)¶ Event handler for stopping a video.
Parameters: evt – Unused. Returns: None
-
onTimer
(evt)¶ Event handler for updating timers.
Parameters: evt – Unused. Returns: None
-
-
AUGui.
au_name_dict
()¶ Creates a mapping between Action Unit numbers and the associated names
Returns: Dictionary with mapping
-
AUGui.
csv_emotion_reader
(csv_path)¶ Reads emotions from csv file.
Parameters: csv_path – Path to csv file. Returns: Dictionary mapping filenames (from csv) to emotions labelled in filename.
-
AUGui.
make_images
()¶ Finds all png images in given directory.
Returns: Sorted list of png images, 0. Note
Current working directory must be set before calling this function.
-
AUGui.
prevalence_score
(emotionDict)¶ Calculate a prevalence score for the max emotion in a emotion dictionary
Parameters: emotionDict – Dictionary mapping one of the basic emotions to its corresponding score (calculated by AUScorer) Returns: Score calculated using both value of highest value emotion as well as how prevalent that emotion is
-
AUGui.
update_emotion_list
(scorer, emotion_list, index)¶ Updates list of emotions :param scorer: AU scorer :type scorer: AUScorer.AUScorer :param emotion_list: List of emotions to update :type emotion_list: wx.ListBox :param index: image index :return: None