          aligner.initialize(**kwargs)
          aligner.start()
  
      @staticmethod
      def alignment_dict(image):
          """ Set the image to a dict for alignment """
          height, width = image.shape[:2]
          face = DetectedFace(x=0, w=width, y=0, h=height)
          return {"image": image,
                  "detected_faces": [face]}
 
</s> remove     @staticmethod
    def get_landmarks(filename):
        """ Extract the face from a frame (If not alignments file found) """
        image = read_image(filename, raise_error=True)
        feed = Sort.alignment_dict(image)
        feed["filename"] = filename
        queue_manager.get_queue("in").put(feed)
        face = queue_manager.get_queue("out").get()
        landmarks = face["detected_faces"][0].landmarks_xy
        return landmarks
 </s> add     def _get_landmarks(self):
        """ Multi-threaded, parallel and sequentially ordered landmark loader """
        self.launch_aligner()
        filename_list, image_list = self._get_images()
        feed_list = list(map(Sort.alignment_dict, filename_list, image_list))
        landmarks = np.zeros((len(feed_list), 68, 2), dtype='float32')

        logger.info("Finding landmarks in images...")
        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)

        return filename_list, image_list, landmarks

    def _get_images(self):
        """ Multi-threaded, parallel and sequentially ordered image loader """
        logger.info("Loading images...")
        filename_list = self.find_images(self.args.input_dir)
        with futures.ThreadPoolExecutor() as executor:
            image_list = list(tqdm(executor.map(read_image, filename_list),
                                   desc="Loading Images...",
                                   file=sys.stdout,
                                   total=len(filename_list)))

        return filename_list, image_list </s> remove         aligner.batchsize = 1
 </s> add         aligner.batchsize = 1  # TODO Put batches at a time or load from alignment file </s> remove     def estimate_blur(image_file):
 </s> add     def estimate_blur(image): </s> remove         image = read_image(image_file, raise_error=True)
 </s> add 
    def alignment_dict(filename, image):
          aligner.initialize(**kwargs)
          aligner.start()
  
      @staticmethod
    def alignment_dict(filename, image):
          """ Set the image to a dict for alignment """
          height, width = image.shape[:2]
          face = DetectedFace(x=0, w=width, y=0, h=height)
          return {"image": image,
                  "detected_faces": [face]}
keep keep keep keep replace keep keep keep keep keep
 ENHANCEMENT: Sort image multi-threading and code clarity (#912)

* Use multi-threaded loading

* fast reload

* remove landmark stub

* saves

* correct face sort

* pep8 
tools/sort.py