          side = side.upper()
          height = int(64 * self.scaling)
          total_width = width * 3
          logger.debug("height: %s, total_width: %s", height, total_width)
          font = cv2.FONT_HERSHEY_SIMPLEX  # pylint: disable=no-member
          texts = ["{} ({})".format(titles[0], side),
                   "{0} > {0}".format(titles[0]),
                   "{} > {}".format(titles[0], titles[1])]
          text_sizes = [cv2.getTextSize(texts[idx],  # pylint: disable=no-member
                                        font,
 
</s> remove         height = int(64 * self.scaling)
 </s> add         height = int(64 * self._scaling) </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] </s> remove         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)
 </s> add         interpn = cv2.INTER_CUBIC if scale > 1.0 else cv2.INTER_AREA
        retval = np.array([cv2.resize(img, (target_size, target_size), interpn) </s> remove             cv2.putText(header_box,  # pylint: disable=no-member
 </s> add             cv2.putText(header_box, </s> remove     def get_headers(self, side, width):
        """ Set headers for images """
 </s> add     def _get_headers(self, side, width):
        """ Set header row for the final preview frame

        Parameters
        ----------
        side: {"a" or "b"}
            The side that the headers should be generated for
        width: int
            The width of each column in the preview frame

        Returns
        -------
        :class:`numpy.ndarray`
            The column headings for the given side
        """
        font = cv2.FONT_HERSHEY_SIMPLEX
          side = side.upper()
          height = int(64 * self.scaling)
          total_width = width * 3
          logger.debug("height: %s, total_width: %s", height, total_width)
        font = cv2.FONT_HERSHEY_SIMPLEX
          texts = ["{} ({})".format(titles[0], side),
                   "{0} > {0}".format(titles[0]),
                   "{} > {}".format(titles[0], titles[1])]
          text_sizes = [cv2.getTextSize(texts[idx],  # pylint: disable=no-member
                                        font,
keep keep keep keep 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