text_plain_output_1.png
from albumentations.pytorch import ToTensorV2

import albumentations as A  # our data augmentation library

def get_transforms(train=False):
    if train:
        transform = A.Compose([A.Resize(600, 600), A.HorizontalFlip(p=0.3), A.VerticalFlip(p=0.3), A.RandomBrightnessContrast(p=0.1), A.ColorJitter(p=0.1), ToTensorV2()], bbox_params=A.BboxParams(format='coco'))
    else:
        transform = A.Compose([A.Resize(600, 600), ToTensorV2()], bbox_params=A.BboxParams(format='coco'))
    return transform

dataset_path = '/kaggle/input/aquarium-dataset/Aquarium Combined/'

train_dataset = AquariumDetection(root=dataset_path, transforms=get_transforms(True))