Skip to content Skip to sidebar Skip to footer

How To Get Add Aditional Transform To Get_transform In Fastai?

I would like to add aditional augmenmentation this way: additional_aug=[zoom_crop(scale=(0.75,1.25), do_rand=False), brightness(), contrast()

Solution 1:

I have faced this problem and the solution is very simple. Just call each transform function that you want to apply each inside a separate list enclosed by a list and pass it into get_transforms function's xtra_tfms parameter. (It could even be a tuple of tuples or any collection)

additional_aug=[[zoom_crop(scale=(0.75,1.25), do_rand=False)], 
                [brightness()], 
                [contrast()]]

tfms = get_transforms(do_flip=True,
                      flip_vert=True,
                      max_lighting=0.2, 
                      xtra_tfms=additional_aug)

Hope this solves your problem.

Post a Comment for "How To Get Add Aditional Transform To Get_transform In Fastai?"