  
  import logging
  
  from hashlib import sha1
  from random import random, shuffle, choice
  
  import numpy as np
  import cv2
  from scipy.interpolate import griddata
  
 
</s> remove """ Process training data for model training """
 </s> add """ Handles Data Augmentation for feeding Faceswap Models """ </s> remove import subprocess
 </s> add  </s> remove import imageio_ffmpeg as im_ffm
 </s> add 
from random import shuffle, choice
  
  import logging
  
  from hashlib import sha1
from random import shuffle, choice
  
  import numpy as np
  import cv2
  from scipy.interpolate import griddata
  
keep keep keep keep replace keep keep keep keep keep
 Optimize Data Augmentation (#881)

* Move image utils to lib.image
* Add .pylintrc file
* Remove some cv2 pylint ignores
* TrainingData: Load images from disk in batches
* TrainingData: get_landmarks to batch
* TrainingData: transform and flip to batches
* TrainingData: Optimize color augmentation
* TrainingData: Optimize target and random_warp
* TrainingData - Convert _get_closest_match for batching
* TrainingData: Warp To Landmarks optimized
* Save models to threadpoolexecutor
* Move stack_images, Rename ImageManipulation. ImageAugmentation Docstrings
* Masks: Set dtype and threshold for lib.masks based on input face
* Docstrings and Documentation 
lib/training_data.py