          header = np.concatenate([headers["a"], headers["b"]], axis=1)
          figure = np.concatenate([figures["a"], figures["b"]], axis=0)
          height = int(figure.shape[0] / width)
          figure = figure.reshape((width, height) + figure.shape[1:])
          figure = stack_images(figure)
          figure = np.vstack((header, figure))
  
          logger.debug("Compiled sample")
          return np.clip(figure * 255, 0, 255).astype('uint8')
  
      @staticmethod
 
</s> remove             headers = self.duplicate_headers(headers, side_cols)
 </s> add             headers = self._duplicate_headers(headers, side_cols) </s> remove     def resize_sample(side, sample, target_size):
        """ Resize samples where predictor expects different shape from processed image """
 </s> add     def _resize_sample(side, sample, target_size):
        """ Resize a given image to the target size.

        Parameters
        ----------
        sample: :class:`numpy.ndarray`
            The sample to be resized
        target_size: int
            The size that the sample should be resized to

        Returns
        -------
        :class:`numpy.ndarray`
            The sample resized to the target size
        """ </s> remove         height = int(64 * self.scaling)
 </s> add         height = int(64 * self._scaling) </s> remove             frame = self.frame_overlay(full, target_size, (0, 0, 255))
 </s> add             frame = self._frame_overlay(full, target_size, (0, 0, 255)) </s> remove         target_size = int(full_size * self.coverage_ratio)
 </s> add         target_size = int(full_size * self._coverage_ratio)
        figure = _stack_images(figure)
        figure = np.concatenate((header, figure), axis=0)
          header = np.concatenate([headers["a"], headers["b"]], axis=1)
          figure = np.concatenate([figures["a"], figures["b"]], axis=0)
          height = int(figure.shape[0] / width)
          figure = figure.reshape((width, height) + figure.shape[1:])
        figure = _stack_images(figure)
        figure = np.concatenate((header, figure), axis=0)
        figure = _stack_images(figure)
        figure = np.concatenate((header, figure), axis=0)
  
          logger.debug("Compiled sample")
          return np.clip(figure * 255, 0, 255).astype('uint8')
  
      @staticmethod
keep keep keep keep 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. 
plugins/train/trainer/_base.py