Fastiai library: How to use multiple transforms on data batches

Hi,
I want to use both types of transforms transforms_side_on transforms_top_down simultaneously on a data set. I know I can use the any one of them

tfms = tfms_from_model(f_model, sz, aug_tfms=transforms_top_down, max_zoom=1.05)

Is there any detailed documentation available for the aug API.

Looking at the source, transforms look like they’re just a list. I’m not sure what would happen if you did transforms_top_down + transforms_side_on, since you’d wind up double-counting their common transforms, but you could always combine them manually:

transforms_top_down_and_side_on = transforms_basic + [RandomFlipXY()] + [RandomDihedralXY()]

That said, isn’t transform_top_down a superset of transform_side_on? A RandomFlipXY is a particular dihedral transform, so I don’t think doing both side on and top down transformations will really give you anything new beyond transforms_top_down.

2 Likes

Thanks man for to the point information.