Hi.
I am trying to apply data augmentation for my classifier and I’ve decided to try out the get_transforms()
method from vision.transform. This is the full thing:
get_transforms
get_transforms
(do_flip
:bool
=True
,flip_vert
:bool
=False
,max_rotate
:float
=10.0
,max_zoom
:float
=1.1
,max_lighting
:float
=0.2
,max_warp
:float
=0.2
,p_affine
:float
=0.75
,p_lighting
:float
=0.75
,xtra_tfms
:Optional
[Collection
[Transform
]]=None
) →Collection
[Transform
]
And this is just an example of how to use it:
tfms = get_transforms(max_rotate=25)
How would I apply tfms
to DataBunch? Do I just insert it as a parameter? What is the best way? This is my DataBunch at the moment:
data = ImageList.from_folder(path).split_by_rand_pct(valid_pct=0.2).label_from_re(pat=file_parse).transform(size=224).databunch()
And I’m feeding it into this cnn learner:
top_1 = partial(top_k_accuracy, k=1)
learn = cnn_learner(data, models.resnet50, metrics=[accuracy, top_1], loss_func = LabelSmoothingCrossEntropy(), callback_fns=ShowGraph)
And my other question is this: What do you guys think about a combination of visition.transform + TTA? I am currently running this model on Colab and 5 epochs take plenty of time so I can’t really increase my epochs.