Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
fix for final
Browse files Browse the repository at this point in the history
  • Loading branch information
iperov committed Mar 15, 2019
1 parent 1beb2f0 commit 3549272
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mainscripts/Sorter.py
Expand Up @@ -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:]
Expand Down

0 comments on commit 3549272

Please sign in to comment.