How can I extract a image to smaller images in dataloader instead creating a new dataset that croped the image manually
    def __getitem__(self, index):
        img = Image.open(self.files[index % len(self.files)])
        img_lr = self.lr_transform(img)
        img_hr = self.hr_transform(img)

        return {"lr": img_lr, "hr": img_hr}

I want to extract the img(2048x2048) crop into four smaller images (1024x1024 each)
 __ __          __ __
|     |  =>    |__|__| 
|__ __|        |__|__|