              elif self.input.fps is not None and self.__check_have_fps(['r']):
                  self.args.fps = self.input.fps
  
          # Processing transpose
          if self.args.transpose.lower() == "none":
              self.args.transpose = None
          else:
              self.args.transpose = self.args.transpose[1]
  
          # Processing degrees
 
</s> remove         if self.args.degrees.lower() == "none" or self.args.degrees == '':
 </s> add         if self.args.degrees is None \
                or self.args.degrees.lower() == "none" \
                or self.args.degrees == '': </s> remove         if self.args.ref_vid.lower() == "none" or self.args.ref_vid == '':
 </s> add         if self.args.ref_vid is None \
                or self.args.ref_vid == '': </s> remove         ff = FFmpeg(inputs=_inputs, outputs=_outputs)
        Effmpeg.__run_ffmpeg(ff)
 </s> add         Effmpeg.__run_ffmpeg(inputs=_inputs, outputs=_outputs) </s> remove                **kwargs):
 </s> add                preview=None, **kwargs): </s> remove         self.opts = self.extract_options(subparsers)
        self.utils = Utils(self.opts, calling_file=cmd[0])
        self.root = FaceswapGui(self.utils, calling_file=cmd[0])

    @staticmethod
    def check_display():
        """ Check whether there is a display to output the GUI. If running on
            Windows then assume not running in headless mode """
        if not os.environ.get('DISPLAY', None) and os.name != 'nt':
            if os.name == 'posix':
                print('macOS users need to install XQuartz. '
                      'See https://support.apple.com/en-gb/HT201341')
            return False
        return True

    @staticmethod
    def check_tkinter_available():
        """ Check whether TkInter is installed on user's machine """
        tkinter_vars = [tk, ttk, filedialog, messagebox, TclError]
        if any(var is None for var in tkinter_vars):
            print(
                "It looks like TkInter isn't installed for your OS, so "
                "the GUI has been "
                "disabled. To enable the GUI please install the TkInter "
                "application.\n"
                "You can try:\n"
                "  Windows/macOS:      Install ActiveTcl Community "
                "Edition from "
                "www.activestate.com\n"
                "  Ubuntu/Mint/Debian: sudo apt install python3-tk\n"
                "  Arch:               sudo pacman -S tk\n"
                "  CentOS/Redhat:      sudo yum install tkinter\n"
                "  Fedora:             sudo dnf install python3-tkinter\n",
                file=sys.stderr)
            return False
        return True

    def extract_options(self, subparsers):
        """ Extract the existing ArgParse Options """
        opts = {cmd: subparsers[cmd].argument_list + subparsers[cmd].optional_arguments
                for cmd in subparsers.keys()}
        for command in opts.values():
            for opt in command:
                if opt.get('help', '') == SUPPRESS:
                    command.remove(opt)
                ctl, sysbrowser, filetypes, actions_open_types = self.set_control(opt)
                opt['control_title'] = self.set_control_title(
                    opt.get('opts', ''))
                opt['control'] = ctl
                opt['filesystem_browser'] = sysbrowser
                opt['filetypes'] = filetypes
                opt['actions_open_types'] = actions_open_types
        return opts

    @staticmethod
    def set_control_title(opts):
        """ Take the option switch and format it nicely """
        ctltitle = opts[1] if len(opts) == 2 else opts[0]
        ctltitle = ctltitle.replace('-', ' ').replace('_', ' ').strip().title()
        return ctltitle

    @staticmethod
    def set_control(option):
        """ Set the control and filesystem browser to use for each option """
        sysbrowser = None
        filetypes = None
        actions_open_type = None
        ctl = ttk.Entry
        if option.get('action', '') == FullPaths:
            sysbrowser = 'folder'
        elif option.get('action', '') == DirFullPaths:
            sysbrowser = 'folder'
        elif option.get('action', '') == FileFullPaths:
            sysbrowser = 'load'
            filetypes = option.get('filetypes', None)
        elif option.get('action', '') == ComboFullPaths:
            sysbrowser = 'combo'
            actions_open_type = option['actions_open_type']
            filetypes = option.get('filetypes', None)
        elif option.get('choices', '') != '':
            ctl = ttk.Combobox
        elif option.get('action', '') == 'store_true':
            ctl = ttk.Checkbutton
        return ctl, sysbrowser, filetypes, actions_open_type
 </s> add         self.root = FaceswapGui(pathscript)
        if self.args.transpose is None or \
                self.args.transpose.lower() == "none":
              elif self.input.fps is not None and self.__check_have_fps(['r']):
                  self.args.fps = self.input.fps
  
          # Processing transpose
        if self.args.transpose is None or \
                self.args.transpose.lower() == "none":
              self.args.transpose = None
          else:
              self.args.transpose = self.args.transpose[1]
  
          # Processing degrees
keep keep keep keep replace keep keep keep keep keep
 Gui v3.0b (#436)

* GUI version 3 (#411)

GUI version 3.0a

* Required for Shaonlu mode (#416)

Added two modes - Original and Shaonlu.
The later requires this file to function.

* model update (#417)

New, functional Original 128 model

* OriginalHighRes 128 model update (#418)

Required for OriginalHighRes Model to function

* Add OriginalHighRes 128 update to gui branch (#421)

* Required for Shaonlu mode (#416)

Added two modes - Original and Shaonlu.
The later requires this file to function.

* model update (#417)

New, functional Original 128 model

* OriginalHighRes 128 model update (#418)

Required for OriginalHighRes Model to function

* Dev gui (#420)

* reduce singletons

* Fix tooltips and screen boundaries on popup

* Remove dpi fix. Fix context filebrowsers

* fix tools.py execution and context filebrowser bugs

* Bugfixes (#422)

* Bump matplotlib requirement. Fix polyfit. Fix TQDM on sort

* Fixed memory usage at 6GB cards. (#423)

- Switched default encoder to ORIGINAL
- Fixed memory consumption. Tested with geforce gtx 9800 ti with 6Gb; batch_size 8 no OOM or memory warnings now.

* Staging (#426)

* altered trainer (#425)

altered trainer to accommodate with model change

* Update Model.py (#424)

- Added saving state (currently only saved epoch number, to be extended in future)
- Changed saving to ThreadPoolExecutor

* Add DPI Scaling (#428)

* Add dpi scaling

* Hotfix for effmpeg. (#429)

effmpeg fixed so it works both in cli and gui.
Initial work done to add previewing feature to effmpeg (currently does nothing).
Some small spacing changes in other files to improve PEP8 conformity.

* PEP8 Linting (#430)

* pep8 linting

* Requirements version bump (#432)

* altered trainer (#425)

altered trainer to accommodate with model change

* Update Model.py (#424)

- Added saving state (currently only saved epoch number, to be extended in future)
- Changed saving to ThreadPoolExecutor

* Requirements version bump (#431)

This bumps the versions of:

    scandir
    h5py
    Keras
    opencv-python

to their latest vesions.

Virtual Environment will need to be setup again to make use of these.

* High DPI Fixes (#433)

* dpi scaling

* DPI Fixes

* Fix and improve context manager. (#434)

effmpeg tool:
Context manager for GUI fixed.

Context manager in general:
Functionality extended to allow configuring the context with both:
  command -> action
  command -> variable (cli argument) -> action

* Change epoch option to iterations

* Change epochs to iterations 
tools/effmpeg.py