  from lib.faces_detect import DetectedFace
  from lib.image import read_image
  from lib.queue_manager import queue_manager
  from lib.vgg_face2_keras import VGGFace2 as VGGFace
  from plugins.plugin_loader import PluginLoader
  
  from . import cli
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
 
</s> remove from lib.queue_manager import queue_manager
 </s> add  </s> remove from concurrent import futures
 </s> add  </s> remove         kwargs = dict(in_queue=queue_manager.get_queue("in"),
                      out_queue=queue_manager.get_queue("out"),
                      queue_size=8)
        aligner = PluginLoader.get_aligner("fan")(normalize_method="hist")
        aligner.batchsize = 1  # TODO Put batches at a time or load from alignment file
        aligner.initialize(**kwargs)
        aligner.start()
 </s> add         extractor = Extractor(None, "fan", None, normalize_method="hist")
        extractor.set_batchsize("align", 1)
        extractor.launch()
        return extractor </s> remove         for feed in tqdm(feed_list, desc="Putting...", file=sys.stdout):
            queue_manager.get_queue("in").put(feed)
        for index, _ in enumerate(tqdm(landmarks, desc="Aligning...", file=sys.stdout)):
            face = queue_manager.get_queue("out").get()
            landmarks[index] = np.array(face["detected_faces"][0].landmarks_xy)
 </s> add         # TODO thread the put to queue so we don't have to put and get at the same time
        # Or even better, set up a proper background loader from disk (i.e. use lib.image.ImageIO)
        for idx, feed in enumerate(tqdm(feed_list, desc="Aligning...", file=sys.stdout)):
            extractor.input_queue.put(feed)
            landmarks[idx] = next(extractor.detected_faces()).detected_faces[0].landmarks_xy
from plugins.extract.pipeline import Extractor, ExtractMedia
  from lib.faces_detect import DetectedFace
  from lib.image import read_image
  from lib.queue_manager import queue_manager
  from lib.vgg_face2_keras import VGGFace2 as VGGFace
from plugins.extract.pipeline import Extractor, ExtractMedia
  
  from . import cli
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
keep keep keep keep replace keep keep keep keep keep
 Bugfix: Sort by Yaw - Use Pipeline for landmarks 
tools/sort.py