                      logger.error("Failed to convert image: '%s'. Reason: %s",
                                   item["filename"], str(err))
                      image = item["image"]
                      # UNCOMMENT THIS CODE BLOCK TO PRINT TRACEBACK ERRORS
                      # import sys
                      # import traceback
                      # exc_info = sys.exc_info()
                      # traceback.print_exception(*exc_info)
  
                  logger.trace("Out queue put: %s", item["filename"])
                  out_queue.put((item["filename"], image))
          logger.debug("Completed convert process")
          # Signal that this process has finished
          if completion_queue is not None:
 
</s> remove         set_system_verbosity(self.args.loglevel)
        thread = self.start_thread()
        # queue_manager.debug_monitor(1)
 </s> add         set_system_verbosity(self._args.loglevel)
        thread = self._start_thread()
        # from lib.queue_manager import queue_manager; queue_manager.debug_monitor(1) </s> remove from lib.queue_manager import queue_manager  # noqa pylint:disable=unused-import
 </s> add  </s> remove from lib.model import masks
 </s> add  </s> remove """ The script to run the training process of faceswap """
 </s> add """ Main entry point to the training process of FaceSwap """ </s> remove from lib.model.masks import get_available_masks
 </s> add 
                    # import sys ; import traceback
                    # exc_info = sys.exc_info() ; traceback.print_exception(*exc_info)
                      logger.error("Failed to convert image: '%s'. Reason: %s",
                                   item["filename"], str(err))
                      image = item["image"]
                      # UNCOMMENT THIS CODE BLOCK TO PRINT TRACEBACK ERRORS
                    # import sys ; import traceback
                    # exc_info = sys.exc_info() ; traceback.print_exception(*exc_info)
                    # import sys ; import traceback
                    # exc_info = sys.exc_info() ; traceback.print_exception(*exc_info)
                    # import sys ; import traceback
                    # exc_info = sys.exc_info() ; traceback.print_exception(*exc_info)
                    # import sys ; import traceback
                    # exc_info = sys.exc_info() ; traceback.print_exception(*exc_info)
                    # import sys ; import traceback
                    # exc_info = sys.exc_info() ; traceback.print_exception(*exc_info)
                  logger.trace("Out queue put: %s", item["filename"])
                  out_queue.put((item["filename"], image))
          logger.debug("Completed convert process")
          # Signal that this process has finished
          if completion_queue is not None:
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Smart Masks - Training Implementation (#914)

* Smart Masks - Training

- Reinstate smart mask training code
- Reinstate mask_type back to model.config
- change 'replicate_input_mask to 'learn_mask'
- Add learn mask option
- Add mask loading from alignments to plugins.train.trainer
- Add mask_blur and mask threshold options
- _base.py - Pass mask options through training_opts dict
- plugins.train.model - check for mask_type not None for learn_mask and penalized_mask_loss
- Limit alignments loading to just those faces that appear in the training folder
- Raise error if not all training images have an alignment, and alignment file is required
- lib.training_data - Mask generation code
- lib.faces_detect - cv2 dimension stripping bugfix
- Remove cv2 linting code

* Update mask helptext in cli.py

* Fix Warp to Landmarks
Remove SHA1 hashing from training data

* Update mask training config

* Capture missing masks at training init

* lib.image.read_image_batch - Return filenames with batch for ordering

* scripts.train - Documentation

* plugins.train.trainer - documentation

* Ensure backward compatibility.
Fix convert for new predicted masks

* Update removed masks to components for legacy models. 
lib/convert.py