          """
          new_list = []
          # Make new list of just image paths to serve as an index
          val_index_list = [i[0] for i in new_vals_list]
          for i in tqdm(range(len(sorted_list)),
                        desc="Splicing",
                        file=sys.stdout):
              current_img = sorted_list[i] if isinstance(sorted_list[i], str) else sorted_list[i][0]
              new_val_index = val_index_list.index(current_img)
              new_list.append([current_img, new_vals_list[new_val_index][1]])
  
          return new_list
 
</s> remove         logger.info("Sorting by face-cnn similarity...")
        img_list = []
        for img in tqdm(self.find_images(input_dir),
                        desc="Loading",
                        file=sys.stdout):
            landmarks = self.get_landmarks(img)
            img_list.append([img, np.array(landmarks)
                             if landmarks
                             else np.zeros((68, 2))])

        queue_manager.terminate_queues()
 </s> add         logger.info("Comparing landmarks and sorting...") </s> remove             temp_list = [[img, self.estimate_blur(read_image(img, raise_error=True))]
                         for img in
                         tqdm(self.find_images(input_dir),
                              desc="Reloading",
                              file=sys.stdout)]
 </s> add             filename_list, image_list = self._get_images()
            blurs = [self.estimate_blur(img) for img in image_list]
            temp_list = list(zip(filename_list, blurs)) </s> remove         """ Sort by CNN dissimilarity """
        self.launch_aligner()
        input_dir = self.args.input_dir

        logger.info("Sorting by face-cnn dissimilarity...")

        img_list = []
        for img in tqdm(self.find_images(input_dir),
                        desc="Loading",
                        file=sys.stdout):
            landmarks = self.get_landmarks(img)
            img_list.append([img, np.array(landmarks)
                             if landmarks
                             else np.zeros((68, 2)), 0])
 </s> add         """ Sort by landmark dissimilarity """
        logger.info("Sorting by landmark dissimilarity...")
        filename_list, image_list, landmarks = self._get_landmarks()
        scores = np.zeros(len(filename_list), dtype='float32')
        img_list = list(list(items) for items in zip(filename_list, landmarks, scores)) </s> remove         for i in tqdm(range(0, img_list_len - 1),
                      desc="Sorting",
                      file=sys.stdout):
 </s> add         for i in tqdm(range(0, img_list_len - 1), desc="Comparing...", file=sys.stdout): </s> remove         image = read_image(image_file, raise_error=True)
 </s> add 
        for i in tqdm(range(len(sorted_list)), desc="Splicing", file=sys.stdout):
          """
          new_list = []
          # Make new list of just image paths to serve as an index
          val_index_list = [i[0] for i in new_vals_list]
        for i in tqdm(range(len(sorted_list)), desc="Splicing", file=sys.stdout):
        for i in tqdm(range(len(sorted_list)), desc="Splicing", file=sys.stdout):
        for i in tqdm(range(len(sorted_list)), desc="Splicing", file=sys.stdout):
              current_img = sorted_list[i] if isinstance(sorted_list[i], str) else sorted_list[i][0]
              new_val_index = val_index_list.index(current_img)
              new_list.append([current_img, new_vals_list[new_val_index][1]])
  
          return new_list
keep keep keep keep replace replace 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