Skip to content
Permalink
Browse files

fix for final

  • Loading branch information...
iperov committed Mar 15, 2019
1 parent 1beb2f0 commit 35492722441f25dc9af0526b7849e322a048923f
Showing with 9 additions and 4 deletions.
  1. +9 −4 mainscripts/Sorter.py
@@ -635,17 +635,22 @@ def sort_final(input_path, include_by_blur=True):
imgs_per_grad += total_lack // grads
sharpned_imgs_per_grad = imgs_per_grad*10

for g in io.progress_bar_generator ( range (grads), "Normalizing"):
img_list = yaws_sample_list[g]
if img_list is None:
continue

if len(img_list) > imgs_per_grad*2:
trash_img_list += img_list[len(img_list) // 2:]
img_list = img_list[0: len(img_list) // 2]

if include_by_blur:
for g in io.progress_bar_generator ( range (grads), "Sort by blur"):
img_list = yaws_sample_list[g]
if img_list is None:
continue

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

if len(img_list) > imgs_per_grad*2:
trash_img_list += img_list[len(img_list) // 2:]
img_list = img_list[0: len(img_list) // 2]

if len(img_list) > sharpned_imgs_per_grad:
trash_img_list += img_list[sharpned_imgs_per_grad:]

0 comments on commit 3549272

Please sign in to comment.
You can’t perform that action at this time.