Hi,
I would like to crop different locations of my images, not just the center and I am using Jeremy’s code. Any suggestions for modifications or even a new custom transformation?
load valid set
src = ImageImageList.from_folder(valid_lr).split_by_rand_pct(0.1, seed = 48)
trying to get crop_pad OR rand_crop working
tfms = [zoom(scale = 4, p = 1.), crop_pad (row_pct = torch.randn(1, 1), col_pct = torch.randn(1, 1)]
tfm = [zoom(scale = 4, p = 1.), rand_crop(p = 1)]
Jeremy’s function
def get_data(bs, size):
data = (src.label_from_func(lambda x: valid_lr/x.name)
.transform(tfms, size = size)
.databunch(bs = bs).normalize(imagenet_stats, do_y = True))
data.c = 1
return data
The current output image:
Thanks
FIXED:
tfm = [rand_zoom(4.), rand_crop(p = 1)]