  
  from lib.cli import FullPaths
  from lib.Serializer import JSONSerializer
  
  # Users without tkinter distrubtion packages or without an X-Console will error out
  # importing tkinter. Therefore run a check on these and only import if required 
  tk = None
  ttk = None
  filedialog = None
  
  def import_tkinter(command):
      ''' Perform checks when importing tkinter module to ensure that GUI will load '''
      global tk
      global ttk
      global filedialog
      try:
          import tkinter
          from tkinter import ttk
          from tkinter import filedialog
          tk = tkinter
      except ImportError:
          if 'gui' in command:
              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')
          return False
      return True    
  
  def check_display(command):
      # 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 'gui' in command:
              print ('Could not detect a display. The GUI has been disabled')
          return False
      return True
  
  class FaceswapGui(object):
      ''' The Graphical User Interface '''
      def __init__(self, options, parser):
          self.gui = tk.Tk()
 
</s> remove class FaceswapGui(object):
    ''' The Graphical User Interface '''
    def __init__(self, options, parser):
        self.gui = tk.Tk()
 </s> add # An error will be thrown when importing tkinter for users without tkinter
# distribution packages or without an X-Console. Therefore if importing fails
# no attempt will be made to instantiate the gui.
try:
    import tkinter as tk
    from tkinter import ttk
    from tkinter import filedialog
    from tkinter import messagebox
    from tkinter import TclError
except ImportError:
    tk = None
    ttk = None
    filedialog = None
    messagebox = None
    TclError = None

class Utils(object):
    """ Inter-class object holding items that are required across classes """

    def __init__(self, options, calling_file="faceswap.py"): </s> remove import re
 </s> add from lib.cli import FullPaths </s> remove     ''' Main GUI Control '''
    def __init__ (self, subparser, subparsers, parser, command, description='default'):
    # Don't try to load the GUI if there is no display or there are problems importing tkinter
 </s> add     """ Main GUI Control """

    def __init__(self, subparser, subparsers, command, description='default'):
        # Don't try to load the GUI if there is no display or there are
        # problems importing tkinter </s> remove # DLIB is a GPU Memory hog, so the following modules should only be imported when required
 </s> add # DLIB is a GPU Memory hog, so the following modules should only be imported
# when required </s> remove        
        self.parser = parser
 </s> add         self.arguments = None
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
  
  from lib.cli import FullPaths
  from lib.Serializer import JSONSerializer
  
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
PATHSCRIPT = os.path.realpath(os.path.dirname(sys.argv[0]))
  
  class FaceswapGui(object):
      ''' The Graphical User Interface '''
      def __init__(self, options, parser):
          self.gui = tk.Tk()
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 GUI v0.2.1b (#352)

* Code refactor

* Console Added

* Add graphing with matplotlib

* Add GUI preview support

* Improve import handling.

* Add GUI integration for tools.py (Launch tools.py with the gui command)

* Reformat to conform to PEP8.

* Add Tooltips, 

* Make panels user adjustable

* Fix convert.py Sharpen default value 
scripts/gui.py