Images

class lib.gui.utils.image.Images

Bases: object

The centralized image repository for holding all icons and images required by the GUI.

This class should be initialized on GUI startup through initialize_images(). Any further access to this class should be through get_images().

Attributes Summary

icons

The faceswap icons for all parts of the GUI.

preview_extract

PreviewTrain The object handling the training preview images

preview_train

PreviewTrain The object handling the training preview images

Methods Summary

delete_preview()

Delete the preview files in the cache folder and reset the image cache.

Attributes Documentation

icons

The faceswap icons for all parts of the GUI. The dictionary key is the icon name (str) the value is the icon sized and formatted for display (PIL.ImageTK.PhotoImage).

Example

>>> icons = get_images().icons
>>> save = icons["save"]
>>> button = ttk.Button(parent, image=save)
>>> button.pack()
Type:

dict

preview_extract

PreviewTrain The object handling the training preview images

preview_train

PreviewTrain The object handling the training preview images

Methods Documentation

delete_preview() None

Delete the preview files in the cache folder and reset the image cache.

Should be called when terminating tasks, or when Faceswap starts up or shuts down.

Return type:

None

delete_preview() None

Delete the preview files in the cache folder and reset the image cache.

Should be called when terminating tasks, or when Faceswap starts up or shuts down.

Return type:

None

property icons: dict[str, PhotoImage]

The faceswap icons for all parts of the GUI. The dictionary key is the icon name (str) the value is the icon sized and formatted for display (PIL.ImageTK.PhotoImage).

Example

>>> icons = get_images().icons
>>> save = icons["save"]
>>> button = ttk.Button(parent, image=save)
>>> button.pack()
Type:

dict

property preview_extract: PreviewExtract

PreviewTrain The object handling the training preview images

property preview_train: PreviewTrain

PreviewTrain The object handling the training preview images