      preview_buffer = {}
  
      def show(self, image, name=''):
          try:
              if self.arguments.preview:
                  with self.lock:
                      self.preview_buffer[name] = image
              elif self.arguments.write_image:
                  cv2.imwrite('_sample_{}.jpg'.format(name), image)
          except Exception as e:
 
</s> remove         if self.arguments.log_changes:
            self.write_to_log(self.arguments.log_file, self.changes)
 </s> add         if self.args.log_changes:
            self.write_to_log(self.args.log_file_path, self.changes) </s> remove         for i in tqdm( range(0,len(img_list)) , desc=description, file=sys.stdout):
            renaming = self.set_renaming_method(self.arguments.log_changes)
 </s> add         for i in tqdm(range(0, len(img_list)), desc=description, file=sys.stdout):
            renaming = self.set_renaming_method(self.args.log_changes) </s> remove                 os.rename (src, dst)
 </s> add                 os.rename(src, dst) </s> remove                 src_basename = os.path.basename (src)
 </s> add                 src_basename = os.path.basename(src) </s> remove                     process_file (src, dst, self.changes)
 </s> add                     process_file(src, dst, self.changes)
            if self.arguments.redirect_gui:
                scriptpath = os.path.realpath(os.path.dirname(sys.argv[0]))
                img = '.gui_preview.png'
                imgfile = os.path.join(scriptpath, img)
                cv2.imwrite(imgfile, image)
            elif self.arguments.preview:
      preview_buffer = {}
  
      def show(self, image, name=''):
          try:
            if self.arguments.redirect_gui:
                scriptpath = os.path.realpath(os.path.dirname(sys.argv[0]))
                img = '.gui_preview.png'
                imgfile = os.path.join(scriptpath, img)
                cv2.imwrite(imgfile, image)
            elif self.arguments.preview:
                  with self.lock:
                      self.preview_buffer[name] = image
              elif self.arguments.write_image:
                  cv2.imwrite('_sample_{}.jpg'.format(name), image)
          except Exception as e:
keep keep keep keep 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/train.py