mirror of
https://github.com/zebrajr/faceswap.git
synced 2026-01-15 12:15:15 +00:00
Refactoring
- Change saved previews to PNG - Split lib.gui.utils - Disable flake8 on __init__ imports
This commit is contained in:
@@ -494,22 +494,21 @@ class Train(): # pylint:disable=too-few-public-methods
|
||||
The preview image to be displayed and/or written out
|
||||
name: str, optional
|
||||
The name of the image for saving or display purposes. If an empty string is passed
|
||||
then it will automatically be names. Default: ""
|
||||
then it will automatically be named. Default: ""
|
||||
"""
|
||||
logger.debug("Updating preview: (name: %s)", name)
|
||||
try:
|
||||
scriptpath = os.path.realpath(os.path.dirname(sys.argv[0]))
|
||||
if self._args.write_image:
|
||||
logger.debug("Saving preview to disk")
|
||||
img = "training_preview.jpg"
|
||||
img = "training_preview.png"
|
||||
imgfile = os.path.join(scriptpath, img)
|
||||
cv2.imwrite(imgfile, image) # pylint: disable=no-member
|
||||
logger.debug("Saved preview to: '%s'", img)
|
||||
if self._args.redirect_gui:
|
||||
logger.debug("Generating preview for GUI")
|
||||
img = ".gui_training_preview.jpg"
|
||||
imgfile = os.path.join(scriptpath, "lib", "gui",
|
||||
".cache", "preview", img)
|
||||
img = ".gui_training_preview.png"
|
||||
imgfile = os.path.join(scriptpath, "lib", "gui", ".cache", "preview", img)
|
||||
cv2.imwrite(imgfile, image) # pylint: disable=no-member
|
||||
logger.debug("Generated preview for GUI: '%s'", imgfile)
|
||||
if self._args.preview:
|
||||
|
||||
Reference in New Issue
Block a user