FelonFinder module

This module contains the whole graphical interface. This is truly the face of Felon Finder.

class FelonFinder.Filter(master)[source]

Bases: object

This class contains the filter menu of the program. Once it is launched, the main window of the program is disabled to avoid mistakes.

close_window()[source]

This function closes the window.

create_filter()[source]

This function creates the initial filter menu.

new_step()[source]

This function creates again the selection menu for each new step of the filter creation.

no_image_selected()[source]

This function refreshes the proposed images when the user presses the “Aucune image” button.

show_imgs()[source]

This function shows the images usable to create the filter.

show_selection_menu()[source]

This function creates the buttons used to create the filters with the selected images.

show_which_step()[source]

This function keeps the user aware of the current step of filter creation.

valueslideretapes(value)[source]

This function forces the slider to show only integer values.

Parameters:

value – Value of the slider

class FelonFinder.MainScreen(master)[source]

Bases: object

This class contains the main window of the program.

add_image_to_showed_list(image)[source]

This function keeps the given image in memory through an array.

Parameters:

image – Image to keep in memory

back_to_last_images()[source]

This function removes the last showed images and changes the buttons to make them show to the ones before that. The reference list is also emptied.

check_validation()[source]

This function applies the VAE and the genetic algorithm to the selected images and shows the decoded results in the buttons. The selected images are then kept in reference.

close_window()[source]

This function asks for the user’s confirmation to close the program.

filterwindow()[source]

This function launches the filter window or shows it if it was behind.

get_random_images()[source]

This function gets random pictures from the database after the user clicked on “Nouvelles photos”

options_window()[source]

This function launches the options window or shows it if it was behind.

refresh()[source]

This function applies again the VAE and the genetic algorithm to the previously selected and treated images and shows the decoded results in the buttons. The selected images are still kept in reference.

reset_ref()[source]

This function clears the reference images array and puts back unknown.png faces in the reference labels.

save_images()[source]

This function saves the selected pictures in the selected path if it exists, else asks what path to choose.

select_image(image)[source]

This function turns the buttons red or blue and their hover color to darker red or darker blue according to if they were selected or un-selected by the user.

Parameters:

image – The selected image

show_combobox()[source]

This function shows the drop down list for filter selection.

tutorial_window()[source]

This function launches the tutorial window or shows it if it was behind.

udpate_combobox()[source]

This function refreshes the filters drop down list once the filter menu is closed.

update_images(images_list)[source]

This function updates the showed images to keep track of the images in the main buttons.

Parameters:

images_list – An array of the new images to show

update_label()[source]

This function updates the labels to keep the user aware of the amount of images selected and help them choose their next action.

class FelonFinder.Options(master)[source]

Bases: object

This class contains the options menu of the program. Once it is launched, the main window of the program is disabled to avoid mistakes.

about()[source]

This function opens a pop-up message with the authors and specials thanks.

cancel_changes(config)[source]

This function cancels the changes that happened in the options menu when the user clicks on “Annuler” or closes the options window. It also closes the window and makes the main windows usable again.

Parameters:

config – Configuration file used to come back to the previous values

change_path_label()[source]

This function changes the path to the saved images if the user enters one.

reset_config(config)[source]

This function reinitializes the parameters to the very first ones, according to the [initial] section of the config.ini file. It also closes the window and makes the main windows usable again.

Parameters:

config – Configuration file used to read the initial parameters.

slider1(value)[source]

This function changes the value showed above the mean slider according to where the cursor is.

Parameters:

value – Value of the cursor

slider2(value)[source]

This function changes the value showed above the variance slider according to where the cursor is.

Parameters:

value – Value of the cursor

switch_event()[source]

This function changes the mode to light if it was dark, or dark if it was light.

validate_params(config)[source]

This function writes the parameters entered by the user in the config file, section [current], which validates them and uses them for the rest of the execution and the other executions. It also closes the window and makes the main windows usable again.

Parameters:

config – Configuration file used to write the parameters

validate_path_change(label_string, config)[source]

This function validates the path changes by putting the new path in the config.ini file if one was selected. It also closes the window and makes the main windows usable again.

Parameters:
  • label_string – Value of the path string

  • config – ConfigParser object used to write the new configuration

class FelonFinder.SplashScreen(master)[source]

Bases: object

This class contains the splash screen for the project and the loading for the main window.

loading()[source]

This function loads the time and resource consuming for the main program before showing the main window.

class FelonFinder.Tutorial(master)[source]

Bases: object

This class contains the tutorial window with a link to the github repository of the project.

callback(url)[source]

This function opens a new tab in the user’s web browser to the github repository of the project.

Parameters:

url – Link of the github repository

This function removes the underlining and makes the link label a bit brighter when the user stops hovering over it.

close_window()[source]

This function closes the window.

This function underlines and darkens the link label when the user hovers over it.

FelonFinder.center_window_on_screen(window, width, height)[source]

This function centers the given window on the screen with the given width and height.

Parameters:
  • window – Window to be centered

  • width – Width to be given to the window

  • height – Height to be given to the window

FelonFinder.create_root_closing_handler(root)[source]

This function asks for the user’s confirmation to close the program.

Parameters:

root – Main window of the program.

FelonFinder.main()[source]

This function launches the loading splash screen for the program.

FelonFinder.resource_path(relative_path)[source]

This function wraps a relative path with dirname to help with the assets.

Parameters:

relative_path – Relative os.path-like path from the root of the project

Returns:

The wrapped path for a relative file or folder.