2bcb7d572ac8fdacceb56d5cbd5b05fad8c71e5e,tools/sort/sort.py,Sort,sort_hist_dissim,#Sort#,295
Before Change
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))
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
for j in range(0, img_list_len):
if i == j:
continue
score_total += cv2.compareHist(img_list[i][1], img_list[j][1], distance)
img_list[i][2] = score_total
logger.info("Sorting...")
img_list = sorted(img_list, key=operator.itemgetter(2), reverse=True)
return img_list
def sort_color(self):
Score by channel average intensity
logger.info("Sorting by channel average intensity...")
After Change
img_list[i][2] = score_total
logger.info("Sorting...")
return sorted(img_list, key=lambda x: x[2], reverse=True)
def sort_color(self):
Score by channel average intensity
logger.info("Sorting by channel average intensity...")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: deepfakes/faceswap
Commit Name: 2bcb7d572ac8fdacceb56d5cbd5b05fad8c71e5e
Time: 2021-03-23
Author: 36920800+torzdf@users.noreply.github.com
File Name: tools/sort/sort.py
Class Name: Sort
Method Name: sort_hist_dissim
Project Name: fxsjy/jieba
Commit Name: 7b7c6955a9119734ac70f902129b7fbfd1f0b660
Time: 2014-11-28
Author: abcdoyle888@gmail.com
File Name: jieba/posseg/viterbi.py
Class Name:
Method Name: get_top_states
Project Name: deepfakes/faceswap
Commit Name: 2bcb7d572ac8fdacceb56d5cbd5b05fad8c71e5e
Time: 2021-03-23
Author: 36920800+torzdf@users.noreply.github.com
File Name: tools/sort/sort.py
Class Name: Sort
Method Name: sort_blur