  import os
  import sys
  import operator
  from shutil import copyfile
  
  import numpy as np
  import cv2
 
</s> remove from concurrent import futures
 </s> add  </s> remove from lib.queue_manager import queue_manager
 </s> add  </s> remove from plugins.plugin_loader import PluginLoader
 </s> add from plugins.extract.pipeline import Extractor, ExtractMedia </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 concurrent import futures
  import os
  import sys
  import operator
from concurrent import futures
  from shutil import copyfile
  
  import numpy as np
  import cv2
keep keep add keep keep keep keep
 Bugfix: Sort by Yaw - Use Pipeline for landmarks 
tools/sort.py