          """ numpy.ndarray: The mask at the size of :attr:`stored_size` with any requested blurring
          and threshold amount applied."""
          dims = (self.stored_size, self.stored_size, 1)
          mask = np.frombuffer(decompress(self._mask), dtype="uint8").reshape(dims)
          if self._threshold != 0.0 or self._blur_kernel != 0:
              mask = mask.copy()
          if self._threshold != 0.0:
              mask[mask < self._threshold] = 0.0
              mask[mask > 255.0 - self._threshold] = 255.0
          if self._blur_kernel != 0:
 
</s> remove         if self._blur_kernel != 0:
            mask = cv2.GaussianBlur(mask, (self._blur_kernel, self._blur_kernel), 0)[..., None]
 </s> add         if self._blur["kernel"] != 0:
            mask = BlurMask(self._blur["type"],
                            mask,
                            self._blur["kernel"],
                            passes=self._blur["passes"]).blurred </s> remove         if blur_kernel == 0 or blur_kernel % 2 == 1:
            self._blur_kernel = blur_kernel
        else:
            self._blur_kernel = blur_kernel + 1
 </s> add         if blur_type is not None:
            blur_kernel += 0 if blur_kernel == 0 or blur_kernel % 2 == 1 else 1
            self._blur["kernel"] = blur_kernel
            self._blur["type"] = blur_type
            self._blur["passes"] = blur_passes </s> remove         return mask, raw_mask
 </s> add         return mask.astype("float32") / 255.0, raw_mask.astype("float32") / 255.0

    def _get_mask(self, detected_face, predicted_mask):
        """ Return the requested mask with any requested blurring applied. </s> remove         if not self.skip and self.do_erode:
            mask = self.erode(mask)
        if not self.skip and self.do_blend:
            mask = self.blend(mask)
 </s> add         if not self.skip and self._do_erode:
            mask = self._erode(mask)
        if self._threshold != 0.0 or self._blur["kernel"] != 0:
          """ numpy.ndarray: The mask at the size of :attr:`stored_size` with any requested blurring
          and threshold amount applied."""
          dims = (self.stored_size, self.stored_size, 1)
          mask = np.frombuffer(decompress(self._mask), dtype="uint8").reshape(dims)
        if self._threshold != 0.0 or self._blur["kernel"] != 0:
              mask = mask.copy()
          if self._threshold != 0.0:
              mask[mask < self._threshold] = 0.0
              mask[mask > 255.0 - self._threshold] = 255.0
          if self._blur_kernel != 0:
keep keep keep keep replace keep keep keep keep keep
 Smart Masks to Convert (#957)

- scripts.convert - Use Smart Masks for Convert
    * Make on-the-fly conversion an explicit option

- Move BlurMask to lib.faces_detect

- tools.preview - Fix for smart masks
    * Subclass from tk.Tk
    * Options to lib.gui.control_helper
    *variable cleanup

- lib.logger - Demote more tensorflow deprecation messages

- Documentation:
    * lib.faces_detect.BlurMask
    * plugins.convert.mask
    * lib.convert
    * scripts.convert
    * scripts.fsmedia
    * tools.preview 
lib/faces_detect.py