          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))
  
          logger.info("Comparing histograms...")
          img_list_len = len(img_list)
          for i in tqdm(range(0, img_list_len), desc="Comparing", file=sys.stdout):
              score_total = 0
 
</s> remove         logger.info("Comparing histograms...")
 </s> add  </s> remove         filename_list, image_list = self._get_images()
        scores = np.zeros(len(filename_list), dtype='float32')
        distance = cv2.HISTCMP_BHATTACHARYYA
 </s> add  </s> remove         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))
 </s> add         # TODO We have metadata here, so we can mask the face for hist sorting
        img_list = [(filename, cv2.calcHist([image], [0], None, [256], [0, 256]))
                    for filename, image, _ in tqdm(self._loader.load(),
                                                   desc="Calculating histograms",
                                                   total=self._loader.count,
                                                   leave=False)] </s> remove         for i in tqdm(range(0, img_list_len), desc="Comparing", file=sys.stdout):
 </s> add         for i in tqdm(range(0, img_list_len), desc="Comparing histograms", file=sys.stdout): </s> remove         filename_list, image_list = self._get_images()
        distance = cv2.HISTCMP_BHATTACHARYYA
 </s> add 
        # TODO We have metadata here, so we can mask the face for hist sorting
        img_list = [[filename, cv2.calcHist([image], [0], None, [256], [0, 256]), 0.0]
                    for filename, image, _ in tqdm(self._loader.load(),
                                                   desc="Calculating histograms",
                                                   total=self._loader.count,
                                                   leave=False)]
          filename_list, image_list = self._get_images()
          scores = np.zeros(len(filename_list), dtype='float32')
          distance = cv2.HISTCMP_BHATTACHARYYA
  
        # TODO We have metadata here, so we can mask the face for hist sorting
        img_list = [[filename, cv2.calcHist([image], [0], None, [256], [0, 256]), 0.0]
                    for filename, image, _ in tqdm(self._loader.load(),
                                                   desc="Calculating histograms",
                                                   total=self._loader.count,
                                                   leave=False)]
        # TODO We have metadata here, so we can mask the face for hist sorting
        img_list = [[filename, cv2.calcHist([image], [0], None, [256], [0, 256]), 0.0]
                    for filename, image, _ in tqdm(self._loader.load(),
                                                   desc="Calculating histograms",
                                                   total=self._loader.count,
                                                   leave=False)]
        # TODO We have metadata here, so we can mask the face for hist sorting
        img_list = [[filename, cv2.calcHist([image], [0], None, [256], [0, 256]), 0.0]
                    for filename, image, _ in tqdm(self._loader.load(),
                                                   desc="Calculating histograms",
                                                   total=self._loader.count,
                                                   leave=False)]
  
          logger.info("Comparing histograms...")
          img_list_len = len(img_list)
          for i in tqdm(range(0, img_list_len), desc="Comparing", file=sys.stdout):
              score_total = 0
keep keep keep keep replace replace replace keep keep keep keep keep
 tools.sort
  - Add sort by size
  - Centralize some of the image loading routines 
tools/sort/sort.py