          print("Grouping by blur...")
          bins = [[] for _ in range(num_bins)]
          image_index = 0
          for i in range(num_bins):
              for j in range(num_per_bin):
                  bins[i].append(img_list[image_index][0])
                  image_index += 1
  
          # If remainder is 0, nothing gets added to the last bin.
          for i in range(1, remainder + 1):
              bins[-1].append(img_list[-i][0])
  
 
</s> remove             for j in range(num_per_bin):
                bins[i].append(img_list[image_index][0])
                image_index += 1
 </s> add             for idx in range(num_per_bin):
                bins[i].append(img_list[idx][0]) </s> remove         image_index = 0
 </s> add  </s> remove         image_index = 0
 </s> add  </s> remove                 if f1encs is not None and f2encs is not None and len(
                        f1encs) > 0 and len(f2encs) > 0:
 </s> add                 if f1encs and f2encs:
            for idx in range(num_per_bin):
                bins[i].append(img_list[idx][0])
          print("Grouping by blur...")
          bins = [[] for _ in range(num_bins)]
          image_index = 0
          for i in range(num_bins):
            for idx in range(num_per_bin):
                bins[i].append(img_list[idx][0])
            for idx in range(num_per_bin):
                bins[i].append(img_list[idx][0])
            for idx in range(num_per_bin):
                bins[i].append(img_list[idx][0])
  
          # If remainder is 0, nothing gets added to the last bin.
          for i in range(1, remainder + 1):
              bins[-1].append(img_list[-i][0])
  
keep keep keep keep replace replace replace keep keep keep keep keep
 Merge staging to Master (#470)

* DLib scaling amends (#461)

* Scaling area fix and rework of frames and bounding boxes

* Update DLib scaling and initialization

* Extract - Detector reinitialization bugfix

* Slight OriginaHightRes Model re-factoring (#464)

* Model re-factoring, might fix red screen of death on multi-gpu configurations

* Limited trainer support for various INPUT_SIZE

* Auto Extraction multiprocess bugfix

* Sort tool bugfixes and linting 
tools/sort.py