                                  if cv2.pointPolygonTest(face_core, (pty, ptx), False) >= 0))
                         for src, dst, face_core in zip(batch_src[:, :18, :],
                                                        batch_dst[:, :18, :],
                                                        face_cores)]
          batch_src = [np.delete(src, idxs, axis=0) for idxs, src in zip(rem_indices, batch_src)]
          batch_dst = [np.delete(dst, idxs, axis=0) for idxs, dst in zip(rem_indices, batch_dst)]
  
          grid_z = np.array([griddata(dst, src, (grids[0], grids[1]), method="linear")
                             for src, dst in zip(batch_src, batch_dst)])
          maps = grid_z.reshape((self._batchsize,
                                 self._training_size,
 
</s> remove                            for src, dst in zip(batch_src, batch_dst)])
 </s> add                            for src, dst in zip(lbatch_src, lbatch_dst)]) </s> remove                                self._training_size,
                               self._training_size,
 </s> add                                self._processing_size,
                               self._processing_size, </s> remove                                                          scale=2.0))
 </s> add                                                          scale=self._warp_lm_scale)) </s> remove                                  scale=self._scale).astype("float32")
        batch_maps = np.stack((mapx, mapy), axis=1) + rands
        batch_interp = np.array([[cv2.resize(map_, (pad, pad))[slices, slices] for map_ in maps]
 </s> add                                  scale=self._warp_scale).astype("float32")
        batch_maps = ne.evaluate("m + r", local_dict=dict(m=self._constants.warp_maps, r=rands))
        batch_interp = np.array([[cv2.resize(map_, self._constants.warp_pad)[slices, slices]
                                  for map_ in maps] </s> remove         warped_batch = np.array([cv2.resize(image[slices, slices, :],
                                            (self._input_size, self._input_size),
                                            cv2.INTER_AREA)
                                 for image in warped_batch])
        logger.trace("Warped batch shape: %s", warped_batch.shape)
 </s> add         logger.trace("Warped batch shape: %s", warped_batch.shape)  # type: ignore
        lbatch_src = [np.delete(src, idxs, axis=0) for idxs, src in zip(rem_indices, batch_src)]
        lbatch_dst = [np.delete(dst, idxs, axis=0) for idxs, dst in zip(rem_indices, batch_dst)]
                                  if cv2.pointPolygonTest(face_core, (pty, ptx), False) >= 0))
                         for src, dst, face_core in zip(batch_src[:, :18, :],
                                                        batch_dst[:, :18, :],
                                                        face_cores)]
        lbatch_src = [np.delete(src, idxs, axis=0) for idxs, src in zip(rem_indices, batch_src)]
        lbatch_dst = [np.delete(dst, idxs, axis=0) for idxs, dst in zip(rem_indices, batch_dst)]
        lbatch_src = [np.delete(src, idxs, axis=0) for idxs, src in zip(rem_indices, batch_src)]
        lbatch_dst = [np.delete(dst, idxs, axis=0) for idxs, dst in zip(rem_indices, batch_dst)]
  
          grid_z = np.array([griddata(dst, src, (grids[0], grids[1]), method="linear")
                             for src, dst in zip(batch_src, batch_dst)])
          maps = grid_z.reshape((self._batchsize,
                                 self._training_size,
keep keep keep keep replace 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 
lib/training/augmentation.py