          logger.debug("Got size: (name: '%s', width: '%s', height: '%s')",
                       name, img.width(), img.height())
          return img.width(), img.height()
  
      def resize_image(self, name, framesize):
          """ Resize the training preview image
              based on the passed in frame size """
          logger.debug("Resizing image: (name: '%s', framesize: %s", name, framesize)
          displayimg = self.previewtrain[name][0]
          if framesize:
              frameratio = float(framesize[0]) / float(framesize[1])
              imgratio = float(displayimg.size[0]) / float(displayimg.size[1])
  
              if frameratio <= imgratio:
                  scale = framesize[0] / float(displayimg.size[0])
                  size = (framesize[0], int(displayimg.size[1] * scale))
 
</s> remove                 scale = framesize[0] / float(displayimg.size[0])
                size = (framesize[0], int(displayimg.size[1] * scale))
 </s> add                 scale = frame_dims[0] / float(displayimg.size[0])
                size = (frame_dims[0], int(displayimg.size[1] * scale)) </s> remove         img = self.previewtrain[name][1]
 </s> add         img = self._previewtrain[name][1] </s> remove                 scale = framesize[1] / float(displayimg.size[1])
                size = (int(displayimg.size[0] * scale), framesize[1])
 </s> add                 scale = frame_dims[1] / float(displayimg.size[1])
                size = (int(displayimg.size[0] * scale), frame_dims[1]) </s> remove         if not self.previewtrain.get(name, None):
 </s> add         if not self._previewtrain.get(name, None): </s> remove         root = get_config().root
        config = get_config().user_config_dict
        r_width = root.winfo_width()
        r_height = root.winfo_height()
        w_ratio = config["options_panel_width"] / 100.0
        h_ratio = 1 - (config["console_panel_height"] / 100.0)
 </s> add         config_opts = self._config.user_config_dict
        r_width = self.winfo_width()
        r_height = self.winfo_height()
        w_ratio = config_opts["options_panel_width"] / 100.0
        h_ratio = 1 - (config_opts["console_panel_height"] / 100.0)
    def resize_image(self, name, frame_dims):
        """ Resize the training preview image based on the passed in frame size.

        If the canvas that holds the preview image changes, update the image size
        to fit the new canvas and refresh :attr:`previewtrain`.

        Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview
        """
        logger.debug("Resizing image: (name: '%s', frame_dims: %s", name, frame_dims)
        displayimg = self._previewtrain[name][0]
        if frame_dims:
            frameratio = float(frame_dims[0]) / float(frame_dims[1])
          logger.debug("Got size: (name: '%s', width: '%s', height: '%s')",
                       name, img.width(), img.height())
          return img.width(), img.height()
  
    def resize_image(self, name, frame_dims):
        """ Resize the training preview image based on the passed in frame size.

        If the canvas that holds the preview image changes, update the image size
        to fit the new canvas and refresh :attr:`previewtrain`.

        Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview
        """
        logger.debug("Resizing image: (name: '%s', frame_dims: %s", name, frame_dims)
        displayimg = self._previewtrain[name][0]
        if frame_dims:
            frameratio = float(frame_dims[0]) / float(frame_dims[1])
    def resize_image(self, name, frame_dims):
        """ Resize the training preview image based on the passed in frame size.

        If the canvas that holds the preview image changes, update the image size
        to fit the new canvas and refresh :attr:`previewtrain`.

        Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview
        """
        logger.debug("Resizing image: (name: '%s', frame_dims: %s", name, frame_dims)
        displayimg = self._previewtrain[name][0]
        if frame_dims:
            frameratio = float(frame_dims[0]) / float(frame_dims[1])
    def resize_image(self, name, frame_dims):
        """ Resize the training preview image based on the passed in frame size.

        If the canvas that holds the preview image changes, update the image size
        to fit the new canvas and refresh :attr:`previewtrain`.

        Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview
        """
        logger.debug("Resizing image: (name: '%s', frame_dims: %s", name, frame_dims)
        displayimg = self._previewtrain[name][0]
        if frame_dims:
            frameratio = float(frame_dims[0]) / float(frame_dims[1])
    def resize_image(self, name, frame_dims):
        """ Resize the training preview image based on the passed in frame size.

        If the canvas that holds the preview image changes, update the image size
        to fit the new canvas and refresh :attr:`previewtrain`.

        Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview
        """
        logger.debug("Resizing image: (name: '%s', frame_dims: %s", name, frame_dims)
        displayimg = self._previewtrain[name][0]
        if frame_dims:
            frameratio = float(frame_dims[0]) / float(frame_dims[1])
    def resize_image(self, name, frame_dims):
        """ Resize the training preview image based on the passed in frame size.

        If the canvas that holds the preview image changes, update the image size
        to fit the new canvas and refresh :attr:`previewtrain`.

        Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview
        """
        logger.debug("Resizing image: (name: '%s', frame_dims: %s", name, frame_dims)
        displayimg = self._previewtrain[name][0]
        if frame_dims:
            frameratio = float(frame_dims[0]) / float(frame_dims[1])
    def resize_image(self, name, frame_dims):
        """ Resize the training preview image based on the passed in frame size.

        If the canvas that holds the preview image changes, update the image size
        to fit the new canvas and refresh :attr:`previewtrain`.

        Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview
        """
        logger.debug("Resizing image: (name: '%s', frame_dims: %s", name, frame_dims)
        displayimg = self._previewtrain[name][0]
        if frame_dims:
            frameratio = float(frame_dims[0]) / float(frame_dims[1])
    def resize_image(self, name, frame_dims):
        """ Resize the training preview image based on the passed in frame size.

        If the canvas that holds the preview image changes, update the image size
        to fit the new canvas and refresh :attr:`previewtrain`.

        Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview
        """
        logger.debug("Resizing image: (name: '%s', frame_dims: %s", name, frame_dims)
        displayimg = self._previewtrain[name][0]
        if frame_dims:
            frameratio = float(frame_dims[0]) / float(frame_dims[1])
              imgratio = float(displayimg.size[0]) / float(displayimg.size[1])
  
              if frameratio <= imgratio:
                  scale = framesize[0] / float(displayimg.size[0])
                  size = (framesize[0], int(displayimg.size[1] * scale))
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 GUI Updates (#940)

* lib.gui: Update icons
* tools.cli: Add video filetype flag to mask input
* lib.gui.popup_configure: Refresh GUI on config save
* lib.gui._config: Add Icon size and load last session options
* lib.gui.control_helper - Add control modification tracking
* lib.gui - Add Projects and Last Session
- Main root title handled by projects
- Add Hotkeys
- Create projects module
- split fsw and fst filetypes
- Add last_session saving

* lib.project
- Documentation
- Ask confirm on closing unsaved project
-Fixups

* Track model folder changes
- Shuffle some globals
- Activate System Verbosity for GUI

* lib.gui.utils - Documentation and clean up
- lib.gui.custom_widgets - Create and document

* Add GUI config option to disable auto loading model stats 
lib/gui/utils.py