  
      # <<< DETECTION IMAGE COMPILATION METHODS >>> #
      def _compile_detection_image(self, input_image):
          """ Compile the detection image for feeding into the model"""
          image = self._convert_color(input_image)
  
          image_size = image.shape[:2]
          scale = self._set_scale(image_size)
          pad = self._set_padding(image_size, scale)
  
 
</s> remove             image = cv2.copyMakeBorder(  # pylint:disable=no-member
                image,
                pad_t,
                pad_b,
                pad_l,
                pad_r,
                cv2.BORDER_CONSTANT)  # pylint:disable=no-member
 </s> add             image = cv2.copyMakeBorder(image,  # pylint:disable=no-member
                                       pad_t,
                                       pad_b,
                                       pad_l,
                                       pad_r,
                                       cv2.BORDER_CONSTANT)  # pylint:disable=no-member </s> remove         qname = "extract_align_out" if self.final_pass else "extract_align_in"
 </s> add         qname_dict = dict(detect="extract_align_in",
                          align="extract_mask_in",
                          mask="extract_mask_out")
        qname = "extract_mask_out" if self.final_pass else qname_dict[self.phase] </s> remove             logger.debug("Switching to align phase")
            self.phase = "align"
 </s> add             self.phase = "align" if self.phase == "detect" else "mask"
            logger.debug("Switching to %s phase", self.phase) </s> remove         feed_faces = np.stack([detected_face.feed_face for detected_face in detected_faces])
 </s> add         feed_faces = np.stack([detected_face.feed_face / 255. for detected_face in detected_faces]) </s> remove         adjusted_ratio = coverage_ratio - (1 - self._extract_ratio)
        padding = round((size * adjusted_ratio) / 2)
 </s> add         padding = int((size * (coverage_ratio - 0.625)) / 2)
        image = self._convert_color(input_image[..., :3])
  
      # <<< DETECTION IMAGE COMPILATION METHODS >>> #
      def _compile_detection_image(self, input_image):
          """ Compile the detection image for feeding into the model"""
        image = self._convert_color(input_image[..., :3])
  
          image_size = image.shape[:2]
          scale = self._set_scale(image_size)
          pad = self._set_padding(image_size, scale)
  
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
plugins/extract/detect/_base.py