Hello from spain comunity.
I am working with this repository
I am using the TRAIN.PY file (to train) and i would like make a little data augmentation (random rotation between -45 and 45 degree) in the fly.
In the lane 31 you can see this
train_dataset = Batch_Balanced_Dataset(opt)
And line 145
while(True): # train part image_tensors, labels = train_dataset.get_batch() image = image_tensors.to(device)
In Dataset.py, the method get_batch in Batch_Balanced_Dataset is something like this
def get_batch(self): balanced_batch_images =  balanced_batch_texts =  for i, data_loader_iter in enumerate(self.dataloader_iter_list): try: image, text = data_loader_iter.next() balanced_batch_images.append(image) balanced_batch_texts += text except StopIteration: self.dataloader_iter_list[i] = iter(self.data_loader_list[i]) image, text = self.dataloader_iter_list[i].next() balanced_batch_images.append(image) balanced_batch_texts += text except ValueError: pass balanced_batch_images = torch.cat(balanced_batch_images, 0) return balanced_batch_images, balanced_batch_texts
This are link to the code
Could you help me to make that random rotation in the fly? I am not familiarized with dataloader in pytorch yet