0e0b2faa1a205fe276a7c53bc600fca60b239234,tools/sort.py,Sort,sort_hist,#Sort#,257

Before Change



    def sort_hist(self):
         Sort by histogram of face similarity 
        input_dir = self.args.input_dir

        logger.info("Sorting by histogram similarity...")

        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)
        ]

        img_list_len = len(img_list)
        for i in tqdm(range(0, img_list_len - 1), desc="Sorting",

After Change


        img_list = sorted(matched_list, key=operator.itemgetter(1), reverse=True)
        return img_list

    def sort_hist(self):
         Sort by image histogram similarity 
        logger.info("Sorting by histogram similarity...")
        filename_list, image_list = self._get_images()
        distance = cv2.HISTCMP_BHATTACHARYYA

        logger.info("Calculating histograms...")
        histograms = [cv2.calcHist([img], [0], None, [256], [0, 256]) for img in image_list]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: deepfakes/faceswap
Commit Name: 0e0b2faa1a205fe276a7c53bc600fca60b239234
Time: 2019-10-28
Author: vrooman.kyle@gmail.com
File Name: tools/sort.py
Class Name: Sort
Method Name: sort_hist


Project Name: deepfakes/faceswap
Commit Name: 0e0b2faa1a205fe276a7c53bc600fca60b239234
Time: 2019-10-28
Author: vrooman.kyle@gmail.com
File Name: tools/sort.py
Class Name: Sort
Method Name: sort_hist_dissim


Project Name: deepfakes/faceswap
Commit Name: 0e0b2faa1a205fe276a7c53bc600fca60b239234
Time: 2019-10-28
Author: vrooman.kyle@gmail.com
File Name: tools/sort.py
Class Name: Sort
Method Name: sort_hist


Project Name: deepfakes/faceswap
Commit Name: 0e0b2faa1a205fe276a7c53bc600fca60b239234
Time: 2019-10-28
Author: vrooman.kyle@gmail.com
File Name: tools/sort.py
Class Name: Sort
Method Name: sort_blur