          """ Sort by CNN similarity """
          self.launch_aligner()
          input_dir = self.args.input_dir
  
          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()
          img_list_len = len(img_list)
          for i in tqdm(range(0, img_list_len - 1),
                        desc="Sorting",
                        file=sys.stdout):
              min_score = float("inf")
 
</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         """ Sort by CNN similarity """
        self.launch_aligner()
        input_dir = self.args.input_dir
 </s> add         """ Sort by landmark similarity """
        logger.info("Sorting by landmark similarity...")
        filename_list, image_list, landmarks = self._get_landmarks()
        img_list = list(zip(filename_list, landmarks)) </s> remove             self.launch_aligner()
            temp_list = []
            for img in tqdm(self.find_images(input_dir),
                            desc="Reloading",
                            file=sys.stdout):
                landmarks = self.get_landmarks(img)
                temp_list.append([img, np.array(landmarks)
                                  if landmarks
                                  else np.zeros((68, 2))])
 </s> add             filename_list, image_list, landmarks = self._get_landmarks()
            temp_list = list(zip(filename_list, landmarks)) </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):
        logger.info("Comparing landmarks and sorting...")
          """ Sort by CNN similarity """
          self.launch_aligner()
          input_dir = self.args.input_dir
  
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
        logger.info("Comparing landmarks and sorting...")
          img_list_len = len(img_list)
          for i in tqdm(range(0, img_list_len - 1),
                        desc="Sorting",
                        file=sys.stdout):
              min_score = float("inf")
keep keep keep keep replace replace replace replace replace replace replace replace 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