I want to perform data augmentation to my data specificaly I want to perform random horizontal and vertical translation
this is the class that I implemented
I assume you are using PIL’s transformation? If so, it sounds like a valid approach. Could you describe why this approach doesn’t match your expected results?
at first i was only using center cropping and horizontall flip but my model overfit with 0.98 training accuracy and 0.45 vlidation accuracy after adding horizontal translation the accuracy values dropped for both training and validation (got 0.7 for training and 0.1 for validation )
this is the script that calls the functions in the main
def get_train_utils(opt, model_parameters):
spatial_transform =
spatial_transform.append(Resize(opt.sample_size))
spatial_transform.append(CenterCrop(opt.sample_size))
if not opt.no_hflip:
spatial_transform.append(RandomHorizontalFlip())
spatial_transform.append(HorizontalTranslation(40))
spatial_transform.append(ToTensor())
spatial_transform = Compose(spatial_transform)
and after that it will be called by the dataloader
I don’t think I am calling it wrong !! @ptrblck