How to use xtra_tfms to create multiple image transformations

I want to do multiple transformations with get_transforms(), but when i pass a list of transformations in xtra_tfms, like this:

  • tfms = get_transforms(xtra_tfms= [ contrast(scale=(0.5, 1.5), p=0.75), rand_resize_crop(224) ])
    It returns this error when i try to plot the transformtions:
  • AttributeError: ‘list’ object has no attribute ‘name

Looking at the definition of the function, it seems like I should pass xtra_tfms a list, like i did:

2 Likes

hi, were you able to find the answer? I am going through the forum - it’s as clear as mud how to stack transformers.

Problem is rand_resize_crop is a function that returns a list of both zoom_squish and crop transforms.

xtra_tfms = [contrast(scale=(0.5, 1.5), p=0.75)] + rand_resize_crop(224)

should work.

1 Like