          if scale == 1.0:
              return sample
          logger.debug("Resizing sample: (side: '%s', sample.shape: %s, target_size: %s, scale: %s)",
                       side, sample.shape, target_size, scale)
          interpn = cv2.INTER_CUBIC if scale > 1.0 else cv2.INTER_AREA  # pylint: disable=no-member
          retval = np.array([cv2.resize(img,  # pylint: disable=no-member
                                        (target_size, target_size),
                                        interpn)
                             for img in sample])
          logger.debug("Resized sample: (side: '%s' shape: %s)", side, retval.shape)
          return retval
  
      def get_predictions(self, feed_a, feed_b):
 
</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     def get_predictions(self, feed_a, feed_b):
        """ Return the sample predictions from the model """
 </s> add     def _get_predictions(self, feed_a, feed_b):
        """ Feed the samples to the model and return predictions

        Parameters
        ----------
        feed_a: list
            List of :class:`numpy.ndarray` of feed images for the "a" side
        feed_a: list
            List of :class:`numpy.ndarray` of feed images for the "b" side

        Returns
        list:
            List of :class:`numpy.ndarray` of predictions received from the model
        """ </s> remove         height = int(64 * self.scaling)
 </s> add         height = int(64 * self._scaling) </s> remove         logger.debug("Compiling samples: (side: '%s', samples: %s)", self.side, num_images)
        images = images if images is not None else self.target
        retval = [samples[0:num_images]] if samples is not None else [self.samples[0:num_images]]
        if self.use_mask:
            retval.extend(tgt[0:num_images] for tgt in images)
        else:
            retval.extend(images[0:num_images])
 </s> add         logger.debug("Compiling samples: (side: '%s', samples: %s)", self._side, num_images)
        images = images if images is not None else self._target
        masks = masks if masks is not None else self._masks
        samples = samples if samples is not None else self._samples
        retval = [samples[0:num_images], images[0:num_images], masks[0:num_images]] </s> remove         text_sizes = [cv2.getTextSize(texts[idx],  # pylint: disable=no-member
                                      font,
                                      self.scaling * 0.8,
                                      1)[0]
 </s> add         text_sizes = [cv2.getTextSize(texts[idx], font, self._scaling * 0.8, 1)[0]
        interpn = cv2.INTER_CUBIC if scale > 1.0 else cv2.INTER_AREA
        retval = np.array([cv2.resize(img, (target_size, target_size), interpn)
          if scale == 1.0:
              return sample
          logger.debug("Resizing sample: (side: '%s', sample.shape: %s, target_size: %s, scale: %s)",
                       side, sample.shape, target_size, scale)
        interpn = cv2.INTER_CUBIC if scale > 1.0 else cv2.INTER_AREA
        retval = np.array([cv2.resize(img, (target_size, target_size), interpn)
        interpn = cv2.INTER_CUBIC if scale > 1.0 else cv2.INTER_AREA
        retval = np.array([cv2.resize(img, (target_size, target_size), interpn)
        interpn = cv2.INTER_CUBIC if scale > 1.0 else cv2.INTER_AREA
        retval = np.array([cv2.resize(img, (target_size, target_size), interpn)
        interpn = cv2.INTER_CUBIC if scale > 1.0 else cv2.INTER_AREA
        retval = np.array([cv2.resize(img, (target_size, target_size), interpn)
                             for img in sample])
          logger.debug("Resized sample: (side: '%s' shape: %s)", side, retval.shape)
          return retval
  
      def get_predictions(self, feed_a, feed_b):
keep keep keep keep 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. 
plugins/train/trainer/_base.py