def group_images(self):
    '\n        Order the images according to self.order and makes groups of self.batch_size.\n        '
    order = list(range(self.size()))
    if (self.group_method == 'random'):
        random.shuffle(order)
    elif (self.group_method == 'ratio'):
        order.sort(key=(lambda x: self.image_aspect_ratio(x)))
    self.groups = [[order[(x % len(order))] for x in range(i, (i + self.batch_size))] for i in range(0, len(order), self.batch_size)]
Order the images according to self.order and makes groups of self.batch_size.
def group_images(self):
    '\n        \n        '
    order = list(range(self.size()))
    if (self.group_method == 'random'):
        random.shuffle(order)
    elif (self.group_method == 'ratio'):
        order.sort(key=(lambda x: self.image_aspect_ratio(x)))
    self.groups = [[order[(x % len(order))] for x in range(i, (i + self.batch_size))] for i in range(0, len(order), self.batch_size)]