Try to do data augmentation for a tensor

Hi, everyone. I try to use fastai to do data augmentation for tensor, such as follows:
img = uniform(150,180,(sz,sz,3))/255
I try to use the function ‘apply_tfms’, such as:
train_tfms, val_tfms = get_transforms(); img = img.apply_tfms(val_tfms, sz)
It fails, how could I accomplish my aim?

You need to convert img to a fastai Image with Image(img). Then you’ll be able to use the apply_tfms method.

Thank you, I have accomplished the transformation. In addition, I want to ask you a question, what function is similar to ‘tfms_from_model’ in fastai 1.0? Thanks!

It’s get_transforms in v1.