  import tensorflow as tf
  from tensorflow.python.framework import (  # pylint:disable=no-name-in-module
      errors_impl as tf_errors)
  
  from lib.training import TrainingDataGenerator
  from lib.utils import FaceswapError, get_backend, get_folder, get_image_paths, get_tf_version
  from plugins.train._config import Config
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
 
</s> remove from tqdm import tqdm
from lib.align import AlignedFace, DetectedFace, get_centered_size
from lib.image import read_image_batch, read_image_meta_batch
 </s> add import numpy as np
import numexpr as ne
from lib.align import AlignedFace, DetectedFace
from lib.align.aligned_face import CenteringType
from lib.image import read_image_batch </s> remove from .generator import TrainingDataGenerator  # noqa
 </s> add from .generator import PreviewDataGenerator, TrainingDataGenerator  # noqa
from lib.training import PreviewDataGenerator, TrainingDataGenerator
from lib.training.generator import BatchType, ConfigType, DataGenerator
  import tensorflow as tf
  from tensorflow.python.framework import (  # pylint:disable=no-name-in-module
      errors_impl as tf_errors)
  
from lib.training import PreviewDataGenerator, TrainingDataGenerator
from lib.training.generator import BatchType, ConfigType, DataGenerator
  from lib.utils import FaceswapError, get_backend, get_folder, get_image_paths, get_tf_version
  from plugins.train._config import Config
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
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 
plugins/train/trainer/_base.py