          for filename, image in self._images.load():
              if load_queue.shutdown.is_set():
                  logger.debug("Reload Queue: Stop signal received. Terminating")
                  break
              logger.trace("Reloading image: '%s'", filename)
              extract_media = detected_faces.pop(filename, None)
              if not extract_media:
                  logger.warning("Couldn't find faces for: %s", filename)
                  continue
              extract_media.set_image(image)
 
</s> remove                 logger.trace("Adding image '%s' to skip list due to extract_every_n = %s",
                             filename, self._skip_num)
 </s> add                 logger.trace("Adding image '%s' to skip list due to "  # type: ignore
                             "extract_every_n = %s", filename, self._skip_num) </s> remove     def _add_localized_mask(self, filename, detected_face, area):
        """ Load a localized mask to the cache for the given area if it is required for training.
 </s> add     def _to_float32(self, in_array: np.ndarray) -> np.ndarray:
        """ Cast an UINT8 array in 0-255 range to float32 in 0.0-1.0 range. </s> remove         pose = self._cache[key]["aligned_face"].pose
        mask.set_sub_crop(pose.offset[mask.stored_centering],
                          pose.offset[self._centering],
                          self._centering)
 </s> add     def _set_color_order(self, batch) -> None:
        """ Set the color order correctly for the model's input type. </s> remove         aligned_face = AlignedFace(detected_face.landmarks_xy,
                                   centering=self._centering,
                                   size=self._size,
                                   is_aligned=True)
        logger.trace("Caching aligned face for: %s", filename)
        self._cache[os.path.basename(filename)]["aligned_face"] = aligned_face
        return detected_face
 </s> add         return self.process_batch(filenames, raw_faces, detected_faces, batch) </s> remove         logger.trace("Caching mask for: %s", filename)
        self._cache[key]["mask"] = mask
 </s> add         batch: :class:`numpy.ndarray`
            The pre-allocated batch with images in the first 3 channels in BGR order
        """
        if self._color_order == "rgb":
            batch[..., :3] = batch[..., [2, 1, 0]]
            logger.trace("Reloading image: '%s'", filename)  # type: ignore
          for filename, image in self._images.load():
              if load_queue.shutdown.is_set():
                  logger.debug("Reload Queue: Stop signal received. Terminating")
                  break
            logger.trace("Reloading image: '%s'", filename)  # type: ignore
              extract_media = detected_faces.pop(filename, None)
              if not extract_media:
                  logger.warning("Couldn't find faces for: %s", filename)
                  continue
              extract_media.set_image(image)
keep keep keep keep replace keep keep keep keep keep
 Data Augmentation update (#1263)

- lib.detected_face
    - Subclass Masks for Landmark based masks
    - Add training mask propery + methods to DetectedFace
  - lib.training_training
    - subclass TrainingDataGenerator for training and preview data
    - Split cache into own module
    - Reduce thread count to 1 to prevent image corruption + data re-use
    - Process on largest model input/output size rather than stored image size
    - Size and crop masks during caching stage
    - Implement ring buffer for data flow
    - Fix preview reload bug
  - augmentation
    - typing
    - switch color aug order
    - better initialization
    - Fix warp + landmark warp to correctly apply at different image scales
    - Slightly improved warp caching
    - Don't store whether image is_preview. Handle all data as training images implicitly
  - plugins.trainer: Typing and fixes to work with trainingdata refactor 
scripts/extract.py