How does tfms work with an array?

I am struggling to get tfms to work. I create a dataset and dataloader and databunch which all works fine without tfms but as soon as I add tfms then I get:

db = ImageDataBunch(dltrain, dlvalid, tfms=get_transforms()).normalize(imagenet_stats)

‘list’ object is not callable

I tried changing it to get_transforms()[0] thinking maybe it needs just one set of transforms. But then I get

‘list’ object has no attribute ‘pixel’

Do arrays have to be converted into image objects? Are there any simple examples for the basic case of training from a numpy array. The docs only seem to cover more complex cases.

1 Like

The correct argument is ds_tfms if you want to use data augmentation. tfms are for the dataloaders.

Thanks. Is there an example somewhere? There is no ds_tfms parameter for a databunch. The imagedatabunch does not have any “fromarray” constructor only ones that need labellists and stuff. I was looking for quick and easy just using an array without a lot of boiler plate.