  
                  if score < min_score:
                      min_score = score
                      j_min_score = j
              (img_list[i + 1],
               img_list[j_min_score]) = (img_list[j_min_score],
                                         img_list[i + 1])
          return img_list
  
      def sort_face_cnn_dissim(self):
          """ Sort by CNN dissimilarity """
          self.launch_aligner()
 
</s> remove             (img_list[i + 1],
             img_list[j_min_score]) = (img_list[j_min_score],
                                       img_list[i + 1])
 </s> add             (img_list[i + 1], img_list[j_min_score]) = (img_list[j_min_score], img_list[i + 1]) </s> remove             for j in range(i + 1, len(img_list)):
                score = cv2.compareHist(img_list[i][1],
                                        img_list[j][1],
                                        cv2.HISTCMP_BHATTACHARYYA)
 </s> add             for j in range(i + 1, img_list_len):
                score = cv2.compareHist(img_list[i][1], img_list[j][1], distance) </s> remove             for j in range(i + 1, len(img_list)):
 </s> add             for j in range(i + 1, img_list_len): </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         """ Sort by histigram of face dissimilarity """
        input_dir = self.args.input_dir

 </s> add         """ Sort by image histogram dissimilarity """
            (img_list[i + 1], img_list[j_min_score]) = (img_list[j_min_score], img_list[i + 1])
  
                  if score < min_score:
                      min_score = score
                      j_min_score = j
            (img_list[i + 1], img_list[j_min_score]) = (img_list[j_min_score], img_list[i + 1])
            (img_list[i + 1], img_list[j_min_score]) = (img_list[j_min_score], img_list[i + 1])
            (img_list[i + 1], img_list[j_min_score]) = (img_list[j_min_score], img_list[i + 1])
          return img_list
  
      def sort_face_cnn_dissim(self):
          """ Sort by CNN dissimilarity """
          self.launch_aligner()
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