camillegontier / DELAUNAY_dataset

MIT License
10 stars 4 forks source link

What are the size crops you recommend for delauny and why? #4

Open brando90 opened 2 years ago

brando90 commented 2 years ago

saw this one: https://github.com/camillegontier/DELAUNAY_dataset/blob/827db39400d8b5e12b4cc538b98a2f77099b747d/CNN_training/training.py#L26 curious about choice

@camillegontier

brando90 commented 2 years ago

more context. Original img process:

def _original_data_transforms_delauny(size: int = 256) -> transforms.Compose:
    transform = transforms.Compose([
        transforms.Resize((size, size)),
        transforms.ToTensor(),
        transforms.Normalize(mean=mean,
                             std=std),
    ])
    return transform
brando90 commented 2 years ago

the one I am trying to do:

        train_data_transform = Compose([
            # ToPILImage(),
            transforms.Resize((256, 256)),  # todo think about this, is this what we want to do? https://github.com/camillegontier/DELAUNAY_dataset/issues/4
            RandomCrop(size, padding=8),
            ColorJitter(brightness=0.4, contrast=0.4, saturation=0.4),
            RandomHorizontalFlip(),
            ToTensor(),
            normalize,
        ])
        test_data_transform = transforms.Compose([
            transforms.Resize((size, size)),
            transforms.ToTensor(),
            transforms.Normalize(mean=mean,
                                 std=std),
        ])
        validation_data_transform = test_data_transform

more is similar to imagenet like things.

brando90 commented 2 years ago

asking due to error:

ValueError: Requires scalar labels. 
Required crop size (84, 84) is larger then input image size (46, 616)
python-BaseException
brando90 commented 2 years ago

(also I think the target transform is missing from your 5cnn script?)

brando90 commented 2 years ago

this might be a consideration to use: https://pytorch.org/vision/main/generated/torchvision.transforms.RandAugment.html

brando90 commented 2 years ago

might be relevant: https://stackoverflow.com/questions/74451955/is-it-safe-to-do-a-totensor-data-transform-before-a-colorjitter-and-randomhori/74453591#74453591