              if frameratio <= imgratio:
                  scale = framesize[0] / float(displayimg.size[0])
                  size = (framesize[0], int(displayimg.size[1] * scale))
              else:
                  scale = framesize[1] / float(displayimg.size[1])
                  size = (int(displayimg.size[0] * scale), framesize[1])
              logger.debug("Scaling: (scale: %s, size: %s", scale, size)
  
              # Hacky fix to force a reload if it happens to find corrupted
              # data, probably due to reading the image whilst it is partially
              # saved. If it continues to fail, then eventually raise.
 
</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     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])
 </s> add     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]) </s> remove                 size = self.get_current_size(name)
                self.previewtrain[name] = [Image.open(img), None, modified]
 </s> add                 size = self._get_current_size(name)
                self._previewtrain[name] = [Image.open(img), None, modified] </s> remove                 self.errcount = 0
 </s> add                 self._errcount = 0 </s> remove                                img, self.errcount)
                if self.errcount < 10:
                    self.errcount += 1
 </s> add                                img, self._errcount)
                if self._errcount < 10:
                    self._errcount += 1
                scale = frame_dims[1] / float(displayimg.size[1])
                size = (int(displayimg.size[0] * scale), frame_dims[1])
              if frameratio <= imgratio:
                  scale = framesize[0] / float(displayimg.size[0])
                  size = (framesize[0], int(displayimg.size[1] * scale))
              else:
                scale = frame_dims[1] / float(displayimg.size[1])
                size = (int(displayimg.size[0] * scale), frame_dims[1])
                scale = frame_dims[1] / float(displayimg.size[1])
                size = (int(displayimg.size[0] * scale), frame_dims[1])
              logger.debug("Scaling: (scale: %s, size: %s", scale, size)
  
              # Hacky fix to force a reload if it happens to find corrupted
              # data, probably due to reading the image whilst it is partially
              # saved. If it continues to fail, then eventually raise.
keep keep keep keep 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