      def sort_hist_dissim(self):
          """ Sort by image histogram dissimilarity """
          logger.info("Sorting by histogram dissimilarity...")
  
          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         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         """ Sort by histigram of face dissimilarity """
        input_dir = self.args.input_dir

 </s> add         """ Sort by image histogram dissimilarity """ </s> remove         img_list = [
            [img, cv2.calcHist([read_image(img, raise_error=True)], [0], None, [256], [0, 256])]
            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(zip(filename_list, histograms))
        filename_list, image_list = self._get_images()
        scores = np.zeros(len(filename_list), dtype='float32')
        distance = cv2.HISTCMP_BHATTACHARYYA
      def sort_hist_dissim(self):
          """ Sort by image histogram dissimilarity """
          logger.info("Sorting by histogram dissimilarity...")
        filename_list, image_list = self._get_images()
        scores = np.zeros(len(filename_list), dtype='float32')
        distance = cv2.HISTCMP_BHATTACHARYYA
  
          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))
keep keep add 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