              tqdm(self.find_images(input_dir), desc="Loading", file=sys.stdout)
          ]
  
          img_list_len = len(img_list)
          for i in tqdm(range(0, img_list_len), desc="Sorting", file=sys.stdout):
              score_total = 0
              for j in range(0, img_list_len):
                  if i == j:
                      continue
                  score_total += cv2.compareHist(img_list[i][1],
 
</s> remove                 score_total += cv2.compareHist(img_list[i][1],
                                               img_list[j][1],
                                               cv2.HISTCMP_BHATTACHARYYA)

 </s> add                 score_total += 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         img_list = [
            [img,
             cv2.calcHist([read_image(img, raise_error=True)], [0], None, [256], [0, 256]), 0]
            for img in
            tqdm(self.find_images(input_dir), desc="Loading", file=sys.stdout)
        ]
 </s> add         logger.info("Calculating histograms...")
        histograms = [cv2.calcHist([img], [0], None, [256], [0, 256]) for img in image_list]
        img_list = list(list(items) for items in zip(filename_list, histograms, 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):
        for i in tqdm(range(0, img_list_len), desc="Comparing", file=sys.stdout):
              tqdm(self.find_images(input_dir), desc="Loading", file=sys.stdout)
          ]
  
          img_list_len = len(img_list)
        for i in tqdm(range(0, img_list_len), desc="Comparing", file=sys.stdout):
              score_total = 0
              for j in range(0, img_list_len):
                  if i == j:
                      continue
                  score_total += cv2.compareHist(img_list[i][1],
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